chan_misdn_config.h

Go to the documentation of this file.
00001 /*
00002  * Chan_Misdn -- Channel Driver for Asterisk
00003  *
00004  * Interface to mISDN
00005  *
00006  * Copyright (C) 2004, Christian Richter
00007  *
00008  * Christian Richter <crich@beronet.com>
00009  *
00010  * This program is free software, distributed under the terms of
00011  * the GNU General Public License
00012  */
00013 
00014 /*! \file
00015  * \brief Interface to mISDN - Config
00016  * \author Christian Richter <crich@beronet.com>
00017  */
00018 
00019 
00020 
00021 
00022 #ifndef CHAN_MISDN_CONFIG_H
00023 #define CHAN_MISDN_CONFIG_H
00024 
00025 #define BUFFERSIZE 512
00026 
00027 enum misdn_cfg_elements {
00028 
00029    /* port config items */
00030    MISDN_CFG_FIRST = 0,
00031    MISDN_CFG_GROUPNAME,           /* char[] */
00032    MISDN_CFG_ALLOWED_BEARERS,           /* char[] */
00033    MISDN_CFG_FAR_ALERTING,        /* int (bool) */
00034    MISDN_CFG_RXGAIN,              /* int */
00035    MISDN_CFG_TXGAIN,              /* int */
00036    MISDN_CFG_TE_CHOOSE_CHANNEL,   /* int (bool) */
00037    MISDN_CFG_PMP_L1_CHECK,        /* int (bool) */
00038    MISDN_CFG_REJECT_CAUSE,    /* int */
00039    MISDN_CFG_ALARM_BLOCK,        /* int (bool) */
00040    MISDN_CFG_HDLC,                /* int (bool) */
00041    MISDN_CFG_CONTEXT,             /* char[] */
00042    MISDN_CFG_LANGUAGE,            /* char[] */
00043    MISDN_CFG_MUSICCLASS,            /* char[] */
00044    MISDN_CFG_CALLERID,            /* char[] */
00045    MISDN_CFG_INCOMING_CALLERID_TAG, /* char[] */
00046    MISDN_CFG_APPEND_MSN_TO_CALLERID_TAG, /* int (bool) */
00047    MISDN_CFG_METHOD,              /* char[] */
00048    MISDN_CFG_DIALPLAN,            /* int */
00049    MISDN_CFG_LOCALDIALPLAN,       /* int */
00050    MISDN_CFG_CPNDIALPLAN,       /* int */
00051    MISDN_CFG_TON_PREFIX_UNKNOWN,         /* char[] */
00052    MISDN_CFG_TON_PREFIX_INTERNATIONAL,   /* char[] */
00053    MISDN_CFG_TON_PREFIX_NATIONAL,        /* char[] */
00054    MISDN_CFG_TON_PREFIX_NETWORK_SPECIFIC,/* char[] */
00055    MISDN_CFG_TON_PREFIX_SUBSCRIBER,      /* char[] */
00056    MISDN_CFG_TON_PREFIX_ABBREVIATED,     /* char[] */
00057    MISDN_CFG_PRES,                /* int */
00058    MISDN_CFG_SCREEN,              /* int */
00059    MISDN_CFG_DISPLAY_CONNECTED,   /* int */
00060    MISDN_CFG_DISPLAY_SETUP,       /* int */
00061    MISDN_CFG_ALWAYS_IMMEDIATE,    /* int (bool) */
00062    MISDN_CFG_NODIALTONE,    /* int (bool) */
00063    MISDN_CFG_IMMEDIATE,           /* int (bool) */
00064    MISDN_CFG_SENDDTMF,           /* int (bool) */
00065    MISDN_CFG_ASTDTMF,            /* int (bool) */
00066    MISDN_CFG_HOLD_ALLOWED,        /* int (bool) */
00067    MISDN_CFG_EARLY_BCONNECT,      /* int (bool) */
00068    MISDN_CFG_INCOMING_EARLY_AUDIO,      /* int (bool) */
00069    MISDN_CFG_ECHOCANCEL,          /* int */
00070    MISDN_CFG_CC_REQUEST_RETENTION,/* bool */
00071    MISDN_CFG_OUTGOING_COLP,       /* int */
00072 #ifdef MISDN_1_2
00073    MISDN_CFG_PIPELINE,      /* char[] */
00074 #endif
00075 
00076 #ifdef WITH_BEROEC
00077    MISDN_CFG_BNECHOCANCEL,
00078    MISDN_CFG_BNEC_ANTIHOWL,
00079    MISDN_CFG_BNEC_NLP,
00080    MISDN_CFG_BNEC_ZEROCOEFF,
00081    MISDN_CFG_BNEC_TD,
00082    MISDN_CFG_BNEC_ADAPT,
00083 #endif
00084    MISDN_CFG_NEED_MORE_INFOS,     /* bool */
00085    MISDN_CFG_NOAUTORESPOND_ON_SETUP,     /* bool */
00086    MISDN_CFG_NTTIMEOUT,       /* bool */
00087    MISDN_CFG_BRIDGING,              /* bool */
00088    MISDN_CFG_JITTERBUFFER,             /* int */
00089    MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD,              /* int */
00090    MISDN_CFG_CALLGROUP,           /* ast_group_t */
00091    MISDN_CFG_PICKUPGROUP,         /* ast_group_t */
00092    MISDN_CFG_NAMEDCALLGROUP,      /* ast_namedgroups * */
00093    MISDN_CFG_NAMEDPICKUPGROUP,    /* ast_namedgroups * */
00094    MISDN_CFG_MAX_IN,              /* int */
00095    MISDN_CFG_MAX_OUT,              /* int */
00096    MISDN_CFG_L1_TIMEOUT,          /* int */
00097    MISDN_CFG_OVERLAP_DIAL,    /* int (bool)*/
00098    MISDN_CFG_MSNS,                /* char[] */
00099    MISDN_CFG_FAXDETECT,           /* char[] */
00100    MISDN_CFG_FAXDETECT_CONTEXT,   /* char[] */
00101    MISDN_CFG_FAXDETECT_TIMEOUT,   /* int */
00102    MISDN_CFG_PTP,                 /* int (bool) */
00103    MISDN_CFG_LAST,
00104 
00105    /* general config items */
00106    MISDN_GEN_FIRST,
00107 #ifndef MISDN_1_2
00108    MISDN_GEN_MISDN_INIT,           /* char[] */
00109 #endif
00110    MISDN_GEN_DEBUG,               /* int */
00111    MISDN_GEN_TRACEFILE,           /* char[] */
00112    MISDN_GEN_BRIDGING,            /* int (bool) */
00113    MISDN_GEN_STOP_TONE,           /* int (bool) */
00114    MISDN_GEN_APPEND_DIGITS2EXTEN, /* int (bool) */
00115    MISDN_GEN_DYNAMIC_CRYPT,       /* int (bool) */
00116    MISDN_GEN_CRYPT_PREFIX,        /* char[] */
00117    MISDN_GEN_CRYPT_KEYS,          /* char[] */
00118    MISDN_GEN_NTKEEPCALLS,          /* int (bool) */
00119    MISDN_GEN_NTDEBUGFLAGS,          /* int */
00120    MISDN_GEN_NTDEBUGFILE,          /* char[] */
00121    MISDN_GEN_LAST
00122 };
00123 
00124 enum misdn_cfg_method {
00125    METHOD_STANDARD = 0,
00126    METHOD_ROUND_ROBIN,
00127    METHOD_STANDARD_DEC
00128 };
00129 
00130 /* you must call misdn_cfg_init before any other function of this header file */
00131 int misdn_cfg_init(int max_ports, int reload);
00132 void misdn_cfg_reload(void);
00133 void misdn_cfg_destroy(void);
00134 
00135 void misdn_cfg_update_ptp( void );
00136 
00137 /* if you requst a general config element, the port value is ignored. if the requested
00138  * value is not available, or the buffer is too small, the buffer will be nulled (in
00139  * case of a char* only its first byte will be nulled). */
00140 void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void* buf, int bufsize);
00141 
00142 /* returns the enum element for the given name, returns MISDN_CFG_FIRST if none was found */
00143 enum misdn_cfg_elements misdn_cfg_get_elem (const char *name);
00144 
00145 /* fills the buffer with the name of the given config element */
00146 void misdn_cfg_get_name (enum misdn_cfg_elements elem, void *buf, int bufsize);
00147 
00148 /* fills the buffer with the description of the given config element */
00149 void misdn_cfg_get_desc (enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default);
00150 
00151 /* fills the buffer with a ',' separated list of all active ports */
00152 void misdn_cfg_get_ports_string(char *ports);
00153 
00154 /* fills the buffer with a nice printable string representation of the config element */
00155 void misdn_cfg_get_config_string(int port, enum misdn_cfg_elements elem, char* buf, int bufsize);
00156 
00157 /* returns the next available port number. returns -1 if the last one was reached. */
00158 int misdn_cfg_get_next_port(int port);
00159 int misdn_cfg_get_next_port_spin(int port);
00160 
00161 int misdn_cfg_is_msn_valid(int port, char* msn);
00162 int misdn_cfg_is_port_valid(int port);
00163 int misdn_cfg_is_group_method(char *group, enum misdn_cfg_method meth);
00164 
00165 #if 0
00166 char *misdn_cfg_get_next_group(char *group);
00167 int misdn_cfg_get_next_port_in_group(int port, char *group);
00168 #endif
00169 
00170 struct ast_jb_conf *misdn_get_global_jbconf(void);
00171 
00172 #endif

Generated on Thu Apr 16 06:27:22 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6