Thu Jul 9 13:41:24 2009

Asterisk developer's documentation


misdn_config.c File Reference

chan_misdn configuration management More...

#include "asterisk.h"
#include "chan_misdn_config.h"
#include "asterisk/config.h"
#include "asterisk/channel.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, const char *value, enum misdn_cfg_type type, int boolint_def)
static int get_cfg_position (const 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 reload)
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_confmisdn_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_ptgeneral_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


Detailed Description

chan_misdn configuration management

Author:
Christian Richter <crich@beronet.com>

Definition in file misdn_config.c.


Define Documentation

#define AST_DESTROY_CFG   ast_config_destroy

Definition at line 43 of file misdn_config.c.

Referenced by misdn_cfg_init().

#define AST_LOAD_CFG   ast_config_load

Definition at line 42 of file misdn_config.c.

Referenced by misdn_cfg_init().

#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 395 of file misdn_config.c.

Referenced by _build_general_config(), and _build_port_config().

#define GEN_CFG   1

Definition at line 48 of file misdn_config.c.

Referenced by _build_general_config(), get_cfg_position(), and misdn_cfg_get_elem().

#define NO_DEFAULT   "<>"

Definition at line 45 of file misdn_config.c.

Referenced by _fill_defaults(), and misdn_cfg_get_desc().

#define NONE   0

Definition at line 46 of file misdn_config.c.

#define NUM_GEN_ELEMENTS   (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec))

Definition at line 50 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 51 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 49 of file misdn_config.c.

Referenced by _build_port_config(), get_cfg_position(), and misdn_cfg_get_elem().


Enumeration Type Documentation

enum misdn_cfg_type

Enumerator:
MISDN_CTYPE_STR 
MISDN_CTYPE_INT 
MISDN_CTYPE_BOOL 
MISDN_CTYPE_BOOLINT 
MISDN_CTYPE_MSNLIST 
MISDN_CTYPE_ASTGROUP 

Definition at line 64 of file misdn_config.c.


Function Documentation

static void _build_general_config ( struct ast_variable v  )  [static]

Definition at line 938 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().

00939 {
00940    int pos;
00941 
00942    for (; v; v = v->next) {
00943       if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
00944          continue;
00945       if (((pos = get_cfg_position(v->name, GEN_CFG)) < 0) || 
00946          (_parse(&general_cfg[pos], v->value, gen_spec[pos].type, gen_spec[pos].boolint_def) < 0))
00947          CLI_ERROR(v->name, v->value, "general");
00948    }
00949 }

static void _build_port_config ( struct ast_variable v,
char *  cat 
) [static]

Definition at line 951 of file misdn_config.c.

References _parse(), ast_strdupa, misdn_cfg_spec::boolint_def, BUFFERSIZE, CLI_ERROR, get_cfg_position(), max_ports, ast_variable::name, ast_variable::next, NUM_PORT_ELEMENTS, PORT_CFG, port_spec, ptp, strsep(), misdn_cfg_spec::type, type, and ast_variable::value.

Referenced by misdn_cfg_init().

00952 {
00953    int pos, i;
00954    union misdn_cfg_pt cfg_tmp[NUM_PORT_ELEMENTS];
00955    int cfg_for_ports[max_ports + 1];
00956 
00957    if (!v || !cat)
00958       return;
00959 
00960    memset(cfg_tmp, 0, sizeof(cfg_tmp));
00961    memset(cfg_for_ports, 0, sizeof(cfg_for_ports));
00962 
00963    if (!strcasecmp(cat, "default")) {
00964       cfg_for_ports[0] = 1;
00965    }
00966 
00967    if (((pos = get_cfg_position("name", PORT_CFG)) < 0) || 
00968       (_parse(&cfg_tmp[pos], cat, port_spec[pos].type, port_spec[pos].boolint_def) < 0)) {
00969       CLI_ERROR(v->name, v->value, cat);
00970       return;
00971    }
00972 
00973    for (; v; v = v->next) {
00974       if (!strcasecmp(v->name, "ports")) {
00975          char *token, *tmp = ast_strdupa(v->value);
00976          char ptpbuf[BUFFERSIZE] = "";
00977          int start, end;
00978          for (token = strsep(&tmp, ","); token; token = strsep(&tmp, ","), *ptpbuf = 0) { 
00979             if (!*token)
00980                continue;
00981             if (sscanf(token, "%d-%d%s", &start, &end, ptpbuf) >= 2) {
00982                for (; start <= end; start++) {
00983                   if (start <= max_ports && start > 0) {
00984                      cfg_for_ports[start] = 1;
00985                      ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0;
00986                   } else
00987                      CLI_ERROR(v->name, v->value, cat);
00988                }
00989             } else {
00990                if (sscanf(token, "%d%s", &start, ptpbuf)) {
00991                   if (start <= max_ports && start > 0) {
00992                      cfg_for_ports[start] = 1;
00993                      ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0;
00994                   } else
00995                      CLI_ERROR(v->name, v->value, cat);
00996                } else
00997                   CLI_ERROR(v->name, v->value, cat);
00998             }
00999          }
01000       } else {
01001          if (((pos = get_cfg_position(v->name, PORT_CFG)) < 0) || 
01002             (_parse(&cfg_tmp[pos], v->value, port_spec[pos].type, port_spec[pos].boolint_def) < 0))
01003             CLI_ERROR(v->name, v->value, cat);
01004       }
01005    }
01006 
01007    for (i = 0; i < (max_ports + 1); ++i) {
01008       if (cfg_for_ports[i]) {
01009          memcpy(port_cfg[i], cfg_tmp, sizeof(cfg_tmp));
01010       }
01011    }
01012 }

static int _enum_array_map ( void   )  [static]

Definition at line 400 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().

00401 {
00402    int i, j, ok;
00403 
00404    for (i = MISDN_CFG_FIRST + 1; i < MISDN_CFG_LAST; ++i) {
00405       if (i == MISDN_CFG_PTP)
00406          continue;
00407       ok = 0;
00408       for (j = 0; j < NUM_PORT_ELEMENTS; ++j) {
00409          if (port_spec[j].elem == i) {
00410             map[i] = j;
00411             ok = 1;
00412             break;
00413          }
00414       }
00415       if (!ok) {
00416          ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (port section) has no corresponding element in the config struct!\n", i);
00417          return -1;
00418       }
00419    }
00420    for (i = MISDN_GEN_FIRST + 1; i < MISDN_GEN_LAST; ++i) {
00421       ok = 0;
00422       for (j = 0; j < NUM_GEN_ELEMENTS; ++j) {
00423          if (gen_spec[j].elem == i) {
00424             map[i] = j;
00425             ok = 1;
00426             break;
00427          }
00428       }
00429       if (!ok) {
00430          ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (general section) has no corresponding element in the config struct!\n", i);
00431          return -1;
00432       }
00433    }
00434    return 0;
00435 }

static void _fill_defaults ( void   )  [static]

Definition at line 1069 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().

01070 {
01071    int i;
01072 
01073    for (i = 0; i < NUM_PORT_ELEMENTS; ++i) {
01074       if (!port_cfg[0][i].any && strcasecmp(port_spec[i].def, NO_DEFAULT))
01075          _parse(&(port_cfg[0][i]), (char *)port_spec[i].def, port_spec[i].type, port_spec[i].boolint_def);
01076    }
01077    for (i = 0; i < NUM_GEN_ELEMENTS; ++i) {
01078       if (!general_cfg[i].any && strcasecmp(gen_spec[i].def, NO_DEFAULT))
01079          _parse(&(general_cfg[i]), (char *)gen_spec[i].def, gen_spec[i].type, gen_spec[i].boolint_def);
01080    }
01081 }

static void _free_general_cfg ( void   )  [static]

Definition at line 510 of file misdn_config.c.

References misdn_cfg_pt::any, ast_free, general_cfg, and NUM_GEN_ELEMENTS.

Referenced by misdn_cfg_destroy(), and misdn_cfg_init().

00511 {
00512    int i;
00513 
00514    for (i = 0; i < NUM_GEN_ELEMENTS; i++) 
00515       if (general_cfg[i].any)
00516          ast_free(general_cfg[i].any);
00517 }

static void _free_msn_list ( struct msn_list iter  )  [static]

Definition at line 468 of file misdn_config.c.

References ast_free, msn_list::msn, and msn_list::next.

Referenced by _free_port_cfg().

00469 {
00470    if (iter->next)
00471       _free_msn_list(iter->next);
00472    if (iter->msn)
00473       ast_free(iter->msn);
00474    ast_free(iter);
00475 }

static void _free_port_cfg ( void   )  [static]

Definition at line 477 of file misdn_config.c.

References _free_msn_list(), misdn_cfg_pt::any, ast_free, MISDN_CFG_GROUPNAME, MISDN_CTYPE_MSNLIST, misdn_cfg_pt::ml, NUM_PORT_ELEMENTS, port_cfg, port_spec, str, and type.

Referenced by misdn_cfg_destroy(), and misdn_cfg_init().

00478 {
00479    int i, j;
00480    int gn = map[MISDN_CFG_GROUPNAME];
00481    union misdn_cfg_pt* free_list[max_ports + 2];
00482    
00483    memset(free_list, 0, sizeof(free_list));
00484    free_list[0] = port_cfg[0];
00485    for (i = 1; i <= max_ports; ++i) {
00486       if (port_cfg[i][gn].str) {
00487          /* we always have a groupname in the non-default case, so this is fine */
00488          for (j = 1; j <= max_ports; ++j) {
00489             if (free_list[j] && free_list[j][gn].str == port_cfg[i][gn].str)
00490                break;
00491             else if (!free_list[j]) {
00492                free_list[j] = port_cfg[i];
00493                break;
00494             }
00495          }
00496       }
00497    }
00498    for (j = 0; free_list[j]; ++j) {
00499       for (i = 0; i < NUM_PORT_ELEMENTS; ++i) {
00500          if (free_list[j][i].any) {
00501             if (port_spec[i].type == MISDN_CTYPE_MSNLIST)
00502                _free_msn_list(free_list[j][i].ml);
00503             else
00504                ast_free(free_list[j][i].any);
00505          }
00506       }
00507    }
00508 }

static int _parse ( union misdn_cfg_pt dest,
const char *  value,
enum misdn_cfg_type  type,
int  boolint_def 
) [static]

Definition at line 872 of file misdn_config.c.

References ast_calloc, ast_get_group(), ast_malloc, ast_strdupa, ast_true(), misdn_cfg_pt::grp, len(), MISDN_CTYPE_ASTGROUP, MISDN_CTYPE_BOOL, MISDN_CTYPE_BOOLINT, MISDN_CTYPE_INT, MISDN_CTYPE_MSNLIST, MISDN_CTYPE_STR, misdn_cfg_pt::ml, misdn_cfg_pt::num, misdn_cfg_pt::str, and strsep().

Referenced by _build_general_config(), _build_port_config(), and _fill_defaults().

00873 {
00874    int re = 0;
00875    int len, tmp;
00876    char *valtmp;
00877    char *tmp2 = ast_strdupa(value);
00878 
00879    switch (type) {
00880    case MISDN_CTYPE_STR:
00881       if ((len = strlen(value))) {
00882          dest->str = ast_malloc((len + 1) * sizeof(char));
00883          strncpy(dest->str, value, len);
00884          dest->str[len] = 0;
00885       } else {
00886          dest->str = ast_malloc(sizeof(char));
00887          dest->str[0] = 0;
00888       }
00889       break;
00890    case MISDN_CTYPE_INT:
00891    {
00892       int res;
00893 
00894       if (strchr(value,'x')) {
00895          res = sscanf(value, "%x", &tmp);
00896       } else {
00897          res = sscanf(value, "%d", &tmp);
00898       }
00899       if (res) {
00900          dest->num = ast_malloc(sizeof(int));
00901          memcpy(dest->num, &tmp, sizeof(int));
00902       } else
00903          re = -1;
00904    }
00905       break;
00906    case MISDN_CTYPE_BOOL:
00907       dest->num = ast_malloc(sizeof(int));
00908       *(dest->num) = (ast_true(value) ? 1 : 0);
00909       break;
00910    case MISDN_CTYPE_BOOLINT:
00911       dest->num = ast_malloc(sizeof(int));
00912       if (sscanf(value, "%d", &tmp)) {
00913          memcpy(dest->num, &tmp, sizeof(int));
00914       } else {
00915          *(dest->num) = (ast_true(value) ? boolint_def : 0);
00916       }
00917       break;
00918    case MISDN_CTYPE_MSNLIST:
00919       for (valtmp = strsep(&tmp2, ","); valtmp; valtmp = strsep(&tmp2, ",")) {
00920          if ((len = strlen(valtmp))) {
00921             struct msn_list *ml = ast_malloc(sizeof(*ml));
00922             ml->msn = ast_calloc(len+1, sizeof(char));
00923             strncpy(ml->msn, valtmp, len);
00924             ml->next = dest->ml;
00925             dest->ml = ml;
00926          }
00927       }
00928       break;
00929    case MISDN_CTYPE_ASTGROUP:
00930       dest->grp = ast_malloc(sizeof(ast_group_t));
00931       *(dest->grp) = ast_get_group(value);
00932       break;
00933    }
00934 
00935    return re;
00936 }

static int get_cfg_position ( const char *  name,
int  type 
) [static]

Definition at line 437 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().

00438 {
00439    int i;
00440 
00441    switch (type) {
00442    case PORT_CFG:
00443       for (i = 0; i < NUM_PORT_ELEMENTS; ++i) {
00444          if (!strcasecmp(name, port_spec[i].name))
00445             return i;
00446       }
00447       break;
00448    case GEN_CFG:
00449       for (i = 0; i < NUM_GEN_ELEMENTS; ++i) {
00450          if (!strcasecmp(name, gen_spec[i].name))
00451             return i;
00452       }
00453    }
00454 
00455    return -1;
00456 }

void misdn_cfg_destroy ( void   ) 

Definition at line 1088 of file misdn_config.c.

References _free_general_cfg(), _free_port_cfg(), ast_free, ast_mutex_destroy(), config_mutex, general_cfg, map, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, and ptp.

Referenced by unload_module().

01089 {
01090    misdn_cfg_lock();
01091 
01092    _free_port_cfg();
01093    _free_general_cfg();
01094 
01095    ast_free(port_cfg);
01096    ast_free(general_cfg);
01097    ast_free(ptp);
01098    ast_free(map);
01099 
01100    misdn_cfg_unlock();
01101    ast_mutex_destroy(&config_mutex);
01102 }

void misdn_cfg_get ( int  port,
enum misdn_cfg_elements  elem,
void *  buf,
int  bufsize 
)

Definition at line 519 of file misdn_config.c.

References misdn_cfg_pt::any, ast_copy_string(), 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, S_OR, 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().

00520 {
00521    int place;
00522 
00523    if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) {
00524       memset(buf, 0, bufsize);
00525       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Port number %d is not valid.\n", port);
00526       return;
00527    }
00528 
00529    misdn_cfg_lock();
00530    if (elem == MISDN_CFG_PTP) {
00531       if (!memcpy(buf, &ptp[port], (bufsize > ptp[port]) ? sizeof(ptp[port]) : bufsize))
00532          memset(buf, 0, bufsize);
00533    } else {
00534       if ((place = map[elem]) < 0) {
00535          memset(buf, 0, bufsize);
00536          ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Invalid element (%d) requested.\n", elem);
00537       } else {
00538          if (elem < MISDN_CFG_LAST) {
00539             switch (port_spec[place].type) {
00540             case MISDN_CTYPE_STR:
00541                if (port_cfg[port][place].str) {
00542                   ast_copy_string(buf, port_cfg[port][place].str, bufsize);
00543                } else if (port_cfg[0][place].str) {
00544                   ast_copy_string(buf, port_cfg[0][place].str, bufsize);
00545                } else
00546                   memset(buf, 0, bufsize);
00547                break;
00548             default:
00549                if (port_cfg[port][place].any)
00550                   memcpy(buf, port_cfg[port][place].any, bufsize);
00551                else if (port_cfg[0][place].any)
00552                   memcpy(buf, port_cfg[0][place].any, bufsize);
00553                else
00554                   memset(buf, 0, bufsize);
00555             }
00556          } else {
00557             switch (gen_spec[place].type) {
00558             case MISDN_CTYPE_STR:
00559                ast_copy_string(buf, S_OR(general_cfg[place].str, ""), bufsize);
00560                break;
00561             default:
00562                if (general_cfg[place].any)
00563                   memcpy(buf, general_cfg[place].any, bufsize);
00564                else
00565                   memset(buf, 0, bufsize);
00566             }
00567          }
00568       }
00569    }
00570    misdn_cfg_unlock();
00571 }

void misdn_cfg_get_config_string ( int  port,
enum misdn_cfg_elements  elem,
char *  buf,
int  bufsize 
)

Definition at line 744 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, num, port_cfg, port_spec, ptp, str, and type.

00745 {
00746    int place;
00747    char tempbuf[BUFFERSIZE] = "";
00748    struct msn_list *iter;
00749 
00750    if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) {
00751       *buf = 0;
00752       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Port number %d is not valid.\n", port);
00753       return;
00754    }
00755 
00756    place = map[elem];
00757 
00758    misdn_cfg_lock();
00759    if (elem == MISDN_CFG_PTP) {
00760       snprintf(buf, bufsize, " -> ptp: %s", ptp[port] ? "yes" : "no");
00761    }
00762    else if (elem > MISDN_CFG_FIRST && elem < MISDN_CFG_LAST) {
00763       switch (port_spec[place].type) {
00764       case MISDN_CTYPE_INT:
00765       case MISDN_CTYPE_BOOLINT:
00766          if (port_cfg[port][place].num)
00767             snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[port][place].num);
00768          else if (port_cfg[0][place].num)
00769             snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[0][place].num);
00770          else
00771             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00772          break;
00773       case MISDN_CTYPE_BOOL:
00774          if (port_cfg[port][place].num)
00775             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[port][place].num ? "yes" : "no");
00776          else if (port_cfg[0][place].num)
00777             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[0][place].num ? "yes" : "no");
00778          else
00779             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00780          break;
00781       case MISDN_CTYPE_ASTGROUP:
00782          if (port_cfg[port][place].grp)
00783             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, 
00784                    ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[port][place].grp));
00785          else if (port_cfg[0][place].grp)
00786             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, 
00787                    ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[0][place].grp));
00788          else
00789             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00790          break;
00791       case MISDN_CTYPE_MSNLIST:
00792          if (port_cfg[port][place].ml)
00793             iter = port_cfg[port][place].ml;
00794          else
00795             iter = port_cfg[0][place].ml;
00796          if (iter) {
00797             for (; iter; iter = iter->next) {
00798                strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1);
00799             }
00800             if (strlen(tempbuf) > 1) {
00801                tempbuf[strlen(tempbuf)-2] = 0;
00802             }
00803          }
00804          snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none");
00805          break;
00806       case MISDN_CTYPE_STR:
00807          if ( port_cfg[port][place].str) {
00808             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[port][place].str);
00809          } else if (port_cfg[0][place].str) {
00810             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[0][place].str);
00811          } else {
00812             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00813          }
00814          break;
00815       }
00816    } else if (elem > MISDN_GEN_FIRST && elem < MISDN_GEN_LAST) {
00817       switch (gen_spec[place].type) {
00818       case MISDN_CTYPE_INT:
00819       case MISDN_CTYPE_BOOLINT:
00820          if (general_cfg[place].num)
00821             snprintf(buf, bufsize, " -> %s: %d", gen_spec[place].name, *general_cfg[place].num);
00822          else
00823             snprintf(buf, bufsize, " -> %s:", gen_spec[place].name);
00824          break;
00825       case MISDN_CTYPE_BOOL:
00826          if (general_cfg[place].num)
00827             snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, *general_cfg[place].num ? "yes" : "no");
00828          else
00829             snprintf(buf, bufsize, " -> %s:", gen_spec[place].name);
00830          break;
00831       case MISDN_CTYPE_STR:
00832          if ( general_cfg[place].str) {
00833             snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, general_cfg[place].str);
00834          } else {
00835             snprintf(buf, bufsize, " -> %s:", gen_spec[place].name);
00836          }
00837          break;
00838       default:
00839          snprintf(buf, bufsize, " -> type of %s not handled yet", gen_spec[place].name);
00840          break;
00841       }
00842    } else {
00843       *buf = 0;
00844       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Invalid config element (%d) requested.\n", elem);
00845    }
00846    misdn_cfg_unlock();
00847 }

void misdn_cfg_get_desc ( enum misdn_cfg_elements  elem,
void *  buf,
int  bufsize,
void *  buf_default,
int  bufsize_default 
)

Definition at line 620 of file misdn_config.c.

References ast_copy_string(), 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().

00621 {
00622    int place = map[elem];
00623    struct misdn_cfg_spec *spec = NULL;
00624 
00625    /* here comes a hack to replace the (not existing) "name" element with the "ports" element */
00626    if (elem == MISDN_CFG_GROUPNAME) {
00627       ast_copy_string(buf, ports_description, bufsize);
00628       if (buf_default && bufsize_default)
00629          memset(buf_default, 0, 1);
00630       return;
00631    }
00632 
00633    if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST))
00634       spec = (struct misdn_cfg_spec *)port_spec;
00635    else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST))
00636       spec = (struct misdn_cfg_spec *)gen_spec;
00637       
00638    if (!spec || !spec[place].desc)
00639       memset(buf, 0, 1);
00640    else {
00641       ast_copy_string(buf, spec[place].desc, bufsize);
00642       if (buf_default && bufsize) {
00643          if (!strcmp(spec[place].def, NO_DEFAULT))
00644             memset(buf_default, 0, 1);
00645          else
00646             ast_copy_string(buf_default, spec[place].def, bufsize_default);
00647       }
00648    }
00649 }

enum misdn_cfg_elements misdn_cfg_get_elem ( char *  name  ) 

Definition at line 573 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 handle_cli_misdn_show_config().

00574 {
00575    int pos;
00576 
00577    /* here comes a hack to replace the (not existing) "name" element with the "ports" element */
00578    if (!strcmp(name, "ports"))
00579       return MISDN_CFG_GROUPNAME;
00580    if (!strcmp(name, "name"))
00581       return MISDN_CFG_FIRST;
00582 
00583    pos = get_cfg_position(name, PORT_CFG);
00584    if (pos >= 0)
00585       return port_spec[pos].elem;
00586    
00587    pos = get_cfg_position(name, GEN_CFG);
00588    if (pos >= 0)
00589       return gen_spec[pos].elem;
00590    
00591    return MISDN_CFG_FIRST;
00592 }

void misdn_cfg_get_name ( enum misdn_cfg_elements  elem,
void *  buf,
int  bufsize 
)

Definition at line 594 of file misdn_config.c.

References ast_copy_string(), 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().

00595 {
00596    struct misdn_cfg_spec *spec = NULL;
00597    int place = map[elem];
00598 
00599    /* the ptp hack */
00600    if (elem == MISDN_CFG_PTP) {
00601       memset(buf, 0, 1);
00602       return;
00603    }
00604    
00605    /* here comes a hack to replace the (not existing) "name" element with the "ports" element */
00606    if (elem == MISDN_CFG_GROUPNAME) {
00607       if (!snprintf(buf, bufsize, "ports"))
00608          memset(buf, 0, 1);
00609       return;
00610    }
00611 
00612    if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST))
00613       spec = (struct misdn_cfg_spec *)port_spec;
00614    else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST))
00615       spec = (struct misdn_cfg_spec *)gen_spec;
00616 
00617    ast_copy_string(buf, spec ? spec[place].name : "", bufsize);
00618 }

int misdn_cfg_get_next_port ( int  port  ) 

Definition at line 849 of file misdn_config.c.

References map, max_ports, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, and str.

Referenced by complete_show_config(), handle_cli_misdn_show_ports_stats(), handle_cli_misdn_show_stacks(), load_module(), misdn_cfg_get_next_port_spin(), misdn_check_l2l1(), misdn_new(), misdn_request(), and update_name().

00850 {
00851    int p = -1;
00852    int gn = map[MISDN_CFG_GROUPNAME];
00853    
00854    misdn_cfg_lock();
00855    for (port++; port <= max_ports; port++) {
00856       if (port_cfg[port][gn].str) {
00857          p = port;
00858          break;
00859       }
00860    }
00861    misdn_cfg_unlock();
00862 
00863    return p;
00864 }

int misdn_cfg_get_next_port_spin ( int  port  ) 

Definition at line 866 of file misdn_config.c.

References misdn_cfg_get_next_port().

Referenced by misdn_request().

00867 {
00868    int p = misdn_cfg_get_next_port(port);
00869    return (p > 0) ? p : misdn_cfg_get_next_port(0);
00870 }

void misdn_cfg_get_ports_string ( char *  ports  ) 

Generate a comma separated list of all active ports.

Definition at line 718 of file misdn_config.c.

References map, max_ports, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, ptp, and str.

Referenced by load_module().

00719 {
00720    char tmp[16];
00721    int l, i;
00722    int gn = map[MISDN_CFG_GROUPNAME];
00723 
00724    *ports = 0;
00725 
00726    misdn_cfg_lock();
00727    for (i = 1; i <= max_ports; i++) {
00728       if (port_cfg[i][gn].str) {
00729          if (ptp[i])
00730             sprintf(tmp, "%dptp,", i);
00731          else
00732             sprintf(tmp, "%d,", i);
00733          strcat(ports, tmp);
00734       }
00735    }
00736    misdn_cfg_unlock();
00737 
00738    if ((l = strlen(ports))) {
00739       /* Strip trailing ',' */
00740       ports[l-1] = 0;
00741    }
00742 }

int misdn_cfg_init ( int  this_max_ports,
int  reload 
)

Definition at line 1104 of file misdn_config.c.

References _build_general_config(), _build_port_config(), _enum_array_map(), _fill_defaults(), _free_general_cfg(), _free_port_cfg(), ast_calloc, ast_category_browse(), AST_DESTROY_CFG, AST_LOAD_CFG, ast_log(), ast_mutex_init(), ast_variable_browse(), config, CONFIG_FLAG_FILEUNCHANGED, config_mutex, CONFIG_STATUS_FILEUNCHANGED, 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().

01105 {
01106    char config[] = "misdn.conf";
01107    char *cat, *p;
01108    int i;
01109    struct ast_config *cfg;
01110    struct ast_variable *v;
01111    struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
01112 
01113    if (!(cfg = AST_LOAD_CFG(config, config_flags))) {
01114       ast_log(LOG_WARNING, "missing file: misdn.conf\n");
01115       return -1;
01116    } else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
01117       return 0;
01118 
01119    ast_mutex_init(&config_mutex);
01120 
01121    /* Copy the default jb config over global_jbconf */
01122    memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
01123 
01124    misdn_cfg_lock();
01125 
01126    if (this_max_ports) {
01127       /* this is the first run */
01128       max_ports = this_max_ports;
01129       map = ast_calloc(MISDN_GEN_LAST + 1, sizeof(int));
01130       if (_enum_array_map())
01131          return -1;
01132       p = ast_calloc(1, (max_ports + 1) * sizeof(union misdn_cfg_pt *)
01133                      + (max_ports + 1) * NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt));
01134       port_cfg = (union misdn_cfg_pt **)p;
01135       p += (max_ports + 1) * sizeof(union misdn_cfg_pt *);
01136       for (i = 0; i <= max_ports; ++i) {
01137          port_cfg[i] = (union misdn_cfg_pt *)p;
01138          p += NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt);
01139       }
01140       general_cfg = ast_calloc(1, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS);
01141       ptp = ast_calloc(max_ports + 1, sizeof(int));
01142    }
01143    else {
01144       /* misdn reload */
01145       _free_port_cfg();
01146       _free_general_cfg();
01147       memset(port_cfg[0], 0, NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt) * (max_ports + 1));
01148       memset(general_cfg, 0, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS);
01149       memset(ptp, 0, sizeof(int) * (max_ports + 1));
01150    }
01151 
01152    cat = ast_category_browse(cfg, NULL);
01153 
01154    while(cat) {
01155       v = ast_variable_browse(cfg, cat);
01156       if (!strcasecmp(cat, "general")) {
01157          _build_general_config(v);
01158       } else {
01159          _build_port_config(v, cat);
01160       }
01161       cat = ast_category_browse(cfg, cat);
01162    }
01163 
01164    _fill_defaults();
01165 
01166    misdn_cfg_unlock();
01167    AST_DESTROY_CFG(cfg);
01168 
01169    return 0;
01170 }

int misdn_cfg_is_group_method ( char *  group,
enum misdn_cfg_method  meth 
)

Definition at line 683 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, misdn_cfg_pt::str, and str.

Referenced by misdn_request().

00684 {
00685    int i, re = 0;
00686    char *method ;
00687 
00688    misdn_cfg_lock();
00689 
00690    method = port_cfg[0][map[MISDN_CFG_METHOD]].str;
00691 
00692    for (i = 1; i <= max_ports; i++) {
00693       if (port_cfg[i] && port_cfg[i][map[MISDN_CFG_GROUPNAME]].str) {
00694          if (!strcasecmp(port_cfg[i][map[MISDN_CFG_GROUPNAME]].str, group))
00695             method = (port_cfg[i][map[MISDN_CFG_METHOD]].str ? 
00696                     port_cfg[i][map[MISDN_CFG_METHOD]].str : port_cfg[0][map[MISDN_CFG_METHOD]].str);
00697       }
00698    }
00699 
00700    if (method) {
00701       switch (meth) {
00702       case METHOD_STANDARD:      re = !strcasecmp(method, "standard");
00703                            break;
00704       case METHOD_ROUND_ROBIN:   re = !strcasecmp(method, "round_robin");
00705                            break;
00706       case METHOD_STANDARD_DEC:  re = !strcasecmp(method, "standard_dec");
00707                            break;
00708       }
00709    }
00710    misdn_cfg_unlock();
00711 
00712    return re;
00713 }

int misdn_cfg_is_msn_valid ( int  port,
char *  msn 
)

Definition at line 651 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().

00652 {
00653    int re = 0;
00654    struct msn_list *iter;
00655 
00656    if (!misdn_cfg_is_port_valid(port)) {
00657       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_is_msn_valid! Port number %d is not valid.\n", port);
00658       return 0;
00659    }
00660 
00661    misdn_cfg_lock();
00662    if (port_cfg[port][map[MISDN_CFG_MSNS]].ml)
00663       iter = port_cfg[port][map[MISDN_CFG_MSNS]].ml;
00664    else
00665       iter = port_cfg[0][map[MISDN_CFG_MSNS]].ml;
00666    for (; iter; iter = iter->next) 
00667       if (*(iter->msn) == '*' || ast_extension_match(iter->msn, msn)) {
00668          re = 1;
00669          break;
00670       }
00671    misdn_cfg_unlock();
00672 
00673    return re;
00674 }

int misdn_cfg_is_port_valid ( int  port  ) 

Definition at line 676 of file misdn_config.c.

References map, max_ports, MISDN_CFG_GROUPNAME, port_cfg, and str.

Referenced by misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_is_msn_valid(), and misdn_cfg_update_ptp().

00677 {
00678    int gn = map[MISDN_CFG_GROUPNAME];
00679 
00680    return (port >= 1 && port <= max_ports && port_cfg[port][gn].str);
00681 }

static void misdn_cfg_lock ( void   )  [inline, static]

Definition at line 458 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().

00459 {
00460    ast_mutex_lock(&config_mutex);
00461 }

void misdn_cfg_reload ( void   ) 

Definition at line 1083 of file misdn_config.c.

References misdn_cfg_init().

Referenced by reload_config().

01084 {
01085    misdn_cfg_init(0, 1);
01086 }

static void misdn_cfg_unlock ( void   )  [inline, static]

Definition at line 463 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().

00464 {
00465    ast_mutex_unlock(&config_mutex);
00466 }

void misdn_cfg_update_ptp ( void   ) 

Definition at line 1014 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().

01015 {
01016 #ifndef MISDN_1_2
01017    char misdn_init[BUFFERSIZE];
01018    char line[BUFFERSIZE];
01019    FILE *fp;
01020    char *tok, *p, *end;
01021    int port;
01022 
01023    misdn_cfg_get(0, MISDN_GEN_MISDN_INIT, &misdn_init, sizeof(misdn_init));
01024 
01025    if (!ast_strlen_zero(misdn_init)) {
01026       fp = fopen(misdn_init, "r");
01027       if (fp) {
01028          while(fgets(line, sizeof(line), fp)) {
01029             if (!strncmp(line, "nt_ptp", 6)) {
01030                for (tok = strtok_r(line,",=", &p);
01031                    tok;
01032                    tok = strtok_r(NULL,",=", &p)) {
01033                   port = strtol(tok, &end, 10);
01034                   if (end != tok && misdn_cfg_is_port_valid(port)) {
01035                      misdn_cfg_lock();
01036                      ptp[port] = 1;
01037                      misdn_cfg_unlock();
01038                   }
01039                }
01040             }
01041          }
01042          fclose(fp);
01043       } else {
01044          ast_log(LOG_WARNING,"Couldn't open %s: %s\n", misdn_init, strerror(errno));
01045       }
01046    }
01047 #else
01048    int i;
01049    int proto;
01050    char filename[128];
01051    FILE *fp;
01052 
01053    for (i = 1; i <= max_ports; ++i) {
01054       snprintf(filename, sizeof(filename), "/sys/class/mISDN-stacks/st-%08x/protocol", i << 8);
01055       fp = fopen(filename, "r");
01056       if (!fp) {
01057          ast_log(LOG_WARNING, "Could not open %s: %s\n", filename, strerror(errno));
01058          continue;
01059       }
01060       if (fscanf(fp, "0x%08x", &proto) != 1)
01061          ast_log(LOG_WARNING, "Could not parse contents of %s!\n", filename);
01062       else
01063          ptp[i] = proto & 1<<5 ? 1 : 0;
01064       fclose(fp);
01065    }
01066 #endif
01067 }

struct ast_jb_conf* misdn_get_global_jbconf ( void   ) 

Definition at line 1172 of file misdn_config.c.

References global_jbconf.

Referenced by misdn_new().

01172                                               {
01173    return &global_jbconf;
01174 }


Variable Documentation

ast_mutex_t config_mutex [static]

Definition at line 393 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 54 of file misdn_config.c.

struct misdn_cfg_spec gen_spec[] [static]

Definition at line 344 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 387 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 62 of file misdn_config.c.

int* map [static]

Definition at line 391 of file misdn_config.c.

Referenced by append_mapping(), build_mapping(), build_translators(), clear_config_maps(), destroy_map(), dundi_lookup_local(), dundi_show_mappings(), find_engine(), find_transcoders(), get_mapping_weight(), handle_cli_core_show_config_mappings(), last_message_index(), 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 385 of file misdn_config.c.

union misdn_cfg_pt** port_cfg [static]

Definition at line 383 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 99 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 96 of file misdn_config.c.

int* ptp [static]

Definition at line 389 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().


Generated on Thu Jul 9 13:41:24 2009 for Asterisk - the Open Source PBX by  doxygen 1.4.7