37 #include "chan_misdn_config.h"
46 #define NO_DEFAULT "<>"
51 #define NUM_GEN_ELEMENTS (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec))
52 #define NUM_PORT_ELEMENTS (sizeof(port_spec) / sizeof(struct misdn_cfg_spec))
60 .resync_threshold = 1000,
100 "Define your ports, e.g. 1,2 (depends on mISDN-driver loading order).";
104 "Name of the portgroup." },
106 "Here you can list which bearer capabilities should be allowed:\n"
107 "\t all - allow any bearer capability\n"
108 "\t speech - allow speech\n"
109 "\t 3_1khz - allow 3.1KHz audio\n"
110 "\t digital_unrestricted - allow unrestricted digital\n"
111 "\t digital_restricted - allow restricted digital\n"
112 "\t video - allow video" },
114 "Set this between -8 and 8 to change the RX Gain." },
116 "Set this between -8 and 8 to change the TX Gain." },
118 "Some telcos especially in NL seem to need this set to yes,\n"
119 "\talso in Switzerland this seems to be important." },
121 "If we should generate ringing for chan_sip and others." },
123 "This option defines, if chan_misdn should check the L1 on a PMP\n"
124 "\tbefore making a group call on it. The L1 may go down for PMP Ports\n"
125 "\tso we might need this.\n"
126 "\tBut be aware! a broken or plugged off cable might be used for a group call\n"
127 "\tas well, since chan_misdn has no chance to distinguish if the L1 is down\n"
128 "\tbecause of a lost Link or because the Provider shut it down..." },
130 "Block this port if we have an alarm on it." },
132 "Set this to yes, if you want to bridge a mISDN data channel to\n"
133 "\tanother channel type or to an application." },
135 "Context to use for incoming calls." },
139 "Sets the musiconhold class." },
141 "Set the outgoing caller id to the value." },
143 "Set the incoming caller id string tag to the value." },
145 "Automatically appends incoming or outgoing MSN to the incoming caller\n"
146 "\tid string tag. An underscore '_' is used as delimiter. Incoming calls\n"
147 "\twill have the dialed number appended, and outgoing calls will have the\n"
148 "\tcaller number appended to the tag." },
150 "Set the method to use for channel selection:\n"
151 "\t standard - Use the first free channel starting from the lowest number.\n"
152 "\t standard_dec - Use the first free channel starting from the highest number.\n"
153 "\t round_robin - Use the round robin algorithm to select a channel. Use this\n"
154 "\t if you want to balance your load." },
156 "Dialplan means Type Of Number in ISDN Terms\n"
157 "\tThere are different types of the dialplan:\n"
159 "\tdialplan -> for outgoing call's dialed number\n"
160 "\tlocaldialplan -> for outgoing call's callerid\n"
161 "\t (if -1 is set use the value from the asterisk channel)\n"
162 "\tcpndialplan -> for incoming call's connected party number sent to caller\n"
163 "\t (if -1 is set use the value from the asterisk channel)\n"
165 "\tdialplan options:\n"
168 "\t1 - International\n"
170 "\t4 - Subscriber" },
172 "Dialplan means Type Of Number in ISDN Terms\n"
173 "\tThere are different types of the dialplan:\n"
175 "\tdialplan -> for outgoing call's dialed number\n"
176 "\tlocaldialplan -> for outgoing call's callerid\n"
177 "\t (if -1 is set use the value from the asterisk channel)\n"
178 "\tcpndialplan -> for incoming call's connected party number sent to caller\n"
179 "\t (if -1 is set use the value from the asterisk channel)\n"
181 "\tdialplan options:\n"
184 "\t1 - International\n"
186 "\t4 - Subscriber" },
188 "Dialplan means Type Of Number in ISDN Terms\n"
189 "\tThere are different types of the dialplan:\n"
191 "\tdialplan -> for outgoing call's dialed number\n"
192 "\tlocaldialplan -> for outgoing call's callerid\n"
193 "\t (if -1 is set use the value from the asterisk channel)\n"
194 "\tcpndialplan -> for incoming call's connected party number sent to caller\n"
195 "\t (if -1 is set use the value from the asterisk channel)\n"
197 "\tdialplan options:\n"
200 "\t1 - International\n"
202 "\t4 - Subscriber" },
204 "Prefix for unknown numbers, this is put before an incoming number\n"
205 "\tif its type-of-number is unknown." },
207 "Prefix for international numbers, this is put before an incoming number\n"
208 "\tif its type-of-number is international." },
210 "Prefix for national numbers, this is put before an incoming number\n"
211 "\tif its type-of-number is national." },
213 "Prefix for network-specific numbers, this is put before an incoming number\n"
214 "\tif its type-of-number is network-specific." },
216 "Prefix for subscriber numbers, this is put before an incoming number\n"
217 "\tif its type-of-number is subscriber." },
219 "Prefix for abbreviated numbers, this is put before an incoming number\n"
220 "\tif its type-of-number is abbreviated." },
222 "These (presentation and screen) are the exact isdn screening and presentation\n"
224 "\tIf -1 is given for either value, the presentation indicators are used from\n"
225 "\tAsterisk's CALLERPRES function.\n"
227 "\tscreen=0, presentation=0 -> callerid presented\n"
228 "\tscreen=1, presentation=1 -> callerid restricted (the remote end doesn't see it!)" },
230 "These (presentation and screen) are the exact isdn screening and presentation\n"
232 "\tIf -1 is given for either value, the presentation indicators are used from\n"
233 "\tAsterisk's CALLERPRES function.\n"
235 "\tscreen=0, presentation=0 -> callerid presented\n"
236 "\tscreen=1, presentation=1 -> callerid restricted (the remote end doesn't see it!)" },
238 "Select what to do with outgoing COLP information on this port.\n"
240 "\t0 - Send out COLP information unaltered.\n"
241 "\t1 - Force COLP to restricted on all outgoing COLP information.\n"
242 "\t2 - Do not send COLP information." },
244 "Put a display ie in the CONNECT message containing the following\n"
245 "\tinformation if it is available (nt port only):\n"
247 "\t0 - Do not put the connected line information in the display ie.\n"
248 "\t1 - Put the available connected line name in the display ie.\n"
249 "\t2 - Put the available connected line number in the display ie.\n"
250 "\t3 - Put the available connected line name and number in the display ie." },
252 "Put a display ie in the SETUP message containing the following\n"
253 "\tinformation if it is available (nt port only):\n"
255 "\t0 - Do not put the caller information in the display ie.\n"
256 "\t1 - Put the available caller name in the display ie.\n"
257 "\t2 - Put the available caller number in the display ie.\n"
258 "\t3 - Put the available caller name and number in the display ie." },
260 "Enable this to get into the s dialplan-extension.\n"
261 "\tThere you can use DigitTimeout if you can't or don't want to use\n"
262 "\tisdn overlap dial.\n"
263 "\tNOTE: This will jump into the s extension for every exten!" },
265 "Enable this to prevent chan_misdn to generate the dialtone\n"
266 "\tThis makes only sense together with the always_immediate=yes option\n"
267 "\tto generate your own dialtone with Playtones or so." },
269 "Enable this if you want callers which called exactly the base\n"
270 "\tnumber (so no extension is set) to jump into the s extension.\n"
271 "\tIf the user dials something more, it jumps to the correct extension\n"
274 "Enable this if we should produce DTMF Tones ourselves." },
276 "Enable this if you want to use the Asterisk dtmf detector\n"
277 "instead of the mISDN_dsp/hfcmulti one."
280 "Enable this to have support for hold and retrieve." },
282 "Disable this if you don't mind correct handling of Progress Indicators." },
284 "Turn this on if you like to send Tone Indications to a Incoming\n"
285 "\tisdn channel on a TE Port. Rarely used, only if the Telco allows\n"
286 "\tyou to send indications by yourself, normally the Telco sends the\n"
287 "\tindications to the remote party." },
289 "This enables echo cancellation with the given number of taps.\n"
290 "\tBe aware: Move this setting only to outgoing portgroups!\n"
291 "\tA value of zero turns echo cancellation off.\n"
293 "\tPossible values are: 0,32,64,128,256,yes(=128),no(=0)" },
296 "Set the configuration string for the mISDN dsp pipeline.\n"
298 "\tExample for enabling the mg2 echo cancellation module with deftaps\n"
300 "\t\tmg2ec(deftaps=128)" },
304 "echotail in ms (1-200)" },
308 "Nonlinear Processing (much faster adaption)" },
314 "Adaption mode (0=no,1=full,2=fast)" },
317 "Send Setup_Acknowledge on incoming calls anyway (instead of PROCEEDING),\n"
318 "\tthis requests additional Infos, so we can waitfordigits without much\n"
319 "\tissues. This works only for PTP Ports" },
321 "Do not send SETUP_ACKNOWLEDGE or PROCEEDING automatically to the calling Party.\n"
322 "Instead we directly jump into the dialplan. This might be useful for fast call\n"
323 "rejection, or for some broken switches, that need hangup causes like busy in the.\n"
324 "RELEASE_COMPLETE Message, instead of the DISCONNECT Message."},
326 "The jitterbuffer." },
328 "Change this threshold to enable dejitter functionality." },
334 "Defines the maximum amount of incoming calls per port for this group.\n"
335 "\tCalls which exceed the maximum will be marked with the channel variable\n"
336 "\tMAX_OVERFLOW. It will contain the amount of overflowed calls" },
338 "Defines the maximum amount of outgoing calls per port for this group\n"
339 "\texceeding calls will be rejected" },
342 "Defines the cause with which a 3. call is rejected on PTMP BRI."},
344 "Setup fax detection:\n"
345 "\t no - no fax detection\n"
346 "\t incoming - fax detection for incoming calls\n"
347 "\t outgoing - fax detection for outgoing calls\n"
348 "\t both - fax detection for incoming and outgoing calls\n"
349 "\tAdd +nojump to your value (i.e. faxdetect=both+nojump) if you don't want to jump into the\n"
350 "\tfax-extension but still want to detect the fax and prepare the channel for fax transfer." },
352 "Number of seconds the fax detection should do its job. After the given period of time,\n"
353 "\twe assume that it's not a fax call and save some CPU time by turning off fax detection.\n"
354 "\tSet this to 0 if you don't want a timeout (never stop detecting)." },
356 "Context to jump into if we detect a fax. Don't set this if you want to stay in the current context." },
358 "Monitors L1 of the port. If L1 is down it tries\n"
359 "\tto bring it up. The polling timeout is given in seconds.\n"
360 "\tSetting the value to 0 disables monitoring L1 of the port.\n"
362 "\tThis option is only read at chan_misdn loading time.\n"
363 "\tYou need to unload and load chan_misdn to change the\n"
364 "\tvalue. An asterisk restart will also do the trick." },
366 "Enables overlap dial for the given amount of seconds.\n"
367 "\tPossible values are positive integers or:\n"
368 "\t yes (= 4 seconds)\n"
369 "\t no (= 0 seconds = disabled)" },
371 "Set this to yes if you want calls disconnected in overlap mode\n"
372 "\twhen a timeout happens." },
374 "Set this to yes/no, default is yes.\n"
375 "This can be used to have bridging enabled in general and to\n"
376 "disable it for specific ports. It makes sense to disable\n"
377 "bridging on NT Port where you plan to use the HOLD/RETRIEVE\n"
378 "features with ISDN phones." },
380 "MSN's for TE ports, listen on those numbers on the above ports, and\n"
381 "\tindicate the incoming calls to Asterisk.\n"
382 "\tHere you can give a comma separated list, or simply an '*' for any msn." },
384 "Enable/Disable call-completion request retention support (ptp)." },
389 "Sets the debugging flag:\n"
391 "\t1 - mISDN Messages and * - Messages, and * - State changes\n"
392 "\t2 - Messages + Message specific Informations (e.g. bearer capability)\n"
393 "\t3 - very Verbose, the above + lots of Driver specific infos\n"
394 "\t4 - even more Verbose than 3" },
397 "Set the path to the misdn-init.conf (for nt_ptp mode checking)." },
400 "Set the path to the massively growing trace file, if you want that." },
402 "Set this to yes if you want mISDN_dsp to bridge the calls in HW." },
404 "Stops dialtone after getting first digit on NT Port." },
406 "Whether to append overlapdialed Digits to Extension or not." },
408 "Whether to look out for dynamic crypting attempts." },
410 "What is used for crypting Protocol." },
412 "Keys for cryption, you reference them in the dialplan\n"
413 "\tLater also in dynamic encr." },
415 "avoid dropping calls if the L2 goes down. some Nortel pbx\n"
416 "do put down the L2/L1 for some milliseconds even if there\n"
417 "are running calls. with this option you can avoid dropping them" },
419 "No description yet."},
421 "No description yet." }
438 #define CLI_ERROR(name, value, section) ({ \
439 ast_log(LOG_WARNING, "misdn.conf: \"%s=%s\" (section: %s) invalid or out of range. " \
440 "Please edit your misdn.conf and then do a \"misdn reload\".\n", name, value, section); \
452 if (port_spec[j].elem == i) {
459 ast_log(
LOG_WARNING,
"Enum element %d in misdn_cfg_elements (port section) has no corresponding element in the config struct!\n", i);
466 if (gen_spec[j].elem == i) {
473 ast_log(
LOG_WARNING,
"Enum element %d in misdn_cfg_elements (general section) has no corresponding element in the config struct!\n", i);
487 if (!strcasecmp(name, port_spec[i].name))
493 if (!strcasecmp(name, gen_spec[i].name))
526 memset(free_list, 0,
sizeof(free_list));
527 free_list[0] = port_cfg[0];
529 if (port_cfg[i][gn].
str) {
532 if (free_list[j] && free_list[j][gn].str == port_cfg[i][gn].str)
534 else if (!free_list[j]) {
535 free_list[j] = port_cfg[i];
541 for (j = 0; free_list[j]; ++j) {
543 if (free_list[j][i].
any) {
558 if (general_cfg[i].
any)
567 memset(buf, 0, bufsize);
568 ast_log(
LOG_WARNING,
"Invalid call to misdn_cfg_get! Port number %d is not valid.\n", port);
574 if (!memcpy(buf, &ptp[port], (bufsize > ptp[port]) ?
sizeof(ptp[port]) : bufsize))
575 memset(buf, 0, bufsize);
577 if ((place = map[elem]) < 0) {
578 memset(buf, 0, bufsize);
579 ast_log(
LOG_WARNING,
"Invalid call to misdn_cfg_get! Invalid element (%d) requested.\n", elem);
582 switch (port_spec[place].
type) {
584 if (port_cfg[port][place].
str) {
586 }
else if (port_cfg[0][place].str) {
589 memset(buf, 0, bufsize);
592 if (port_cfg[port][place].
any)
593 memcpy(buf, port_cfg[port][place].any, bufsize);
594 else if (port_cfg[0][place].any)
595 memcpy(buf, port_cfg[0][place].any, bufsize);
597 memset(buf, 0, bufsize);
600 switch (gen_spec[place].
type) {
605 if (general_cfg[place].
any)
606 memcpy(buf, general_cfg[place].any, bufsize);
608 memset(buf, 0, bufsize);
621 if (!strcmp(name,
"ports"))
623 if (!strcmp(name,
"name"))
628 return port_spec[pos].
elem;
632 return gen_spec[pos].
elem;
640 int place = map[
elem];
650 if (!snprintf(buf, bufsize,
"ports"))
665 int place = map[
elem];
671 if (buf_default && bufsize_default)
672 memset(buf_default, 0, 1);
681 if (!spec || !spec[place].
desc)
685 if (buf_default && bufsize) {
687 memset(buf_default, 0, 1);
700 ast_log(
LOG_WARNING,
"Invalid call to misdn_cfg_is_msn_valid! Port number %d is not valid.\n", port);
709 for (; iter; iter = iter->
next)
723 return (port >= 1 && port <= max_ports && port_cfg[port][gn].
str);
771 if (port_cfg[i][gn].
str) {
773 sprintf(tmp,
"%dptp,", i);
775 sprintf(tmp,
"%d,", i);
781 if ((l = strlen(ports))) {
795 ast_log(
LOG_WARNING,
"Invalid call to misdn_cfg_get_config_string! Port number %d is not valid.\n", port);
803 snprintf(buf, bufsize,
" -> ptp: %s", ptp[port] ?
"yes" :
"no");
806 switch (port_spec[place].
type) {
809 if (port_cfg[port][place].num)
810 snprintf(buf, bufsize,
" -> %s: %d", port_spec[place].
name, *port_cfg[port][place].num);
811 else if (port_cfg[0][place].num)
812 snprintf(buf, bufsize,
" -> %s: %d", port_spec[place].name, *port_cfg[0][place].num);
814 snprintf(buf, bufsize,
" -> %s:", port_spec[place].name);
817 if (port_cfg[port][place].num)
818 snprintf(buf, bufsize,
" -> %s: %s", port_spec[place].name, *port_cfg[port][place].num ?
"yes" :
"no");
819 else if (port_cfg[0][place].num)
820 snprintf(buf, bufsize,
" -> %s: %s", port_spec[place].name, *port_cfg[0][place].num ?
"yes" :
"no");
822 snprintf(buf, bufsize,
" -> %s:", port_spec[place].name);
825 if (port_cfg[port][place].grp)
826 snprintf(buf, bufsize,
" -> %s: %s", port_spec[place].name,
827 ast_print_group(tempbuf,
sizeof(tempbuf), *port_cfg[port][place].grp));
828 else if (port_cfg[0][place].grp)
829 snprintf(buf, bufsize,
" -> %s: %s", port_spec[place].name,
832 snprintf(buf, bufsize,
" -> %s:", port_spec[place].name);
835 if (port_cfg[port][place].ml)
836 iter = port_cfg[port][place].
ml;
838 iter = port_cfg[0][place].
ml;
840 for (; iter; iter = iter->
next) {
841 strncat(tempbuf, iter->
msn,
sizeof(tempbuf) - strlen(tempbuf) - 1);
843 if (strlen(tempbuf) > 1) {
844 tempbuf[strlen(tempbuf)-2] = 0;
847 snprintf(buf, bufsize,
" -> msns: %s", *tempbuf ? tempbuf :
"none");
850 if ( port_cfg[port][place].
str) {
851 snprintf(buf, bufsize,
" -> %s: %s", port_spec[place].name, port_cfg[port][place].str);
852 }
else if (port_cfg[0][place].str) {
853 snprintf(buf, bufsize,
" -> %s: %s", port_spec[place].name, port_cfg[0][place].str);
855 snprintf(buf, bufsize,
" -> %s:", port_spec[place].name);
860 switch (gen_spec[place].
type) {
863 if (general_cfg[place].num)
864 snprintf(buf, bufsize,
" -> %s: %d", gen_spec[place].
name, *general_cfg[place].num);
866 snprintf(buf, bufsize,
" -> %s:", gen_spec[place].name);
869 if (general_cfg[place].num)
870 snprintf(buf, bufsize,
" -> %s: %s", gen_spec[place].name, *general_cfg[place].num ?
"yes" :
"no");
872 snprintf(buf, bufsize,
" -> %s:", gen_spec[place].name);
875 if ( general_cfg[place].
str) {
876 snprintf(buf, bufsize,
" -> %s: %s", gen_spec[place].name, general_cfg[place].str);
878 snprintf(buf, bufsize,
" -> %s:", gen_spec[place].name);
882 snprintf(buf, bufsize,
" -> type of %s not handled yet", gen_spec[place].name);
887 ast_log(
LOG_WARNING,
"Invalid call to misdn_cfg_get_config_string! Invalid config element (%d) requested.\n", elem);
898 for (port++; port <=
max_ports; port++) {
899 if (port_cfg[port][gn].
str) {
927 if ((len = strlen(value))) {
929 strncpy(dest->
str, value, len);
940 if (strchr(value,
'x')) {
941 res = sscanf(value,
"%30x", &tmp);
943 res = sscanf(value,
"%30d", &tmp);
949 memcpy(dest->
num, &tmp,
sizeof(
int));
964 if (sscanf(value,
"%30d", &tmp)) {
965 memcpy(dest->
num, &tmp,
sizeof(
int));
967 *(dest->
num) = (
ast_true(value) ? boolint_def : 0);
971 for (valtmp =
strsep(&tmp2,
","); valtmp; valtmp =
strsep(&tmp2,
",")) {
972 if ((len = strlen(valtmp))) {
975 strncpy(ml->
msn, valtmp, len);
996 for (; v; v = v->
next) {
1009 int cfg_for_ports[max_ports + 1];
1014 memset(cfg_tmp, 0,
sizeof(cfg_tmp));
1015 memset(cfg_for_ports, 0,
sizeof(cfg_for_ports));
1017 if (!strcasecmp(cat,
"default")) {
1018 cfg_for_ports[0] = 1;
1022 (
_parse(&cfg_tmp[pos], cat, port_spec[pos].
type, port_spec[pos].boolint_def) < 0)) {
1027 for (; v; v = v->
next) {
1028 if (!strcasecmp(v->
name,
"ports")) {
1032 for (token =
strsep(&tmp,
","); token; token =
strsep(&tmp,
","), *ptpbuf = 0) {
1035 if (sscanf(token,
"%30d-%30d%511s", &start, &end, ptpbuf) >= 2) {
1036 for (; start <= end; start++) {
1037 if (start <= max_ports && start > 0) {
1038 cfg_for_ports[start] = 1;
1039 ptp[start] = (strstr(ptpbuf,
"ptp")) ? 1 : 0;
1044 if (sscanf(token,
"%30d%511s", &start, ptpbuf)) {
1045 if (start <= max_ports && start > 0) {
1046 cfg_for_ports[start] = 1;
1047 ptp[start] = (strstr(ptpbuf,
"ptp")) ? 1 : 0;
1061 for (i = 0; i < (max_ports + 1); ++i) {
1062 if (i > 0 && cfg_for_ports[0]) {
1065 memset(cfg_tmp, 0,
sizeof(cfg_tmp));
1067 if (cfg_for_ports[i]) {
1068 memcpy(port_cfg[i], cfg_tmp,
sizeof(cfg_tmp));
1079 char *tok, *p, *end;
1085 fp = fopen(misdn_init,
"r");
1087 while(fgets(line,
sizeof(line), fp)) {
1088 if (!strncmp(line,
"nt_ptp", 6)) {
1089 for (tok = strtok_r(line,
",=", &p);
1091 tok = strtok_r(NULL,
",=", &p)) {
1092 port = strtol(tok, &end, 10);
1113 snprintf(filename,
sizeof(filename),
"/sys/class/mISDN-stacks/st-%08x/protocol", i << 8);
1114 fp = fopen(filename,
"r");
1119 if (fscanf(fp,
"0x%08x", &proto) != 1)
1122 ptp[i] = proto & 1<<5 ? 1 : 0;
1133 if (!port_cfg[0][i].
any && strcasecmp(port_spec[i].def,
NO_DEFAULT))
1134 _parse(&(port_cfg[0][i]), (
char *)port_spec[i].def, port_spec[i].
type, port_spec[i].boolint_def);
1137 if (!general_cfg[i].
any && strcasecmp(gen_spec[i].def,
NO_DEFAULT))
1138 _parse(&(general_cfg[i]), (
char *)gen_spec[i].def, gen_spec[i].
type, gen_spec[i].boolint_def);
1165 char config[] =
"misdn.conf";
1185 if (this_max_ports) {
1187 max_ports = this_max_ports;
1200 ptp =
ast_calloc(max_ports + 1,
sizeof(
int));
1208 memset(ptp, 0,
sizeof(
int) * (max_ports + 1));
1215 if (!strcasecmp(cat,
"general")) {
unsigned long long ast_group_t
void misdn_cfg_destroy(void)
static int _parse(union misdn_cfg_pt *dest, const char *value, enum misdn_cfg_type type, int boolint_def)
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
static union misdn_cfg_pt ** port_cfg
int misdn_cfg_init(int this_max_ports, int reload)
static const char config[]
static void _fill_defaults(void)
char * strsep(char **str, const char *delims)
int misdn_cfg_is_msn_valid(int port, char *msn)
String manipulation functions.
#define NUM_PORT_ELEMENTS
enum misdn_cfg_elements misdn_cfg_get_elem(const char *name)
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category)
Goes through variables.
static struct ast_jb_conf default_jbconf
int ast_jb_read_conf(struct ast_jb_conf *conf, const char *varname, const char *value)
Sets jitterbuffer configuration property.
Structure for variables, used for configurations and for channel variables.
static struct misdn_cfg_spec port_spec[]
Configuration File Parser.
int misdn_cfg_is_group_method(char *group, enum misdn_cfg_method meth)
#define ast_mutex_lock(a)
void misdn_cfg_reload(void)
int misdn_cfg_get_next_port(int port)
static struct ast_jb_conf global_jbconf
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
void ast_config_destroy(struct ast_config *config)
Destroys a config.
static void _build_port_config(struct ast_variable *v, char *cat)
char * ast_print_group(char *buf, int buflen, ast_group_t group)
print call- and pickup groups into buffer
static void _free_port_cfg(void)
static int get_cfg_position(const char *name, int type)
void misdn_cfg_get_name(enum misdn_cfg_elements elem, void *buf, int bufsize)
struct ast_jb_conf * misdn_get_global_jbconf()
General Asterisk PBX channel definitions.
void misdn_cfg_get_desc(enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default)
static int _enum_array_map(void)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
char * ast_category_browse(struct ast_config *config, const char *prev)
Goes through categories.
static union misdn_cfg_pt * general_cfg
static void _free_msn_list(struct msn_list *iter)
ast_group_t ast_get_group(const char *s)
Core PBX routines and definitions.
enum misdn_cfg_elements elem
#define ast_strdupa(s)
duplicate a string in memory from the stack
int misdn_cfg_get_next_port_spin(int port)
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static struct misdn_cfg_spec gen_spec[]
void misdn_cfg_update_ptp(void)
int ast_extension_match(const char *pattern, const char *extension)
Determine if a given extension matches a given pattern (in NXX format)
unsigned int flags
Combination of the AST_JB_ENABLED, AST_JB_FORCED and AST_JB_LOG flags.
static const char ports_description[]
static void misdn_cfg_unlock(void)
Structure used to handle boolean flags.
void misdn_cfg_get_ports_string(char *ports)
Generate a comma separated list of all active ports.
static void _free_general_cfg(void)
void misdn_cfg_get_config_string(int port, enum misdn_cfg_elements elem, char *buf, int bufsize)
static void _build_general_config(struct ast_variable *v)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
void misdn_cfg_get(int port, enum misdn_cfg_elements elem, void *buf, int bufsize)
static void misdn_cfg_lock(void)
struct ast_variable * next
#define ast_mutex_init(pmutex)
#define CONFIG_STATUS_FILEINVALID
#define ast_mutex_destroy(a)
int misdn_cfg_is_port_valid(int port)
#define CLI_ERROR(name, value, section)
static ast_mutex_t config_mutex
General jitterbuffer configuration.
Structure for mutex and tracking information.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
#define CONFIG_STATUS_FILEUNCHANGED
#define ast_mutex_unlock(a)