Thu Apr 28 2011 17:13:31

Asterisk developer's documentation


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_METHOD,              /* char[] */
00046    MISDN_CFG_DIALPLAN,            /* int */
00047    MISDN_CFG_LOCALDIALPLAN,       /* int */
00048    MISDN_CFG_CPNDIALPLAN,       /* int */
00049    MISDN_CFG_NATPREFIX,           /* char[] */
00050    MISDN_CFG_INTERNATPREFIX,      /* char[] */
00051    MISDN_CFG_PRES,                /* int */
00052    MISDN_CFG_SCREEN,              /* int */
00053    MISDN_CFG_ALWAYS_IMMEDIATE,    /* int (bool) */
00054    MISDN_CFG_NODIALTONE,    /* int (bool) */
00055    MISDN_CFG_IMMEDIATE,           /* int (bool) */
00056    MISDN_CFG_SENDDTMF,           /* int (bool) */
00057    MISDN_CFG_ASTDTMF,            /* int (bool) */
00058    MISDN_CFG_HOLD_ALLOWED,        /* int (bool) */
00059    MISDN_CFG_EARLY_BCONNECT,      /* int (bool) */
00060    MISDN_CFG_INCOMING_EARLY_AUDIO,      /* int (bool) */
00061    MISDN_CFG_ECHOCANCEL,          /* int */
00062 #ifdef MISDN_1_2
00063    MISDN_CFG_PIPELINE,      /* char[] */
00064 #endif
00065 
00066 #ifdef WITH_BEROEC
00067    MISDN_CFG_BNECHOCANCEL,
00068    MISDN_CFG_BNEC_ANTIHOWL,
00069    MISDN_CFG_BNEC_NLP,
00070    MISDN_CFG_BNEC_ZEROCOEFF,
00071    MISDN_CFG_BNEC_TD,
00072    MISDN_CFG_BNEC_ADAPT,
00073 #endif
00074    MISDN_CFG_NEED_MORE_INFOS,     /* bool */
00075    MISDN_CFG_NOAUTORESPOND_ON_SETUP,     /* bool */
00076    MISDN_CFG_NTTIMEOUT,       /* bool */
00077    MISDN_CFG_BRIDGING,              /* bool */
00078    MISDN_CFG_JITTERBUFFER,             /* int */
00079    MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD,              /* int */
00080    MISDN_CFG_CALLGROUP,           /* ast_group_t */
00081    MISDN_CFG_PICKUPGROUP,         /* ast_group_t */
00082    MISDN_CFG_MAX_IN,              /* int */
00083    MISDN_CFG_MAX_OUT,              /* int */
00084    MISDN_CFG_L1_TIMEOUT,          /* int */
00085    MISDN_CFG_OVERLAP_DIAL,    /* int (bool)*/
00086    MISDN_CFG_MSNS,                /* char[] */
00087    MISDN_CFG_FAXDETECT,           /* char[] */
00088    MISDN_CFG_FAXDETECT_CONTEXT,   /* char[] */
00089    MISDN_CFG_FAXDETECT_TIMEOUT,   /* int */
00090    MISDN_CFG_PTP,                 /* int (bool) */
00091    MISDN_CFG_LAST,
00092    
00093    /* general config items */
00094    MISDN_GEN_FIRST,
00095 #ifndef MISDN_1_2
00096    MISDN_GEN_MISDN_INIT,           /* char[] */
00097 #endif
00098    MISDN_GEN_DEBUG,               /* int */
00099    MISDN_GEN_TRACEFILE,           /* char[] */
00100    MISDN_GEN_BRIDGING,            /* int (bool) */
00101    MISDN_GEN_STOP_TONE,           /* int (bool) */
00102    MISDN_GEN_APPEND_DIGITS2EXTEN, /* int (bool) */
00103    MISDN_GEN_DYNAMIC_CRYPT,       /* int (bool) */
00104    MISDN_GEN_CRYPT_PREFIX,        /* char[] */
00105    MISDN_GEN_CRYPT_KEYS,          /* char[] */
00106    MISDN_GEN_NTKEEPCALLS,          /* int (bool) */
00107    MISDN_GEN_NTDEBUGFLAGS,          /* int */
00108    MISDN_GEN_NTDEBUGFILE,          /* char[] */
00109    MISDN_GEN_LAST
00110 };
00111 
00112 enum misdn_cfg_method {
00113    METHOD_STANDARD = 0,
00114    METHOD_ROUND_ROBIN,
00115    METHOD_STANDARD_DEC
00116 };
00117 
00118 /* you must call misdn_cfg_init before any other function of this header file */
00119 int misdn_cfg_init(int max_ports, int reload); 
00120 void misdn_cfg_reload(void);
00121 void misdn_cfg_destroy(void);
00122 
00123 void misdn_cfg_update_ptp( void );
00124 
00125 /* if you requst a general config element, the port value is ignored. if the requested 
00126  * value is not available, or the buffer is too small, the buffer will be nulled (in 
00127  * case of a char* only its first byte will be nulled). */
00128 void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void* buf, int bufsize);
00129 
00130 /* returns the enum element for the given name, returns MISDN_CFG_FIRST if none was found */
00131 enum misdn_cfg_elements misdn_cfg_get_elem (char *name);
00132 
00133 /* fills the buffer with the name of the given config element */
00134 void misdn_cfg_get_name (enum misdn_cfg_elements elem, void *buf, int bufsize);
00135 
00136 /* fills the buffer with the description of the given config element */
00137 void misdn_cfg_get_desc (enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default);
00138 
00139 /* fills the buffer with a ',' separated list of all active ports */
00140 void misdn_cfg_get_ports_string(char *ports);
00141 
00142 /* fills the buffer with a nice printable string representation of the config element */
00143 void misdn_cfg_get_config_string(int port, enum misdn_cfg_elements elem, char* buf, int bufsize);
00144 
00145 /* returns the next available port number. returns -1 if the last one was reached. */
00146 int misdn_cfg_get_next_port(int port);
00147 int misdn_cfg_get_next_port_spin(int port);
00148 
00149 int misdn_cfg_is_msn_valid(int port, char* msn);
00150 int misdn_cfg_is_port_valid(int port);
00151 int misdn_cfg_is_group_method(char *group, enum misdn_cfg_method meth);
00152 
00153 #if 0
00154 char *misdn_cfg_get_next_group(char *group);
00155 int misdn_cfg_get_next_port_in_group(int port, char *group);
00156 #endif
00157 
00158 struct ast_jb_conf *misdn_get_global_jbconf(void);
00159 
00160 #endif