Wed Jan 8 2020 09:49:44

Asterisk developer's documentation


chan_misdn_config.h
Go to the documentation of this file.
1 /*
2  * Chan_Misdn -- Channel Driver for Asterisk
3  *
4  * Interface to mISDN
5  *
6  * Copyright (C) 2004, Christian Richter
7  *
8  * Christian Richter <crich@beronet.com>
9  *
10  * This program is free software, distributed under the terms of
11  * the GNU General Public License
12  */
13 
14 /*! \file
15  * \brief Interface to mISDN - Config
16  * \author Christian Richter <crich@beronet.com>
17  */
18 
19 
20 
21 
22 #ifndef CHAN_MISDN_CONFIG_H
23 #define CHAN_MISDN_CONFIG_H
24 
25 #define BUFFERSIZE 512
26 
28 
29  /* port config items */
31  MISDN_CFG_GROUPNAME, /* char[] */
33  MISDN_CFG_FAR_ALERTING, /* int (bool) */
34  MISDN_CFG_RXGAIN, /* int */
35  MISDN_CFG_TXGAIN, /* int */
36  MISDN_CFG_TE_CHOOSE_CHANNEL, /* int (bool) */
37  MISDN_CFG_PMP_L1_CHECK, /* int (bool) */
39  MISDN_CFG_ALARM_BLOCK, /* int (bool) */
40  MISDN_CFG_HDLC, /* int (bool) */
41  MISDN_CFG_CONTEXT, /* char[] */
42  MISDN_CFG_LANGUAGE, /* char[] */
43  MISDN_CFG_MUSICCLASS, /* char[] */
44  MISDN_CFG_CALLERID, /* char[] */
47  MISDN_CFG_METHOD, /* char[] */
48  MISDN_CFG_DIALPLAN, /* int */
57  MISDN_CFG_PRES, /* int */
58  MISDN_CFG_SCREEN, /* int */
61  MISDN_CFG_ALWAYS_IMMEDIATE, /* int (bool) */
62  MISDN_CFG_NODIALTONE, /* int (bool) */
63  MISDN_CFG_IMMEDIATE, /* int (bool) */
64  MISDN_CFG_SENDDTMF, /* int (bool) */
65  MISDN_CFG_ASTDTMF, /* int (bool) */
66  MISDN_CFG_HOLD_ALLOWED, /* int (bool) */
67  MISDN_CFG_EARLY_BCONNECT, /* int (bool) */
72 #ifdef MISDN_1_2
73  MISDN_CFG_PIPELINE, /* char[] */
74 #endif
75 
76 #ifdef WITH_BEROEC
77  MISDN_CFG_BNECHOCANCEL,
78  MISDN_CFG_BNEC_ANTIHOWL,
79  MISDN_CFG_BNEC_NLP,
80  MISDN_CFG_BNEC_ZEROCOEFF,
81  MISDN_CFG_BNEC_TD,
82  MISDN_CFG_BNEC_ADAPT,
83 #endif
86  MISDN_CFG_NTTIMEOUT, /* bool */
87  MISDN_CFG_BRIDGING, /* bool */
90  MISDN_CFG_CALLGROUP, /* ast_group_t */
91  MISDN_CFG_PICKUPGROUP, /* ast_group_t */
92  MISDN_CFG_MAX_IN, /* int */
93  MISDN_CFG_MAX_OUT, /* int */
95  MISDN_CFG_OVERLAP_DIAL, /* int (bool)*/
96  MISDN_CFG_MSNS, /* char[] */
97  MISDN_CFG_FAXDETECT, /* char[] */
100  MISDN_CFG_PTP, /* int (bool) */
102 
103  /* general config items */
105 #ifndef MISDN_1_2
106  MISDN_GEN_MISDN_INIT, /* char[] */
107 #endif
108  MISDN_GEN_DEBUG, /* int */
109  MISDN_GEN_TRACEFILE, /* char[] */
110  MISDN_GEN_BRIDGING, /* int (bool) */
111  MISDN_GEN_STOP_TONE, /* int (bool) */
113  MISDN_GEN_DYNAMIC_CRYPT, /* int (bool) */
115  MISDN_GEN_CRYPT_KEYS, /* char[] */
116  MISDN_GEN_NTKEEPCALLS, /* int (bool) */
118  MISDN_GEN_NTDEBUGFILE, /* char[] */
120 };
121 
126 };
127 
128 /* you must call misdn_cfg_init before any other function of this header file */
129 int misdn_cfg_init(int max_ports, int reload);
130 void misdn_cfg_reload(void);
131 void misdn_cfg_destroy(void);
132 
133 void misdn_cfg_update_ptp( void );
134 
135 /* if you requst a general config element, the port value is ignored. if the requested
136  * value is not available, or the buffer is too small, the buffer will be nulled (in
137  * case of a char* only its first byte will be nulled). */
138 void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void* buf, int bufsize);
139 
140 /* returns the enum element for the given name, returns MISDN_CFG_FIRST if none was found */
141 enum misdn_cfg_elements misdn_cfg_get_elem (const char *name);
142 
143 /* fills the buffer with the name of the given config element */
144 void misdn_cfg_get_name (enum misdn_cfg_elements elem, void *buf, int bufsize);
145 
146 /* fills the buffer with the description of the given config element */
147 void misdn_cfg_get_desc (enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default);
148 
149 /* fills the buffer with a ',' separated list of all active ports */
150 void misdn_cfg_get_ports_string(char *ports);
151 
152 /* fills the buffer with a nice printable string representation of the config element */
153 void misdn_cfg_get_config_string(int port, enum misdn_cfg_elements elem, char* buf, int bufsize);
154 
155 /* returns the next available port number. returns -1 if the last one was reached. */
156 int misdn_cfg_get_next_port(int port);
157 int misdn_cfg_get_next_port_spin(int port);
158 
159 int misdn_cfg_is_msn_valid(int port, char* msn);
160 int misdn_cfg_is_port_valid(int port);
161 int misdn_cfg_is_group_method(char *group, enum misdn_cfg_method meth);
162 
163 #if 0
164 char *misdn_cfg_get_next_group(char *group);
165 int misdn_cfg_get_next_port_in_group(int port, char *group);
166 #endif
167 
169 
170 #endif
void misdn_cfg_destroy(void)
int misdn_cfg_init(int this_max_ports, int reload)
int misdn_cfg_is_msn_valid(int port, char *msn)
Definition: misdn_config.c:694
enum misdn_cfg_elements misdn_cfg_get_elem(const char *name)
Definition: misdn_config.c:616
misdn_cfg_elements
int misdn_cfg_is_group_method(char *group, enum misdn_cfg_method meth)
Definition: misdn_config.c:726
void misdn_cfg_reload(void)
int misdn_cfg_get_next_port(int port)
Definition: misdn_config.c:892
void misdn_cfg_get_name(enum misdn_cfg_elements elem, void *buf, int bufsize)
Definition: misdn_config.c:637
struct ast_jb_conf * misdn_get_global_jbconf()
void misdn_cfg_get_desc(enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default)
Definition: misdn_config.c:663
static int max_ports
Definition: chan_misdn.c:670
static int reload(void)
Definition: app_amd.c:497
int misdn_cfg_get_next_port_spin(int port)
Definition: misdn_config.c:909
static const char name[]
void misdn_cfg_update_ptp(void)
void misdn_cfg_get_ports_string(char *ports)
Generate a comma separated list of all active ports.
Definition: misdn_config.c:761
void misdn_cfg_get_config_string(int port, enum misdn_cfg_elements elem, char *buf, int bufsize)
Definition: misdn_config.c:787
misdn_cfg_method
void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void *buf, int bufsize)
Definition: misdn_config.c:562
int misdn_cfg_is_port_valid(int port)
Definition: misdn_config.c:719
General jitterbuffer configuration.
Definition: abstract_jb.h:55