#include "asterisk.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "chan_misdn_config.h"
#include "asterisk/config.h"
#include "asterisk/channel.h"
#include "asterisk/logger.h"
#include "asterisk/lock.h"
#include "asterisk/pbx.h"
#include "asterisk/strings.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
union | misdn_cfg_pt |
struct | misdn_cfg_spec |
struct | msn_list |
Defines | |
#define | AST_DESTROY_CFG ast_config_destroy |
#define | AST_LOAD_CFG ast_config_load |
#define | CLI_ERROR(name, value, section) |
#define | GEN_CFG 1 |
#define | NO_DEFAULT "<>" |
#define | NONE 0 |
#define | NUM_GEN_ELEMENTS (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec)) |
#define | NUM_PORT_ELEMENTS (sizeof(port_spec) / sizeof(struct misdn_cfg_spec)) |
#define | PORT_CFG 2 |
Enumerations | |
enum | misdn_cfg_type { MISDN_CTYPE_STR, MISDN_CTYPE_INT, MISDN_CTYPE_BOOL, MISDN_CTYPE_BOOLINT, MISDN_CTYPE_MSNLIST, MISDN_CTYPE_ASTGROUP } |
Functions | |
static void | _build_general_config (struct ast_variable *v) |
static void | _build_port_config (struct ast_variable *v, char *cat) |
static int | _enum_array_map (void) |
static void | _fill_defaults (void) |
static void | _free_general_cfg (void) |
static void | _free_msn_list (struct msn_list *iter) |
static void | _free_port_cfg (void) |
static int | _parse (union misdn_cfg_pt *dest, char *value, enum misdn_cfg_type type, int boolint_def) |
static int | get_cfg_position (char *name, int type) |
void | misdn_cfg_destroy (void) |
void | misdn_cfg_get (int port, enum misdn_cfg_elements elem, void *buf, int bufsize) |
void | misdn_cfg_get_config_string (int port, enum misdn_cfg_elements elem, char *buf, int bufsize) |
void | misdn_cfg_get_desc (enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default) |
enum misdn_cfg_elements | misdn_cfg_get_elem (char *name) |
void | misdn_cfg_get_name (enum misdn_cfg_elements elem, void *buf, int bufsize) |
int | misdn_cfg_get_next_port (int port) |
int | misdn_cfg_get_next_port_spin (int port) |
void | misdn_cfg_get_ports_string (char *ports) |
Generate a comma separated list of all active ports. | |
int | misdn_cfg_init (int this_max_ports) |
int | misdn_cfg_is_group_method (char *group, enum misdn_cfg_method meth) |
int | misdn_cfg_is_msn_valid (int port, char *msn) |
int | misdn_cfg_is_port_valid (int port) |
static void | misdn_cfg_lock (void) |
void | misdn_cfg_reload (void) |
static void | misdn_cfg_unlock (void) |
void | misdn_cfg_update_ptp (void) |
ast_jb_conf * | misdn_get_global_jbconf () |
Variables | |
static ast_mutex_t | config_mutex |
static struct ast_jb_conf | default_jbconf |
static struct misdn_cfg_spec | gen_spec [] |
static union misdn_cfg_pt * | general_cfg |
static struct ast_jb_conf | global_jbconf |
static int * | map |
static int | max_ports |
static union misdn_cfg_pt ** | port_cfg |
static struct misdn_cfg_spec | port_spec [] |
static const char | ports_description [] |
static int * | ptp |
Definition in file misdn_config.c.
#define AST_DESTROY_CFG ast_config_destroy |
#define AST_LOAD_CFG ast_config_load |
#define CLI_ERROR | ( | name, | |||
value, | |||||
section | ) |
Value:
({ \ ast_log(LOG_WARNING, "misdn.conf: \"%s=%s\" (section: %s) invalid or out of range. " \ "Please edit your misdn.conf and then do a \"misdn reload\".\n", name, value, section); \ })
Definition at line 401 of file misdn_config.c.
Referenced by _build_general_config(), and _build_port_config().
#define GEN_CFG 1 |
Definition at line 54 of file misdn_config.c.
Referenced by _build_general_config(), get_cfg_position(), and misdn_cfg_get_elem().
#define NO_DEFAULT "<>" |
Definition at line 51 of file misdn_config.c.
Referenced by _fill_defaults(), and misdn_cfg_get_desc().
#define NONE 0 |
Definition at line 52 of file misdn_config.c.
#define NUM_GEN_ELEMENTS (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec)) |
Definition at line 56 of file misdn_config.c.
Referenced by _enum_array_map(), _fill_defaults(), _free_general_cfg(), get_cfg_position(), and misdn_cfg_init().
#define NUM_PORT_ELEMENTS (sizeof(port_spec) / sizeof(struct misdn_cfg_spec)) |
Definition at line 57 of file misdn_config.c.
Referenced by _build_port_config(), _enum_array_map(), _fill_defaults(), _free_port_cfg(), get_cfg_position(), and misdn_cfg_init().
#define PORT_CFG 2 |
Definition at line 55 of file misdn_config.c.
Referenced by _build_port_config(), get_cfg_position(), and misdn_cfg_get_elem().
enum misdn_cfg_type |
MISDN_CTYPE_STR | |
MISDN_CTYPE_INT | |
MISDN_CTYPE_BOOL | |
MISDN_CTYPE_BOOLINT | |
MISDN_CTYPE_MSNLIST | |
MISDN_CTYPE_ASTGROUP |
Definition at line 70 of file misdn_config.c.
00070 { 00071 MISDN_CTYPE_STR, 00072 MISDN_CTYPE_INT, 00073 MISDN_CTYPE_BOOL, 00074 MISDN_CTYPE_BOOLINT, 00075 MISDN_CTYPE_MSNLIST, 00076 MISDN_CTYPE_ASTGROUP 00077 };
static void _build_general_config | ( | struct ast_variable * | v | ) | [static] |
Definition at line 947 of file misdn_config.c.
References _parse(), ast_jb_read_conf(), misdn_cfg_spec::boolint_def, CLI_ERROR, GEN_CFG, gen_spec, general_cfg, get_cfg_position(), global_jbconf, ast_variable::name, ast_variable::next, misdn_cfg_spec::type, and ast_variable::value.
Referenced by misdn_cfg_init().
00948 { 00949 int pos; 00950 00951 for (; v; v = v->next) { 00952 if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) 00953 continue; 00954 if (((pos = get_cfg_position(v->name, GEN_CFG)) < 0) || 00955 (_parse(&general_cfg[pos], v->value, gen_spec[pos].type, gen_spec[pos].boolint_def) < 0)) 00956 CLI_ERROR(v->name, v->value, "general"); 00957 } 00958 }
static void _build_port_config | ( | struct ast_variable * | v, | |
char * | cat | |||
) | [static] |
Definition at line 960 of file misdn_config.c.
References _parse(), BUFFERSIZE, CLI_ERROR, get_cfg_position(), max_ports, ast_variable::name, ast_variable::next, NUM_PORT_ELEMENTS, PORT_CFG, port_spec, ptp, type, and ast_variable::value.
Referenced by misdn_cfg_init().
00961 { 00962 int pos, i; 00963 union misdn_cfg_pt cfg_tmp[NUM_PORT_ELEMENTS]; 00964 int cfg_for_ports[max_ports + 1]; 00965 00966 if (!v || !cat) 00967 return; 00968 00969 memset(cfg_tmp, 0, sizeof(cfg_tmp)); 00970 memset(cfg_for_ports, 0, sizeof(cfg_for_ports)); 00971 00972 if (!strcasecmp(cat, "default")) { 00973 cfg_for_ports[0] = 1; 00974 } 00975 00976 if (((pos = get_cfg_position("name", PORT_CFG)) < 0) || 00977 (_parse(&cfg_tmp[pos], cat, port_spec[pos].type, port_spec[pos].boolint_def) < 0)) { 00978 CLI_ERROR(v->name, v->value, cat); 00979 return; 00980 } 00981 00982 for (; v; v = v->next) { 00983 if (!strcasecmp(v->name, "ports")) { 00984 char *token; 00985 char ptpbuf[BUFFERSIZE] = ""; 00986 int start, end; 00987 for (token = strsep(&v->value, ","); token; token = strsep(&v->value, ","), *ptpbuf = 0) { 00988 if (!*token) 00989 continue; 00990 if (sscanf(token, "%d-%d%s", &start, &end, ptpbuf) >= 2) { 00991 for (; start <= end; start++) { 00992 if (start <= max_ports && start > 0) { 00993 cfg_for_ports[start] = 1; 00994 ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0; 00995 } else 00996 CLI_ERROR(v->name, v->value, cat); 00997 } 00998 } else { 00999 if (sscanf(token, "%d%s", &start, ptpbuf)) { 01000 if (start <= max_ports && start > 0) { 01001 cfg_for_ports[start] = 1; 01002 ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0; 01003 } else 01004 CLI_ERROR(v->name, v->value, cat); 01005 } else 01006 CLI_ERROR(v->name, v->value, cat); 01007 } 01008 } 01009 } else { 01010 if (((pos = get_cfg_position(v->name, PORT_CFG)) < 0) || 01011 (_parse(&cfg_tmp[pos], v->value, port_spec[pos].type, port_spec[pos].boolint_def) < 0)) 01012 CLI_ERROR(v->name, v->value, cat); 01013 } 01014 } 01015 01016 for (i = 0; i < (max_ports + 1); ++i) { 01017 if (cfg_for_ports[i]) { 01018 memcpy(port_cfg[i], cfg_tmp, sizeof(cfg_tmp)); 01019 } 01020 } 01021 }
static int _enum_array_map | ( | void | ) | [static] |
Definition at line 406 of file misdn_config.c.
References ast_log(), gen_spec, LOG_WARNING, MISDN_CFG_FIRST, MISDN_CFG_LAST, MISDN_CFG_PTP, MISDN_GEN_FIRST, MISDN_GEN_LAST, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, and port_spec.
Referenced by misdn_cfg_init().
00407 { 00408 int i, j, ok; 00409 00410 for (i = MISDN_CFG_FIRST + 1; i < MISDN_CFG_LAST; ++i) { 00411 if (i == MISDN_CFG_PTP) 00412 continue; 00413 ok = 0; 00414 for (j = 0; j < NUM_PORT_ELEMENTS; ++j) { 00415 if (port_spec[j].elem == i) { 00416 map[i] = j; 00417 ok = 1; 00418 break; 00419 } 00420 } 00421 if (!ok) { 00422 ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (port section) has no corresponding element in the config struct!\n", i); 00423 return -1; 00424 } 00425 } 00426 for (i = MISDN_GEN_FIRST + 1; i < MISDN_GEN_LAST; ++i) { 00427 ok = 0; 00428 for (j = 0; j < NUM_GEN_ELEMENTS; ++j) { 00429 if (gen_spec[j].elem == i) { 00430 map[i] = j; 00431 ok = 1; 00432 break; 00433 } 00434 } 00435 if (!ok) { 00436 ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (general section) has no corresponding element in the config struct!\n", i); 00437 return -1; 00438 } 00439 } 00440 return 0; 00441 }
static void _fill_defaults | ( | void | ) | [static] |
Definition at line 1078 of file misdn_config.c.
References _parse(), misdn_cfg_pt::any, gen_spec, general_cfg, NO_DEFAULT, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, port_cfg, port_spec, and type.
Referenced by misdn_cfg_init().
01079 { 01080 int i; 01081 01082 for (i = 0; i < NUM_PORT_ELEMENTS; ++i) { 01083 if (!port_cfg[0][i].any && strcasecmp(port_spec[i].def, NO_DEFAULT)) 01084 _parse(&(port_cfg[0][i]), (char *)port_spec[i].def, port_spec[i].type, port_spec[i].boolint_def); 01085 } 01086 for (i = 0; i < NUM_GEN_ELEMENTS; ++i) { 01087 if (!general_cfg[i].any && strcasecmp(gen_spec[i].def, NO_DEFAULT)) 01088 _parse(&(general_cfg[i]), (char *)gen_spec[i].def, gen_spec[i].type, gen_spec[i].boolint_def); 01089 } 01090 }
static void _free_general_cfg | ( | void | ) | [static] |
Definition at line 516 of file misdn_config.c.
References misdn_cfg_pt::any, free, general_cfg, and NUM_GEN_ELEMENTS.
Referenced by misdn_cfg_destroy(), and misdn_cfg_init().
00517 { 00518 int i; 00519 00520 for (i = 0; i < NUM_GEN_ELEMENTS; i++) 00521 if (general_cfg[i].any) 00522 free(general_cfg[i].any); 00523 }
static void _free_msn_list | ( | struct msn_list * | iter | ) | [static] |
Definition at line 474 of file misdn_config.c.
References free, msn_list::msn, and msn_list::next.
Referenced by _free_port_cfg().
00475 { 00476 if (iter->next) 00477 _free_msn_list(iter->next); 00478 if (iter->msn) 00479 free(iter->msn); 00480 free(iter); 00481 }
static void _free_port_cfg | ( | void | ) | [static] |
Definition at line 483 of file misdn_config.c.
References _free_msn_list(), misdn_cfg_pt::any, free, MISDN_CFG_GROUPNAME, MISDN_CTYPE_MSNLIST, misdn_cfg_pt::ml, NUM_PORT_ELEMENTS, port_cfg, port_spec, misdn_cfg_pt::str, and type.
Referenced by misdn_cfg_destroy(), and misdn_cfg_init().
00484 { 00485 int i, j; 00486 int gn = map[MISDN_CFG_GROUPNAME]; 00487 union misdn_cfg_pt* free_list[max_ports + 2]; 00488 00489 memset(free_list, 0, sizeof(free_list)); 00490 free_list[0] = port_cfg[0]; 00491 for (i = 1; i <= max_ports; ++i) { 00492 if (port_cfg[i][gn].str) { 00493 /* we always have a groupname in the non-default case, so this is fine */ 00494 for (j = 1; j <= max_ports; ++j) { 00495 if (free_list[j] && free_list[j][gn].str == port_cfg[i][gn].str) 00496 break; 00497 else if (!free_list[j]) { 00498 free_list[j] = port_cfg[i]; 00499 break; 00500 } 00501 } 00502 } 00503 } 00504 for (j = 0; free_list[j]; ++j) { 00505 for (i = 0; i < NUM_PORT_ELEMENTS; ++i) { 00506 if (free_list[j][i].any) { 00507 if (port_spec[i].type == MISDN_CTYPE_MSNLIST) 00508 _free_msn_list(free_list[j][i].ml); 00509 else 00510 free(free_list[j][i].any); 00511 } 00512 } 00513 } 00514 }
static int _parse | ( | union misdn_cfg_pt * | dest, | |
char * | value, | |||
enum misdn_cfg_type | type, | |||
int | boolint_def | |||
) | [static] |
Definition at line 884 of file misdn_config.c.
References ast_get_group(), ast_true(), calloc, misdn_cfg_pt::grp, len(), malloc, MISDN_CTYPE_ASTGROUP, MISDN_CTYPE_BOOL, MISDN_CTYPE_BOOLINT, MISDN_CTYPE_INT, MISDN_CTYPE_MSNLIST, MISDN_CTYPE_STR, misdn_cfg_pt::ml, msn_list::msn, msn_list::next, misdn_cfg_pt::num, and misdn_cfg_pt::str.
Referenced by _build_general_config(), _build_port_config(), and _fill_defaults().
00885 { 00886 int re = 0; 00887 int len, tmp; 00888 char *valtmp; 00889 00890 switch (type) { 00891 case MISDN_CTYPE_STR: 00892 if ((len = strlen(value))) { 00893 dest->str = (char *)malloc((len + 1) * sizeof(char)); 00894 strncpy(dest->str, value, len); 00895 dest->str[len] = 0; 00896 } else { 00897 dest->str = (char *)malloc( sizeof(char)); 00898 dest->str[0] = 0; 00899 } 00900 break; 00901 case MISDN_CTYPE_INT: 00902 { 00903 char *pat; 00904 if (strchr(value,'x')) 00905 pat="%x"; 00906 else 00907 pat="%d"; 00908 if (sscanf(value, pat, &tmp)) { 00909 dest->num = (int *)malloc(sizeof(int)); 00910 memcpy(dest->num, &tmp, sizeof(int)); 00911 } else 00912 re = -1; 00913 } 00914 break; 00915 case MISDN_CTYPE_BOOL: 00916 dest->num = (int *)malloc(sizeof(int)); 00917 *(dest->num) = (ast_true(value) ? 1 : 0); 00918 break; 00919 case MISDN_CTYPE_BOOLINT: 00920 dest->num = (int *)malloc(sizeof(int)); 00921 if (sscanf(value, "%d", &tmp)) { 00922 memcpy(dest->num, &tmp, sizeof(int)); 00923 } else { 00924 *(dest->num) = (ast_true(value) ? boolint_def : 0); 00925 } 00926 break; 00927 case MISDN_CTYPE_MSNLIST: 00928 for (valtmp = strsep(&value, ","); valtmp; valtmp = strsep(&value, ",")) { 00929 if ((len = strlen(valtmp))) { 00930 struct msn_list *ml = (struct msn_list *)malloc(sizeof(struct msn_list)); 00931 ml->msn = (char *)calloc(len+1, sizeof(char)); 00932 strncpy(ml->msn, valtmp, len); 00933 ml->next = dest->ml; 00934 dest->ml = ml; 00935 } 00936 } 00937 break; 00938 case MISDN_CTYPE_ASTGROUP: 00939 dest->grp = (ast_group_t *)malloc(sizeof(ast_group_t)); 00940 *(dest->grp) = ast_get_group(value); 00941 break; 00942 } 00943 00944 return re; 00945 }
static int get_cfg_position | ( | char * | name, | |
int | type | |||
) | [static] |
Definition at line 443 of file misdn_config.c.
References GEN_CFG, gen_spec, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, PORT_CFG, and port_spec.
Referenced by _build_general_config(), _build_port_config(), and misdn_cfg_get_elem().
00444 { 00445 int i; 00446 00447 switch (type) { 00448 case PORT_CFG: 00449 for (i = 0; i < NUM_PORT_ELEMENTS; ++i) { 00450 if (!strcasecmp(name, port_spec[i].name)) 00451 return i; 00452 } 00453 break; 00454 case GEN_CFG: 00455 for (i = 0; i < NUM_GEN_ELEMENTS; ++i) { 00456 if (!strcasecmp(name, gen_spec[i].name)) 00457 return i; 00458 } 00459 } 00460 00461 return -1; 00462 }
void misdn_cfg_destroy | ( | void | ) |
Definition at line 1097 of file misdn_config.c.
References _free_general_cfg(), _free_port_cfg(), ast_mutex_destroy(), config_mutex, free, general_cfg, map, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, and ptp.
Referenced by unload_module().
01098 { 01099 misdn_cfg_lock(); 01100 01101 _free_port_cfg(); 01102 _free_general_cfg(); 01103 01104 free(port_cfg); 01105 free(general_cfg); 01106 free(ptp); 01107 free(map); 01108 01109 misdn_cfg_unlock(); 01110 ast_mutex_destroy(&config_mutex); 01111 }
void misdn_cfg_get | ( | int | port, | |
enum misdn_cfg_elements | elem, | |||
void * | buf, | |||
int | bufsize | |||
) |
Definition at line 525 of file misdn_config.c.
References misdn_cfg_pt::any, ast_log(), gen_spec, general_cfg, LOG_WARNING, misdn_cfg_is_port_valid(), MISDN_CFG_LAST, misdn_cfg_lock(), MISDN_CFG_PTP, misdn_cfg_unlock(), MISDN_CTYPE_STR, port_cfg, port_spec, misdn_cfg_pt::str, and type.
Referenced by add_in_calls(), add_out_calls(), cb_events(), dialtone_indicate(), load_module(), misdn_bridge(), misdn_call(), misdn_cfg_update_ptp(), misdn_check_l2l1(), misdn_new(), misdn_request(), misdn_set_opt_exec(), process_ast_dsp(), read_config(), reload_config(), update_config(), and update_ec_config().
00526 { 00527 int place; 00528 00529 if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) { 00530 memset(buf, 0, bufsize); 00531 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Port number %d is not valid.\n", port); 00532 return; 00533 } 00534 00535 misdn_cfg_lock(); 00536 if (elem == MISDN_CFG_PTP) { 00537 if (!memcpy(buf, &ptp[port], (bufsize > ptp[port]) ? sizeof(ptp[port]) : bufsize)) 00538 memset(buf, 0, bufsize); 00539 } else { 00540 if ((place = map[elem]) < 0) { 00541 memset (buf, 0, bufsize); 00542 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Invalid element (%d) requested.\n", elem); 00543 } else { 00544 if (elem < MISDN_CFG_LAST) { 00545 switch (port_spec[place].type) { 00546 case MISDN_CTYPE_STR: 00547 if (port_cfg[port][place].str) { 00548 if (!memccpy(buf, port_cfg[port][place].str, 0, bufsize)) 00549 memset(buf, 0, 1); 00550 } else if (port_cfg[0][place].str) { 00551 if (!memccpy(buf, port_cfg[0][place].str, 0, bufsize)) 00552 memset(buf, 0, 1); 00553 } else 00554 memset(buf, 0, bufsize); 00555 break; 00556 default: 00557 if (port_cfg[port][place].any) 00558 memcpy(buf, port_cfg[port][place].any, bufsize); 00559 else if (port_cfg[0][place].any) 00560 memcpy(buf, port_cfg[0][place].any, bufsize); 00561 else 00562 memset(buf, 0, bufsize); 00563 } 00564 } else { 00565 switch (gen_spec[place].type) { 00566 case MISDN_CTYPE_STR: 00567 if (!general_cfg[place].str || !memccpy(buf, general_cfg[place].str, 0, bufsize)) 00568 memset(buf, 0, 1); 00569 break; 00570 default: 00571 if (general_cfg[place].any) 00572 memcpy(buf, general_cfg[place].any, bufsize); 00573 else 00574 memset(buf, 0, bufsize); 00575 } 00576 } 00577 } 00578 } 00579 misdn_cfg_unlock(); 00580 }
void misdn_cfg_get_config_string | ( | int | port, | |
enum misdn_cfg_elements | elem, | |||
char * | buf, | |||
int | bufsize | |||
) |
Definition at line 756 of file misdn_config.c.
References ast_log(), ast_print_group(), BUFFERSIZE, gen_spec, general_cfg, LOG_WARNING, map, MISDN_CFG_FIRST, misdn_cfg_is_port_valid(), MISDN_CFG_LAST, misdn_cfg_lock(), MISDN_CFG_PTP, misdn_cfg_unlock(), MISDN_CTYPE_ASTGROUP, MISDN_CTYPE_BOOL, MISDN_CTYPE_BOOLINT, MISDN_CTYPE_INT, MISDN_CTYPE_MSNLIST, MISDN_CTYPE_STR, MISDN_GEN_FIRST, MISDN_GEN_LAST, misdn_cfg_pt::ml, msn_list::msn, name, msn_list::next, port_cfg, port_spec, ptp, and type.
Referenced by misdn_show_config().
00757 { 00758 int place; 00759 char tempbuf[BUFFERSIZE] = ""; 00760 struct msn_list *iter; 00761 00762 if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) { 00763 *buf = 0; 00764 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Port number %d is not valid.\n", port); 00765 return; 00766 } 00767 00768 place = map[elem]; 00769 00770 misdn_cfg_lock(); 00771 if (elem == MISDN_CFG_PTP) { 00772 snprintf(buf, bufsize, " -> ptp: %s", ptp[port] ? "yes" : "no"); 00773 } 00774 else if (elem > MISDN_CFG_FIRST && elem < MISDN_CFG_LAST) { 00775 switch (port_spec[place].type) { 00776 case MISDN_CTYPE_INT: 00777 case MISDN_CTYPE_BOOLINT: 00778 if (port_cfg[port][place].num) 00779 snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[port][place].num); 00780 else if (port_cfg[0][place].num) 00781 snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[0][place].num); 00782 else 00783 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00784 break; 00785 case MISDN_CTYPE_BOOL: 00786 if (port_cfg[port][place].num) 00787 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[port][place].num ? "yes" : "no"); 00788 else if (port_cfg[0][place].num) 00789 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[0][place].num ? "yes" : "no"); 00790 else 00791 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00792 break; 00793 case MISDN_CTYPE_ASTGROUP: 00794 if (port_cfg[port][place].grp) 00795 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, 00796 ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[port][place].grp)); 00797 else if (port_cfg[0][place].grp) 00798 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, 00799 ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[0][place].grp)); 00800 else 00801 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00802 break; 00803 case MISDN_CTYPE_MSNLIST: 00804 if (port_cfg[port][place].ml) 00805 iter = port_cfg[port][place].ml; 00806 else 00807 iter = port_cfg[0][place].ml; 00808 if (iter) { 00809 for (; iter; iter = iter->next) { 00810 strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1); 00811 } 00812 if (strlen(tempbuf) > 1) { 00813 tempbuf[strlen(tempbuf)-2] = 0; 00814 } 00815 } 00816 snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none"); 00817 break; 00818 case MISDN_CTYPE_STR: 00819 if ( port_cfg[port][place].str) { 00820 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[port][place].str); 00821 } else if (port_cfg[0][place].str) { 00822 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[0][place].str); 00823 } else { 00824 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00825 } 00826 break; 00827 } 00828 } else if (elem > MISDN_GEN_FIRST && elem < MISDN_GEN_LAST) { 00829 switch (gen_spec[place].type) { 00830 case MISDN_CTYPE_INT: 00831 case MISDN_CTYPE_BOOLINT: 00832 if (general_cfg[place].num) 00833 snprintf(buf, bufsize, " -> %s: %d", gen_spec[place].name, *general_cfg[place].num); 00834 else 00835 snprintf(buf, bufsize, " -> %s:", gen_spec[place].name); 00836 break; 00837 case MISDN_CTYPE_BOOL: 00838 if (general_cfg[place].num) 00839 snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, *general_cfg[place].num ? "yes" : "no"); 00840 else 00841 snprintf(buf, bufsize, " -> %s:", gen_spec[place].name); 00842 break; 00843 case MISDN_CTYPE_STR: 00844 if ( general_cfg[place].str) { 00845 snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, general_cfg[place].str); 00846 } else { 00847 snprintf(buf, bufsize, " -> %s:", gen_spec[place].name); 00848 } 00849 break; 00850 default: 00851 snprintf(buf, bufsize, " -> type of %s not handled yet", gen_spec[place].name); 00852 break; 00853 } 00854 } else { 00855 *buf = 0; 00856 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Invalid config element (%d) requested.\n", elem); 00857 } 00858 misdn_cfg_unlock(); 00859 }
void misdn_cfg_get_desc | ( | enum misdn_cfg_elements | elem, | |
void * | buf, | |||
int | bufsize, | |||
void * | buf_default, | |||
int | bufsize_default | |||
) |
Definition at line 630 of file misdn_config.c.
References misdn_cfg_spec::def, desc, gen_spec, MISDN_CFG_FIRST, MISDN_CFG_GROUPNAME, MISDN_CFG_LAST, MISDN_GEN_FIRST, MISDN_GEN_LAST, NO_DEFAULT, and port_spec.
Referenced by show_config_description().
00631 { 00632 int place = map[elem]; 00633 struct misdn_cfg_spec *spec = NULL; 00634 00635 /* here comes a hack to replace the (not existing) "name" element with the "ports" element */ 00636 if (elem == MISDN_CFG_GROUPNAME) { 00637 if (!memccpy(buf, ports_description, 0, bufsize)) 00638 memset(buf, 0, 1); 00639 if (buf_default && bufsize_default) 00640 memset(buf_default, 0, 1); 00641 return; 00642 } 00643 00644 if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST)) 00645 spec = (struct misdn_cfg_spec *)port_spec; 00646 else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST)) 00647 spec = (struct misdn_cfg_spec *)gen_spec; 00648 00649 if (!spec || !spec[place].desc) 00650 memset(buf, 0, 1); 00651 else { 00652 if (!memccpy(buf, spec[place].desc, 0, bufsize)) 00653 memset(buf, 0, 1); 00654 if (buf_default && bufsize) { 00655 if (!strcmp(spec[place].def, NO_DEFAULT)) 00656 memset(buf_default, 0, 1); 00657 else if (!memccpy(buf_default, spec[place].def, 0, bufsize_default)) 00658 memset(buf_default, 0, 1); 00659 } 00660 } 00661 }
enum misdn_cfg_elements misdn_cfg_get_elem | ( | char * | name | ) |
Definition at line 582 of file misdn_config.c.
References misdn_cfg_spec::elem, GEN_CFG, gen_spec, get_cfg_position(), MISDN_CFG_FIRST, MISDN_CFG_GROUPNAME, PORT_CFG, and port_spec.
Referenced by misdn_show_config().
00583 { 00584 int pos; 00585 00586 /* here comes a hack to replace the (not existing) "name" element with the "ports" element */ 00587 if (!strcmp(name, "ports")) 00588 return MISDN_CFG_GROUPNAME; 00589 if (!strcmp(name, "name")) 00590 return MISDN_CFG_FIRST; 00591 00592 pos = get_cfg_position (name, PORT_CFG); 00593 if (pos >= 0) 00594 return port_spec[pos].elem; 00595 00596 pos = get_cfg_position (name, GEN_CFG); 00597 if (pos >= 0) 00598 return gen_spec[pos].elem; 00599 00600 return MISDN_CFG_FIRST; 00601 }
void misdn_cfg_get_name | ( | enum misdn_cfg_elements | elem, | |
void * | buf, | |||
int | bufsize | |||
) |
Definition at line 603 of file misdn_config.c.
References gen_spec, MISDN_CFG_FIRST, MISDN_CFG_GROUPNAME, MISDN_CFG_LAST, MISDN_CFG_PTP, MISDN_GEN_FIRST, MISDN_GEN_LAST, name, and port_spec.
Referenced by complete_show_config(), and show_config_description().
00604 { 00605 struct misdn_cfg_spec *spec = NULL; 00606 int place = map[elem]; 00607 00608 /* the ptp hack */ 00609 if (elem == MISDN_CFG_PTP) { 00610 memset(buf, 0, 1); 00611 return; 00612 } 00613 00614 /* here comes a hack to replace the (not existing) "name" element with the "ports" element */ 00615 if (elem == MISDN_CFG_GROUPNAME) { 00616 if (!snprintf(buf, bufsize, "ports")) 00617 memset(buf, 0, 1); 00618 return; 00619 } 00620 00621 if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST)) 00622 spec = (struct misdn_cfg_spec *)port_spec; 00623 else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST)) 00624 spec = (struct misdn_cfg_spec *)gen_spec; 00625 00626 if (!spec || !memccpy(buf, spec[place].name, 0, bufsize)) 00627 memset(buf, 0, 1); 00628 }
int misdn_cfg_get_next_port | ( | int | port | ) |
Definition at line 861 of file misdn_config.c.
References map, max_ports, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), misdn_cfg_unlock(), and port_cfg.
Referenced by complete_show_config(), load_module(), misdn_cfg_get_next_port_spin(), misdn_check_l2l1(), misdn_new(), misdn_request(), misdn_show_config(), misdn_show_ports_stats(), misdn_show_stacks(), and update_name().
00862 { 00863 int p = -1; 00864 int gn = map[MISDN_CFG_GROUPNAME]; 00865 00866 misdn_cfg_lock(); 00867 for (port++; port <= max_ports; port++) { 00868 if (port_cfg[port][gn].str) { 00869 p = port; 00870 break; 00871 } 00872 } 00873 misdn_cfg_unlock(); 00874 00875 return p; 00876 }
int misdn_cfg_get_next_port_spin | ( | int | port | ) |
Definition at line 878 of file misdn_config.c.
References misdn_cfg_get_next_port().
Referenced by misdn_request().
00879 { 00880 int p = misdn_cfg_get_next_port(port); 00881 return (p > 0) ? p : misdn_cfg_get_next_port(0); 00882 }
void misdn_cfg_get_ports_string | ( | char * | ports | ) |
Generate a comma separated list of all active ports.
Definition at line 730 of file misdn_config.c.
References map, max_ports, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, and ptp.
Referenced by load_module().
00731 { 00732 char tmp[16]; 00733 int l, i; 00734 int gn = map[MISDN_CFG_GROUPNAME]; 00735 00736 *ports = 0; 00737 00738 misdn_cfg_lock(); 00739 for (i = 1; i <= max_ports; i++) { 00740 if (port_cfg[i][gn].str) { 00741 if (ptp[i]) 00742 sprintf(tmp, "%dptp,", i); 00743 else 00744 sprintf(tmp, "%d,", i); 00745 strcat(ports, tmp); 00746 } 00747 } 00748 misdn_cfg_unlock(); 00749 00750 if ((l = strlen(ports))) { 00751 /* Strip trailing ',' */ 00752 ports[l-1] = 0; 00753 } 00754 }
int misdn_cfg_init | ( | int | this_max_ports | ) |
Definition at line 1113 of file misdn_config.c.
References _build_general_config(), _build_port_config(), _enum_array_map(), _fill_defaults(), _free_general_cfg(), _free_port_cfg(), ast_category_browse(), AST_DESTROY_CFG, AST_LOAD_CFG, ast_log(), ast_mutex_init(), ast_variable_browse(), calloc, config, config_mutex, default_jbconf, general_cfg, global_jbconf, LOG_WARNING, map, max_ports, misdn_cfg_lock(), misdn_cfg_unlock(), MISDN_GEN_LAST, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, port_cfg, and ptp.
Referenced by load_module(), and misdn_cfg_reload().
01114 { 01115 char config[] = "misdn.conf"; 01116 char *cat, *p; 01117 int i; 01118 struct ast_config *cfg; 01119 struct ast_variable *v; 01120 01121 if (!(cfg = AST_LOAD_CFG(config))) { 01122 ast_log(LOG_WARNING, "missing file: misdn.conf\n"); 01123 return -1; 01124 } 01125 01126 ast_mutex_init(&config_mutex); 01127 01128 /* Copy the default jb config over global_jbconf */ 01129 memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); 01130 01131 misdn_cfg_lock(); 01132 01133 if (this_max_ports) { 01134 /* this is the first run */ 01135 max_ports = this_max_ports; 01136 map = (int *)calloc(MISDN_GEN_LAST + 1, sizeof(int)); 01137 if (_enum_array_map()) 01138 return -1; 01139 p = (char *)calloc(1, (max_ports + 1) * sizeof(union misdn_cfg_pt *) 01140 + (max_ports + 1) * NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt)); 01141 port_cfg = (union misdn_cfg_pt **)p; 01142 p += (max_ports + 1) * sizeof(union misdn_cfg_pt *); 01143 for (i = 0; i <= max_ports; ++i) { 01144 port_cfg[i] = (union misdn_cfg_pt *)p; 01145 p += NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt); 01146 } 01147 general_cfg = (union misdn_cfg_pt *)calloc(1, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS); 01148 ptp = (int *)calloc(max_ports + 1, sizeof(int)); 01149 } 01150 else { 01151 /* misdn reload */ 01152 _free_port_cfg(); 01153 _free_general_cfg(); 01154 memset(port_cfg[0], 0, NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt) * (max_ports + 1)); 01155 memset(general_cfg, 0, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS); 01156 memset(ptp, 0, sizeof(int) * (max_ports + 1)); 01157 } 01158 01159 cat = ast_category_browse(cfg, NULL); 01160 01161 while(cat) { 01162 v = ast_variable_browse(cfg, cat); 01163 if (!strcasecmp(cat, "general")) { 01164 _build_general_config(v); 01165 } else { 01166 _build_port_config(v, cat); 01167 } 01168 cat = ast_category_browse(cfg, cat); 01169 } 01170 01171 _fill_defaults(); 01172 01173 misdn_cfg_unlock(); 01174 AST_DESTROY_CFG(cfg); 01175 01176 return 0; 01177 }
int misdn_cfg_is_group_method | ( | char * | group, | |
enum misdn_cfg_method | meth | |||
) |
Definition at line 695 of file misdn_config.c.
References map, max_ports, METHOD_ROUND_ROBIN, METHOD_STANDARD, METHOD_STANDARD_DEC, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), MISDN_CFG_METHOD, misdn_cfg_unlock(), port_cfg, and misdn_cfg_pt::str.
Referenced by misdn_request().
00696 { 00697 int i, re = 0; 00698 char *method ; 00699 00700 misdn_cfg_lock(); 00701 00702 method = port_cfg[0][map[MISDN_CFG_METHOD]].str; 00703 00704 for (i = 1; i <= max_ports; i++) { 00705 if (port_cfg[i] && port_cfg[i][map[MISDN_CFG_GROUPNAME]].str) { 00706 if (!strcasecmp(port_cfg[i][map[MISDN_CFG_GROUPNAME]].str, group)) 00707 method = (port_cfg[i][map[MISDN_CFG_METHOD]].str ? 00708 port_cfg[i][map[MISDN_CFG_METHOD]].str : port_cfg[0][map[MISDN_CFG_METHOD]].str); 00709 } 00710 } 00711 00712 if (method) { 00713 switch (meth) { 00714 case METHOD_STANDARD: re = !strcasecmp(method, "standard"); 00715 break; 00716 case METHOD_ROUND_ROBIN: re = !strcasecmp(method, "round_robin"); 00717 break; 00718 case METHOD_STANDARD_DEC: re = !strcasecmp(method, "standard_dec"); 00719 break; 00720 } 00721 } 00722 misdn_cfg_unlock(); 00723 00724 return re; 00725 }
int misdn_cfg_is_msn_valid | ( | int | port, | |
char * | msn | |||
) |
Definition at line 663 of file misdn_config.c.
References ast_extension_match(), ast_log(), LOG_WARNING, misdn_cfg_is_port_valid(), misdn_cfg_lock(), MISDN_CFG_MSNS, misdn_cfg_pt::ml, msn_list::msn, msn_list::next, and port_cfg.
Referenced by cb_events().
00664 { 00665 int re = 0; 00666 struct msn_list *iter; 00667 00668 if (!misdn_cfg_is_port_valid(port)) { 00669 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_is_msn_valid! Port number %d is not valid.\n", port); 00670 return 0; 00671 } 00672 00673 misdn_cfg_lock(); 00674 if (port_cfg[port][map[MISDN_CFG_MSNS]].ml) 00675 iter = port_cfg[port][map[MISDN_CFG_MSNS]].ml; 00676 else 00677 iter = port_cfg[0][map[MISDN_CFG_MSNS]].ml; 00678 for (; iter; iter = iter->next) 00679 if (*(iter->msn) == '*' || ast_extension_match(iter->msn, msn)) { 00680 re = 1; 00681 break; 00682 } 00683 misdn_cfg_unlock(); 00684 00685 return re; 00686 }
int misdn_cfg_is_port_valid | ( | int | port | ) |
Definition at line 688 of file misdn_config.c.
References map, max_ports, MISDN_CFG_GROUPNAME, and port_cfg.
Referenced by misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_is_msn_valid(), misdn_cfg_update_ptp(), and misdn_show_config().
00689 { 00690 int gn = map[MISDN_CFG_GROUPNAME]; 00691 00692 return (port >= 1 && port <= max_ports && port_cfg[port][gn].str); 00693 }
static void misdn_cfg_lock | ( | void | ) | [inline, static] |
Definition at line 464 of file misdn_config.c.
References ast_mutex_lock().
Referenced by misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), misdn_cfg_is_msn_valid(), and misdn_cfg_update_ptp().
00465 { 00466 ast_mutex_lock(&config_mutex); 00467 }
void misdn_cfg_reload | ( | void | ) |
Definition at line 1092 of file misdn_config.c.
References misdn_cfg_init().
Referenced by reload_config().
01093 { 01094 misdn_cfg_init (0); 01095 }
static void misdn_cfg_unlock | ( | void | ) | [inline, static] |
Definition at line 469 of file misdn_config.c.
References ast_mutex_unlock().
Referenced by misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), and misdn_cfg_update_ptp().
00470 { 00471 ast_mutex_unlock(&config_mutex); 00472 }
void misdn_cfg_update_ptp | ( | void | ) |
Definition at line 1023 of file misdn_config.c.
References ast_log(), ast_strlen_zero(), BUFFERSIZE, errno, LOG_WARNING, max_ports, misdn_cfg_get(), misdn_cfg_is_port_valid(), misdn_cfg_lock(), misdn_cfg_unlock(), MISDN_GEN_MISDN_INIT, and ptp.
Referenced by load_module(), and reload_config().
01024 { 01025 #ifndef MISDN_1_2 01026 char misdn_init[BUFFERSIZE]; 01027 char line[BUFFERSIZE]; 01028 FILE *fp; 01029 char *tok, *p, *end; 01030 int port; 01031 01032 misdn_cfg_get(0, MISDN_GEN_MISDN_INIT, &misdn_init, sizeof(misdn_init)); 01033 01034 if (!ast_strlen_zero(misdn_init)) { 01035 fp = fopen(misdn_init, "r"); 01036 if (fp) { 01037 while(fgets(line, sizeof(line), fp)) { 01038 if (!strncmp(line, "nt_ptp", 6)) { 01039 for (tok = strtok_r(line,",=", &p); 01040 tok; 01041 tok = strtok_r(NULL,",=", &p)) { 01042 port = strtol(tok, &end, 10); 01043 if (end != tok && misdn_cfg_is_port_valid(port)) { 01044 misdn_cfg_lock(); 01045 ptp[port] = 1; 01046 misdn_cfg_unlock(); 01047 } 01048 } 01049 } 01050 } 01051 fclose(fp); 01052 } else { 01053 ast_log(LOG_WARNING,"Couldn't open %s: %s\n", misdn_init, strerror(errno)); 01054 } 01055 } 01056 #else 01057 int i; 01058 int proto; 01059 char filename[128]; 01060 FILE *fp; 01061 01062 for (i = 1; i <= max_ports; ++i) { 01063 snprintf(filename, sizeof(filename), "/sys/class/mISDN-stacks/st-%08x/protocol", i << 8); 01064 fp = fopen(filename, "r"); 01065 if (!fp) { 01066 ast_log(LOG_WARNING, "Could not open %s: %s\n", filename, strerror(errno)); 01067 continue; 01068 } 01069 if (fscanf(fp, "0x%08x", &proto) != 1) 01070 ast_log(LOG_WARNING, "Could not parse contents of %s!\n", filename); 01071 else 01072 ptp[i] = proto & 1<<5 ? 1 : 0; 01073 fclose(fp); 01074 } 01075 #endif 01076 }
struct ast_jb_conf* misdn_get_global_jbconf | ( | void | ) |
Definition at line 1179 of file misdn_config.c.
References global_jbconf.
Referenced by misdn_new().
01179 { 01180 return &global_jbconf; 01181 }
ast_mutex_t config_mutex [static] |
Definition at line 399 of file misdn_config.c.
Referenced by misdn_cfg_destroy(), and misdn_cfg_init().
struct ast_jb_conf default_jbconf [static] |
Global jitterbuffer configuration - by default, jb is disabled
Definition at line 60 of file misdn_config.c.
struct misdn_cfg_spec gen_spec[] [static] |
Definition at line 350 of file misdn_config.c.
Referenced by _build_general_config(), _enum_array_map(), _fill_defaults(), get_cfg_position(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_desc(), misdn_cfg_get_elem(), and misdn_cfg_get_name().
union misdn_cfg_pt* general_cfg [static] |
Definition at line 393 of file misdn_config.c.
Referenced by _build_general_config(), _fill_defaults(), _free_general_cfg(), misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), and misdn_cfg_init().
struct ast_jb_conf global_jbconf [static] |
Definition at line 68 of file misdn_config.c.
int* map [static] |
Definition at line 397 of file misdn_config.c.
Referenced by append_mapping(), build_mapping(), build_translators(), clear_config_maps(), config_command(), destroy_map(), dundi_lookup_local(), dundi_show_mappings(), find_engine(), find_transcoders(), mark_mappings(), misdn_cfg_destroy(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), misdn_cfg_is_port_valid(), and prune_mappings().
int max_ports [static] |
Definition at line 391 of file misdn_config.c.
union misdn_cfg_pt** port_cfg [static] |
Definition at line 389 of file misdn_config.c.
Referenced by _fill_defaults(), _free_port_cfg(), misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), misdn_cfg_is_msn_valid(), and misdn_cfg_is_port_valid().
struct misdn_cfg_spec port_spec[] [static] |
Definition at line 105 of file misdn_config.c.
Referenced by _build_port_config(), _enum_array_map(), _fill_defaults(), _free_port_cfg(), get_cfg_position(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_desc(), misdn_cfg_get_elem(), and misdn_cfg_get_name().
const char ports_description[] [static] |
Initial value:
"Define your ports, e.g. 1,2 (depends on mISDN-driver loading order)."
Definition at line 102 of file misdn_config.c.
int* ptp [static] |
Definition at line 395 of file misdn_config.c.
Referenced by _build_port_config(), misdn_cfg_destroy(), misdn_cfg_get_config_string(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_update_ptp(), and misdn_lib_init().