2005-10-31 23:30:09 +00:00
|
|
|
/*
|
|
|
|
* Chan_Misdn -- Channel Driver for Asterisk
|
|
|
|
*
|
|
|
|
* Interface to mISDN
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004, Christian Richter
|
|
|
|
*
|
|
|
|
* Christian Richter <crich@beronet.com>
|
|
|
|
*
|
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
* the GNU General Public License
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef CHAN_MISDN_CONFIG_H
|
|
|
|
#define CHAN_MISDN_CONFIG_H
|
|
|
|
|
|
|
|
#define BUFFERSIZE 512
|
|
|
|
|
|
|
|
enum misdn_cfg_elements {
|
|
|
|
|
|
|
|
/* port config items */
|
|
|
|
MISDN_CFG_FIRST = 0,
|
|
|
|
MISDN_CFG_GROUPNAME, /* char[] */
|
2006-06-01 12:51:41 +00:00
|
|
|
MISDN_CFG_ALLOWED_BEARERS, /* char[] */
|
2006-05-05 16:38:15 +00:00
|
|
|
MISDN_CFG_FAR_ALERTING, /* int (bool) */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_RXGAIN, /* int */
|
|
|
|
MISDN_CFG_TXGAIN, /* int */
|
|
|
|
MISDN_CFG_TE_CHOOSE_CHANNEL, /* int (bool) */
|
2006-02-15 19:32:45 +00:00
|
|
|
MISDN_CFG_PMP_L1_CHECK, /* int (bool) */
|
2006-10-11 08:34:03 +00:00
|
|
|
MISDN_CFG_REJECT_CAUSE, /* int */
|
2006-08-03 16:38:00 +00:00
|
|
|
MISDN_CFG_ALARM_BLOCK, /* int (bool) */
|
2006-03-20 18:04:05 +00:00
|
|
|
MISDN_CFG_HDLC, /* int (bool) */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_CONTEXT, /* char[] */
|
|
|
|
MISDN_CFG_LANGUAGE, /* char[] */
|
2005-12-09 11:01:18 +00:00
|
|
|
MISDN_CFG_MUSICCLASS, /* char[] */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_CALLERID, /* char[] */
|
|
|
|
MISDN_CFG_METHOD, /* char[] */
|
|
|
|
MISDN_CFG_DIALPLAN, /* int */
|
2005-12-09 11:01:18 +00:00
|
|
|
MISDN_CFG_LOCALDIALPLAN, /* int */
|
2006-03-09 18:01:27 +00:00
|
|
|
MISDN_CFG_CPNDIALPLAN, /* int */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_NATPREFIX, /* char[] */
|
|
|
|
MISDN_CFG_INTERNATPREFIX, /* char[] */
|
2006-02-02 21:15:34 +00:00
|
|
|
MISDN_CFG_PRES, /* int */
|
|
|
|
MISDN_CFG_SCREEN, /* int */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_ALWAYS_IMMEDIATE, /* int (bool) */
|
2006-07-13 14:13:24 +00:00
|
|
|
MISDN_CFG_NODIALTONE, /* int (bool) */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_IMMEDIATE, /* int (bool) */
|
2005-12-09 11:01:18 +00:00
|
|
|
MISDN_CFG_SENDDTMF, /* int (bool) */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_HOLD_ALLOWED, /* int (bool) */
|
|
|
|
MISDN_CFG_EARLY_BCONNECT, /* int (bool) */
|
2006-02-15 19:51:33 +00:00
|
|
|
MISDN_CFG_INCOMING_EARLY_AUDIO, /* int (bool) */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_ECHOCANCEL, /* int */
|
|
|
|
MISDN_CFG_ECHOCANCELWHENBRIDGED, /* int (bool) */
|
2006-08-03 16:38:00 +00:00
|
|
|
#ifdef WITH_ECHOTRAINGING
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_ECHOTRAINING, /* int (bool) */
|
2006-08-03 16:38:00 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_BEROEC
|
|
|
|
MISDN_CFG_BNECHOCANCEL,
|
|
|
|
MISDN_CFG_BNEC_ANTIHOWL,
|
|
|
|
MISDN_CFG_BNEC_NLP,
|
|
|
|
MISDN_CFG_BNEC_ZEROCOEFF,
|
|
|
|
MISDN_CFG_BNEC_TD,
|
|
|
|
MISDN_CFG_BNEC_ADAPT,
|
|
|
|
#endif
|
2006-02-02 21:15:34 +00:00
|
|
|
MISDN_CFG_NEED_MORE_INFOS, /* bool */
|
2006-10-27 11:18:32 +00:00
|
|
|
MISDN_CFG_NTTIMEOUT, /* bool */
|
2006-02-02 21:15:34 +00:00
|
|
|
MISDN_CFG_JITTERBUFFER, /* int */
|
|
|
|
MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, /* int */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_CALLGROUP, /* ast_group_t */
|
|
|
|
MISDN_CFG_PICKUPGROUP, /* ast_group_t */
|
2006-05-22 15:02:03 +00:00
|
|
|
MISDN_CFG_MAX_IN, /* int */
|
|
|
|
MISDN_CFG_MAX_OUT, /* int */
|
2006-07-11 19:30:35 +00:00
|
|
|
MISDN_CFG_L1_TIMEOUT, /* int */
|
|
|
|
MISDN_CFG_OVERLAP_DIAL, /* int (bool)*/
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_MSNS, /* char[] */
|
2006-07-03 16:41:43 +00:00
|
|
|
MISDN_CFG_FAXDETECT, /* char[] */
|
2006-08-08 18:13:40 +00:00
|
|
|
MISDN_CFG_FAXDETECT_CONTEXT, /* char[] */
|
|
|
|
MISDN_CFG_FAXDETECT_TIMEOUT, /* int */
|
2006-07-11 19:30:35 +00:00
|
|
|
MISDN_CFG_PTP, /* int (bool) */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_CFG_LAST,
|
|
|
|
|
|
|
|
/* general config items */
|
|
|
|
MISDN_GEN_FIRST,
|
2006-02-02 21:15:34 +00:00
|
|
|
MISDN_GEN_MISDN_INIT, /* char[] */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_GEN_DEBUG, /* int */
|
|
|
|
MISDN_GEN_TRACEFILE, /* char[] */
|
|
|
|
MISDN_GEN_BRIDGING, /* int (bool) */
|
|
|
|
MISDN_GEN_STOP_TONE, /* int (bool) */
|
|
|
|
MISDN_GEN_APPEND_DIGITS2EXTEN, /* int (bool) */
|
|
|
|
MISDN_GEN_DYNAMIC_CRYPT, /* int (bool) */
|
|
|
|
MISDN_GEN_CRYPT_PREFIX, /* char[] */
|
|
|
|
MISDN_GEN_CRYPT_KEYS, /* char[] */
|
2006-06-29 20:12:19 +00:00
|
|
|
MISDN_GEN_NTDEBUGFLAGS, /* int */
|
|
|
|
MISDN_GEN_NTDEBUGFILE, /* char[] */
|
2005-10-31 23:30:09 +00:00
|
|
|
MISDN_GEN_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum misdn_cfg_method {
|
|
|
|
METHOD_STANDARD = 0,
|
|
|
|
METHOD_ROUND_ROBIN
|
|
|
|
};
|
|
|
|
|
|
|
|
/* you must call misdn_cfg_init before any other function of this header file */
|
2006-08-08 18:13:40 +00:00
|
|
|
int misdn_cfg_init(int max_ports);
|
2005-10-31 23:30:09 +00:00
|
|
|
void misdn_cfg_reload(void);
|
|
|
|
void misdn_cfg_destroy(void);
|
|
|
|
|
2006-02-02 21:15:34 +00:00
|
|
|
void misdn_cfg_update_ptp( void );
|
|
|
|
|
2005-10-31 23:30:09 +00:00
|
|
|
/* if you requst a general config element, the port value is ignored. if the requested
|
|
|
|
* value is not available, or the buffer is too small, the buffer will be nulled (in
|
|
|
|
* case of a char* only its first byte will be nulled). */
|
|
|
|
void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void* buf, int bufsize);
|
|
|
|
|
2006-07-03 16:41:43 +00:00
|
|
|
/* returns the enum element for the given name, returns MISDN_CFG_FIRST if none was found */
|
|
|
|
enum misdn_cfg_elements misdn_cfg_get_elem (char *name);
|
|
|
|
|
|
|
|
/* fills the buffer with the name of the given config element */
|
|
|
|
void misdn_cfg_get_name (enum misdn_cfg_elements elem, void *buf, int bufsize);
|
|
|
|
|
|
|
|
/* fills the buffer with the description of the given config element */
|
|
|
|
void misdn_cfg_get_desc (enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default);
|
|
|
|
|
2005-10-31 23:30:09 +00:00
|
|
|
/* fills the buffer with a ',' separated list of all active ports */
|
|
|
|
void misdn_cfg_get_ports_string(char *ports);
|
|
|
|
|
|
|
|
/* fills the buffer with a nice printable string representation of the config element */
|
|
|
|
void misdn_cfg_get_config_string(int port, enum misdn_cfg_elements elem, char* buf, int bufsize);
|
|
|
|
|
|
|
|
/* returns the next available port number. returns -1 if the last one was reached. */
|
|
|
|
int misdn_cfg_get_next_port(int port);
|
|
|
|
int misdn_cfg_get_next_port_spin(int port);
|
|
|
|
|
|
|
|
int misdn_cfg_is_msn_valid(int port, char* msn);
|
|
|
|
int misdn_cfg_is_port_valid(int port);
|
|
|
|
int misdn_cfg_is_group_method(char *group, enum misdn_cfg_method meth);
|
|
|
|
|
2006-05-22 15:02:03 +00:00
|
|
|
#if 0
|
|
|
|
char *misdn_cfg_get_next_group(char *group);
|
|
|
|
int misdn_cfg_get_next_port_in_group(int port, char *group);
|
|
|
|
#endif
|
|
|
|
|
2005-10-31 23:30:09 +00:00
|
|
|
#endif
|