Mon Mar 19 11:30:50 2012

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 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 (const 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 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 434 of file misdn_config.c.

Referenced by _build_general_config(), and _build_port_config().

#define GEN_CFG   1

Definition at line 45 of file misdn_config.c.

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

#define NO_DEFAULT   "<>"

Definition at line 42 of file misdn_config.c.

Referenced by _fill_defaults(), and misdn_cfg_get_desc().

#define NONE   0

Definition at line 43 of file misdn_config.c.

Referenced by __sip_autodestruct(), cb_extensionstate(), handle_request_subscribe(), handle_response_notify(), show_channels_cb(), show_chanstats_cb(), sip_alloc(), sip_show_channel(), sip_show_history(), state_notify_build_xml(), and transmit_state_notify().

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

Definition at line 47 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 48 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 46 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 63 of file misdn_config.c.


Function Documentation

static void _build_general_config ( struct ast_variable v  )  [static]

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

00989 {
00990    int pos;
00991 
00992    for (; v; v = v->next) {
00993       if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
00994          continue;
00995       if (((pos = get_cfg_position(v->name, GEN_CFG)) < 0) ||
00996          (_parse(&general_cfg[pos], v->value, gen_spec[pos].type, gen_spec[pos].boolint_def) < 0))
00997          CLI_ERROR(v->name, v->value, "general");
00998    }
00999 }

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

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

01002 {
01003    int pos, i;
01004    union misdn_cfg_pt cfg_tmp[NUM_PORT_ELEMENTS];
01005    int cfg_for_ports[max_ports + 1];
01006 
01007    if (!v || !cat)
01008       return;
01009 
01010    memset(cfg_tmp, 0, sizeof(cfg_tmp));
01011    memset(cfg_for_ports, 0, sizeof(cfg_for_ports));
01012 
01013    if (!strcasecmp(cat, "default")) {
01014       cfg_for_ports[0] = 1;
01015    }
01016 
01017    if (((pos = get_cfg_position("name", PORT_CFG)) < 0) ||
01018       (_parse(&cfg_tmp[pos], cat, port_spec[pos].type, port_spec[pos].boolint_def) < 0)) {
01019       CLI_ERROR(v->name, v->value, cat);
01020       return;
01021    }
01022 
01023    for (; v; v = v->next) {
01024       if (!strcasecmp(v->name, "ports")) {
01025          char *token, *tmp = ast_strdupa(v->value);
01026          char ptpbuf[BUFFERSIZE] = "";
01027          int start, end;
01028          for (token = strsep(&tmp, ","); token; token = strsep(&tmp, ","), *ptpbuf = 0) {
01029             if (!*token)
01030                continue;
01031             if (sscanf(token, "%30d-%30d%511s", &start, &end, ptpbuf) >= 2) {
01032                for (; start <= end; start++) {
01033                   if (start <= max_ports && start > 0) {
01034                      cfg_for_ports[start] = 1;
01035                      ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0;
01036                   } else
01037                      CLI_ERROR(v->name, v->value, cat);
01038                }
01039             } else {
01040                if (sscanf(token, "%30d%511s", &start, ptpbuf)) {
01041                   if (start <= max_ports && start > 0) {
01042                      cfg_for_ports[start] = 1;
01043                      ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0;
01044                   } else
01045                      CLI_ERROR(v->name, v->value, cat);
01046                } else
01047                   CLI_ERROR(v->name, v->value, cat);
01048             }
01049          }
01050       } else {
01051          if (((pos = get_cfg_position(v->name, PORT_CFG)) < 0) ||
01052             (_parse(&cfg_tmp[pos], v->value, port_spec[pos].type, port_spec[pos].boolint_def) < 0))
01053             CLI_ERROR(v->name, v->value, cat);
01054       }
01055    }
01056 
01057    for (i = 0; i < (max_ports + 1); ++i) {
01058       if (i > 0 && cfg_for_ports[0]) {
01059          /* default category, will populate the port_cfg with additional port
01060          categories in subsequent calls to this function */
01061          memset(cfg_tmp, 0, sizeof(cfg_tmp));
01062       }
01063       if (cfg_for_ports[i]) {
01064          memcpy(port_cfg[i], cfg_tmp, sizeof(cfg_tmp));
01065       }
01066    }
01067 }

static int _enum_array_map ( void   )  [static]

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

00440 {
00441    int i, j, ok;
00442 
00443    for (i = MISDN_CFG_FIRST + 1; i < MISDN_CFG_LAST; ++i) {
00444       if (i == MISDN_CFG_PTP)
00445          continue;
00446       ok = 0;
00447       for (j = 0; j < NUM_PORT_ELEMENTS; ++j) {
00448          if (port_spec[j].elem == i) {
00449             map[i] = j;
00450             ok = 1;
00451             break;
00452          }
00453       }
00454       if (!ok) {
00455          ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (port section) has no corresponding element in the config struct!\n", i);
00456          return -1;
00457       }
00458    }
00459    for (i = MISDN_GEN_FIRST + 1; i < MISDN_GEN_LAST; ++i) {
00460       ok = 0;
00461       for (j = 0; j < NUM_GEN_ELEMENTS; ++j) {
00462          if (gen_spec[j].elem == i) {
00463             map[i] = j;
00464             ok = 1;
00465             break;
00466          }
00467       }
00468       if (!ok) {
00469          ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (general section) has no corresponding element in the config struct!\n", i);
00470          return -1;
00471       }
00472    }
00473    return 0;
00474 }

static void _fill_defaults ( void   )  [static]

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

01125 {
01126    int i;
01127 
01128    for (i = 0; i < NUM_PORT_ELEMENTS; ++i) {
01129       if (!port_cfg[0][i].any && strcasecmp(port_spec[i].def, NO_DEFAULT))
01130          _parse(&(port_cfg[0][i]), (char *)port_spec[i].def, port_spec[i].type, port_spec[i].boolint_def);
01131    }
01132    for (i = 0; i < NUM_GEN_ELEMENTS; ++i) {
01133       if (!general_cfg[i].any && strcasecmp(gen_spec[i].def, NO_DEFAULT))
01134          _parse(&(general_cfg[i]), (char *)gen_spec[i].def, gen_spec[i].type, gen_spec[i].boolint_def);
01135    }
01136 }

static void _free_general_cfg ( void   )  [static]

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

00550 {
00551    int i;
00552 
00553    for (i = 0; i < NUM_GEN_ELEMENTS; i++)
00554       if (general_cfg[i].any)
00555          ast_free(general_cfg[i].any);
00556 }

static void _free_msn_list ( struct msn_list iter  )  [static]

Definition at line 507 of file misdn_config.c.

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

Referenced by _free_port_cfg().

00508 {
00509    if (iter->next)
00510       _free_msn_list(iter->next);
00511    if (iter->msn)
00512       ast_free(iter->msn);
00513    ast_free(iter);
00514 }

static void _free_port_cfg ( void   )  [static]

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

00517 {
00518    int i, j;
00519    int gn = map[MISDN_CFG_GROUPNAME];
00520    union misdn_cfg_pt* free_list[max_ports + 2];
00521 
00522    memset(free_list, 0, sizeof(free_list));
00523    free_list[0] = port_cfg[0];
00524    for (i = 1; i <= max_ports; ++i) {
00525       if (port_cfg[i][gn].str) {
00526          /* we always have a groupname in the non-default case, so this is fine */
00527          for (j = 1; j <= max_ports; ++j) {
00528             if (free_list[j] && free_list[j][gn].str == port_cfg[i][gn].str)
00529                break;
00530             else if (!free_list[j]) {
00531                free_list[j] = port_cfg[i];
00532                break;
00533             }
00534          }
00535       }
00536    }
00537    for (j = 0; free_list[j]; ++j) {
00538       for (i = 0; i < NUM_PORT_ELEMENTS; ++i) {
00539          if (free_list[j][i].any) {
00540             if (port_spec[i].type == MISDN_CTYPE_MSNLIST)
00541                _free_msn_list(free_list[j][i].ml);
00542             else
00543                ast_free(free_list[j][i].any);
00544          }
00545       }
00546    }
00547 }

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

Definition at line 911 of file misdn_config.c.

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

00912 {
00913    int re = 0;
00914    int len, tmp;
00915    char *valtmp;
00916    char *tmp2 = ast_strdupa(value);
00917 
00918    switch (type) {
00919    case MISDN_CTYPE_STR:
00920       if (dest->str) {
00921          ast_free(dest->str);
00922       }
00923       if ((len = strlen(value))) {
00924          dest->str = ast_malloc((len + 1) * sizeof(char));
00925          strncpy(dest->str, value, len);
00926          dest->str[len] = 0;
00927       } else {
00928          dest->str = ast_malloc(sizeof(char));
00929          dest->str[0] = 0;
00930       }
00931       break;
00932    case MISDN_CTYPE_INT:
00933    {
00934       int res;
00935 
00936       if (strchr(value,'x')) {
00937          res = sscanf(value, "%30x", &tmp);
00938       } else {
00939          res = sscanf(value, "%30d", &tmp);
00940       }
00941       if (res) {
00942          if (!dest->num) {
00943             dest->num = ast_malloc(sizeof(int));
00944          }
00945          memcpy(dest->num, &tmp, sizeof(int));
00946       } else
00947          re = -1;
00948    }
00949       break;
00950    case MISDN_CTYPE_BOOL:
00951       if (!dest->num) {
00952          dest->num = ast_malloc(sizeof(int));
00953       }
00954       *(dest->num) = (ast_true(value) ? 1 : 0);
00955       break;
00956    case MISDN_CTYPE_BOOLINT:
00957       if (!dest->num) {
00958          dest->num = ast_malloc(sizeof(int));
00959       }
00960       if (sscanf(value, "%30d", &tmp)) {
00961          memcpy(dest->num, &tmp, sizeof(int));
00962       } else {
00963          *(dest->num) = (ast_true(value) ? boolint_def : 0);
00964       }
00965       break;
00966    case MISDN_CTYPE_MSNLIST:
00967       for (valtmp = strsep(&tmp2, ","); valtmp; valtmp = strsep(&tmp2, ",")) {
00968          if ((len = strlen(valtmp))) {
00969             struct msn_list *ml = ast_malloc(sizeof(*ml));
00970             ml->msn = ast_calloc(len+1, sizeof(char));
00971             strncpy(ml->msn, valtmp, len);
00972             ml->next = dest->ml;
00973             dest->ml = ml;
00974          }
00975       }
00976       break;
00977    case MISDN_CTYPE_ASTGROUP:
00978       if (!dest->grp) {
00979          dest->grp = ast_malloc(sizeof(ast_group_t));
00980       }
00981       *(dest->grp) = ast_get_group(value);
00982       break;
00983    }
00984 
00985    return re;
00986 }

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

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

00477 {
00478    int i;
00479 
00480    switch (type) {
00481    case PORT_CFG:
00482       for (i = 0; i < NUM_PORT_ELEMENTS; ++i) {
00483          if (!strcasecmp(name, port_spec[i].name))
00484             return i;
00485       }
00486       break;
00487    case GEN_CFG:
00488       for (i = 0; i < NUM_GEN_ELEMENTS; ++i) {
00489          if (!strcasecmp(name, gen_spec[i].name))
00490             return i;
00491       }
00492    }
00493 
00494    return -1;
00495 }

void misdn_cfg_destroy ( void   ) 

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

01144 {
01145    misdn_cfg_lock();
01146 
01147    _free_port_cfg();
01148    _free_general_cfg();
01149 
01150    ast_free(port_cfg);
01151    ast_free(general_cfg);
01152    ast_free(ptp);
01153    ast_free(map);
01154 
01155    misdn_cfg_unlock();
01156    ast_mutex_destroy(&config_mutex);
01157 }

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

Definition at line 558 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_add_number_prefix(), misdn_bridge(), misdn_call(), misdn_cfg_update_ptp(), misdn_check_l2l1(), misdn_get_connected_line(), misdn_new(), misdn_request(), misdn_set_opt_exec(), process_ast_dsp(), read_config(), reload_config(), update_config(), and update_ec_config().

00559 {
00560    int place;
00561 
00562    if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) {
00563       memset(buf, 0, bufsize);
00564       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Port number %d is not valid.\n", port);
00565       return;
00566    }
00567 
00568    misdn_cfg_lock();
00569    if (elem == MISDN_CFG_PTP) {
00570       if (!memcpy(buf, &ptp[port], (bufsize > ptp[port]) ? sizeof(ptp[port]) : bufsize))
00571          memset(buf, 0, bufsize);
00572    } else {
00573       if ((place = map[elem]) < 0) {
00574          memset(buf, 0, bufsize);
00575          ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Invalid element (%d) requested.\n", elem);
00576       } else {
00577          if (elem < MISDN_CFG_LAST) {
00578             switch (port_spec[place].type) {
00579             case MISDN_CTYPE_STR:
00580                if (port_cfg[port][place].str) {
00581                   ast_copy_string(buf, port_cfg[port][place].str, bufsize);
00582                } else if (port_cfg[0][place].str) {
00583                   ast_copy_string(buf, port_cfg[0][place].str, bufsize);
00584                } else
00585                   memset(buf, 0, bufsize);
00586                break;
00587             default:
00588                if (port_cfg[port][place].any)
00589                   memcpy(buf, port_cfg[port][place].any, bufsize);
00590                else if (port_cfg[0][place].any)
00591                   memcpy(buf, port_cfg[0][place].any, bufsize);
00592                else
00593                   memset(buf, 0, bufsize);
00594             }
00595          } else {
00596             switch (gen_spec[place].type) {
00597             case MISDN_CTYPE_STR:
00598                ast_copy_string(buf, S_OR(general_cfg[place].str, ""), bufsize);
00599                break;
00600             default:
00601                if (general_cfg[place].any)
00602                   memcpy(buf, general_cfg[place].any, bufsize);
00603                else
00604                   memset(buf, 0, bufsize);
00605             }
00606          }
00607       }
00608    }
00609    misdn_cfg_unlock();
00610 }

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

Definition at line 783 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, str, and type.

00784 {
00785    int place;
00786    char tempbuf[BUFFERSIZE] = "";
00787    struct msn_list *iter;
00788 
00789    if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) {
00790       *buf = 0;
00791       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Port number %d is not valid.\n", port);
00792       return;
00793    }
00794 
00795    place = map[elem];
00796 
00797    misdn_cfg_lock();
00798    if (elem == MISDN_CFG_PTP) {
00799       snprintf(buf, bufsize, " -> ptp: %s", ptp[port] ? "yes" : "no");
00800    }
00801    else if (elem > MISDN_CFG_FIRST && elem < MISDN_CFG_LAST) {
00802       switch (port_spec[place].type) {
00803       case MISDN_CTYPE_INT:
00804       case MISDN_CTYPE_BOOLINT:
00805          if (port_cfg[port][place].num)
00806             snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[port][place].num);
00807          else if (port_cfg[0][place].num)
00808             snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[0][place].num);
00809          else
00810             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00811          break;
00812       case MISDN_CTYPE_BOOL:
00813          if (port_cfg[port][place].num)
00814             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[port][place].num ? "yes" : "no");
00815          else if (port_cfg[0][place].num)
00816             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[0][place].num ? "yes" : "no");
00817          else
00818             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00819          break;
00820       case MISDN_CTYPE_ASTGROUP:
00821          if (port_cfg[port][place].grp)
00822             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name,
00823                    ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[port][place].grp));
00824          else if (port_cfg[0][place].grp)
00825             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name,
00826                    ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[0][place].grp));
00827          else
00828             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00829          break;
00830       case MISDN_CTYPE_MSNLIST:
00831          if (port_cfg[port][place].ml)
00832             iter = port_cfg[port][place].ml;
00833          else
00834             iter = port_cfg[0][place].ml;
00835          if (iter) {
00836             for (; iter; iter = iter->next) {
00837                strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1);
00838             }
00839             if (strlen(tempbuf) > 1) {
00840                tempbuf[strlen(tempbuf)-2] = 0;
00841             }
00842          }
00843          snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none");
00844          break;
00845       case MISDN_CTYPE_STR:
00846          if ( port_cfg[port][place].str) {
00847             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[port][place].str);
00848          } else if (port_cfg[0][place].str) {
00849             snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[0][place].str);
00850          } else {
00851             snprintf(buf, bufsize, " -> %s:", port_spec[place].name);
00852          }
00853          break;
00854       }
00855    } else if (elem > MISDN_GEN_FIRST && elem < MISDN_GEN_LAST) {
00856       switch (gen_spec[place].type) {
00857       case MISDN_CTYPE_INT:
00858       case MISDN_CTYPE_BOOLINT:
00859          if (general_cfg[place].num)
00860             snprintf(buf, bufsize, " -> %s: %d", gen_spec[place].name, *general_cfg[place].num);
00861          else
00862             snprintf(buf, bufsize, " -> %s:", gen_spec[place].name);
00863          break;
00864       case MISDN_CTYPE_BOOL:
00865          if (general_cfg[place].num)
00866             snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, *general_cfg[place].num ? "yes" : "no");
00867          else
00868             snprintf(buf, bufsize, " -> %s:", gen_spec[place].name);
00869          break;
00870       case MISDN_CTYPE_STR:
00871          if ( general_cfg[place].str) {
00872             snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, general_cfg[place].str);
00873          } else {
00874             snprintf(buf, bufsize, " -> %s:", gen_spec[place].name);
00875          }
00876          break;
00877       default:
00878          snprintf(buf, bufsize, " -> type of %s not handled yet", gen_spec[place].name);
00879          break;
00880       }
00881    } else {
00882       *buf = 0;
00883       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Invalid config element (%d) requested.\n", elem);
00884    }
00885    misdn_cfg_unlock();
00886 }

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

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

00660 {
00661    int place = map[elem];
00662    struct misdn_cfg_spec *spec = NULL;
00663 
00664    /* here comes a hack to replace the (not existing) "name" element with the "ports" element */
00665    if (elem == MISDN_CFG_GROUPNAME) {
00666       ast_copy_string(buf, ports_description, bufsize);
00667       if (buf_default && bufsize_default)
00668          memset(buf_default, 0, 1);
00669       return;
00670    }
00671 
00672    if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST))
00673       spec = (struct misdn_cfg_spec *)port_spec;
00674    else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST))
00675       spec = (struct misdn_cfg_spec *)gen_spec;
00676 
00677    if (!spec || !spec[place].desc)
00678       memset(buf, 0, 1);
00679    else {
00680       ast_copy_string(buf, spec[place].desc, bufsize);
00681       if (buf_default && bufsize) {
00682          if (!strcmp(spec[place].def, NO_DEFAULT))
00683             memset(buf_default, 0, 1);
00684          else
00685             ast_copy_string(buf_default, spec[place].def, bufsize_default);
00686       }
00687    }
00688 }

enum misdn_cfg_elements misdn_cfg_get_elem ( const char *  name  ) 

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

00613 {
00614    int pos;
00615 
00616    /* here comes a hack to replace the (not existing) "name" element with the "ports" element */
00617    if (!strcmp(name, "ports"))
00618       return MISDN_CFG_GROUPNAME;
00619    if (!strcmp(name, "name"))
00620       return MISDN_CFG_FIRST;
00621 
00622    pos = get_cfg_position(name, PORT_CFG);
00623    if (pos >= 0)
00624       return port_spec[pos].elem;
00625 
00626    pos = get_cfg_position(name, GEN_CFG);
00627    if (pos >= 0)
00628       return gen_spec[pos].elem;
00629 
00630    return MISDN_CFG_FIRST;
00631 }

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

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

00634 {
00635    struct misdn_cfg_spec *spec = NULL;
00636    int place = map[elem];
00637 
00638    /* the ptp hack */
00639    if (elem == MISDN_CFG_PTP) {
00640       memset(buf, 0, 1);
00641       return;
00642    }
00643 
00644    /* here comes a hack to replace the (not existing) "name" element with the "ports" element */
00645    if (elem == MISDN_CFG_GROUPNAME) {
00646       if (!snprintf(buf, bufsize, "ports"))
00647          memset(buf, 0, 1);
00648       return;
00649    }
00650 
00651    if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST))
00652       spec = (struct misdn_cfg_spec *)port_spec;
00653    else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST))
00654       spec = (struct misdn_cfg_spec *)gen_spec;
00655 
00656    ast_copy_string(buf, spec ? spec[place].name : "", bufsize);
00657 }

int misdn_cfg_get_next_port ( int  port  ) 

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

00889 {
00890    int p = -1;
00891    int gn = map[MISDN_CFG_GROUPNAME];
00892 
00893    misdn_cfg_lock();
00894    for (port++; port <= max_ports; port++) {
00895       if (port_cfg[port][gn].str) {
00896          p = port;
00897          break;
00898       }
00899    }
00900    misdn_cfg_unlock();
00901 
00902    return p;
00903 }

int misdn_cfg_get_next_port_spin ( int  port  ) 

Definition at line 905 of file misdn_config.c.

References misdn_cfg_get_next_port().

Referenced by misdn_request().

00906 {
00907    int p = misdn_cfg_get_next_port(port);
00908    return (p > 0) ? p : misdn_cfg_get_next_port(0);
00909 }

void misdn_cfg_get_ports_string ( char *  ports  ) 

Generate a comma separated list of all active ports.

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

00758 {
00759    char tmp[16];
00760    int l, i;
00761    int gn = map[MISDN_CFG_GROUPNAME];
00762 
00763    *ports = 0;
00764 
00765    misdn_cfg_lock();
00766    for (i = 1; i <= max_ports; i++) {
00767       if (port_cfg[i][gn].str) {
00768          if (ptp[i])
00769             sprintf(tmp, "%dptp,", i);
00770          else
00771             sprintf(tmp, "%d,", i);
00772          strcat(ports, tmp);
00773       }
00774    }
00775    misdn_cfg_unlock();
00776 
00777    if ((l = strlen(ports))) {
00778       /* Strip trailing ',' */
00779       ports[l-1] = 0;
00780    }
00781 }

int misdn_cfg_init ( int  this_max_ports,
int  reload 
)

Definition at line 1159 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_config_destroy(), ast_config_load2(), ast_log(), ast_mutex_init, ast_variable_browse(), config, CONFIG_FLAG_FILEUNCHANGED, config_flags, config_mutex, CONFIG_STATUS_FILEINVALID, 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().

01160 {
01161    char config[] = "misdn.conf";
01162    char *cat, *p;
01163    int i;
01164    struct ast_config *cfg;
01165    struct ast_variable *v;
01166    struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
01167 
01168    if (!(cfg = ast_config_load2(config, "chan_misdn", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) {
01169       ast_log(LOG_WARNING, "missing or invalid file: misdn.conf\n");
01170       return -1;
01171    } else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
01172       return 0;
01173 
01174    ast_mutex_init(&config_mutex);
01175 
01176    /* Copy the default jb config over global_jbconf */
01177    memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
01178 
01179    misdn_cfg_lock();
01180 
01181    if (this_max_ports) {
01182       /* this is the first run */
01183       max_ports = this_max_ports;
01184       map = ast_calloc(MISDN_GEN_LAST + 1, sizeof(int));
01185       if (_enum_array_map())
01186          return -1;
01187       p = ast_calloc(1, (max_ports + 1) * sizeof(union misdn_cfg_pt *)
01188                      + (max_ports + 1) * NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt));
01189       port_cfg = (union misdn_cfg_pt **)p;
01190       p += (max_ports + 1) * sizeof(union misdn_cfg_pt *);
01191       for (i = 0; i <= max_ports; ++i) {
01192          port_cfg[i] = (union misdn_cfg_pt *)p;
01193          p += NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt);
01194       }
01195       general_cfg = ast_calloc(1, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS);
01196       ptp = ast_calloc(max_ports + 1, sizeof(int));
01197    }
01198    else {
01199       /* misdn reload */
01200       _free_port_cfg();
01201       _free_general_cfg();
01202       memset(port_cfg[0], 0, NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt) * (max_ports + 1));
01203       memset(general_cfg, 0, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS);
01204       memset(ptp, 0, sizeof(int) * (max_ports + 1));
01205    }
01206 
01207    cat = ast_category_browse(cfg, NULL);
01208 
01209    while(cat) {
01210       v = ast_variable_browse(cfg, cat);
01211       if (!strcasecmp(cat, "general")) {
01212          _build_general_config(v);
01213       } else {
01214          _build_port_config(v, cat);
01215       }
01216       cat = ast_category_browse(cfg, cat);
01217    }
01218 
01219    _fill_defaults();
01220 
01221    misdn_cfg_unlock();
01222    ast_config_destroy(cfg);
01223 
01224    return 0;
01225 }

int misdn_cfg_is_group_method ( char *  group,
enum misdn_cfg_method  meth 
)

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

00723 {
00724    int i, re = 0;
00725    char *method ;
00726 
00727    misdn_cfg_lock();
00728 
00729    method = port_cfg[0][map[MISDN_CFG_METHOD]].str;
00730 
00731    for (i = 1; i <= max_ports; i++) {
00732       if (port_cfg[i] && port_cfg[i][map[MISDN_CFG_GROUPNAME]].str) {
00733          if (!strcasecmp(port_cfg[i][map[MISDN_CFG_GROUPNAME]].str, group))
00734             method = (port_cfg[i][map[MISDN_CFG_METHOD]].str ?
00735                     port_cfg[i][map[MISDN_CFG_METHOD]].str : port_cfg[0][map[MISDN_CFG_METHOD]].str);
00736       }
00737    }
00738 
00739    if (method) {
00740       switch (meth) {
00741       case METHOD_STANDARD:      re = !strcasecmp(method, "standard");
00742                            break;
00743       case METHOD_ROUND_ROBIN:   re = !strcasecmp(method, "round_robin");
00744                            break;
00745       case METHOD_STANDARD_DEC:  re = !strcasecmp(method, "standard_dec");
00746                            break;
00747       }
00748    }
00749    misdn_cfg_unlock();
00750 
00751    return re;
00752 }

int misdn_cfg_is_msn_valid ( int  port,
char *  msn 
)

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

00691 {
00692    int re = 0;
00693    struct msn_list *iter;
00694 
00695    if (!misdn_cfg_is_port_valid(port)) {
00696       ast_log(LOG_WARNING, "Invalid call to misdn_cfg_is_msn_valid! Port number %d is not valid.\n", port);
00697       return 0;
00698    }
00699 
00700    misdn_cfg_lock();
00701    if (port_cfg[port][map[MISDN_CFG_MSNS]].ml)
00702       iter = port_cfg[port][map[MISDN_CFG_MSNS]].ml;
00703    else
00704       iter = port_cfg[0][map[MISDN_CFG_MSNS]].ml;
00705    for (; iter; iter = iter->next)
00706       if (*(iter->msn) == '*' || ast_extension_match(iter->msn, msn)) {
00707          re = 1;
00708          break;
00709       }
00710    misdn_cfg_unlock();
00711 
00712    return re;
00713 }

int misdn_cfg_is_port_valid ( int  port  ) 

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

00716 {
00717    int gn = map[MISDN_CFG_GROUPNAME];
00718 
00719    return (port >= 1 && port <= max_ports && port_cfg[port][gn].str);
00720 }

static void misdn_cfg_lock ( void   )  [inline, static]

Definition at line 497 of file misdn_config.c.

References ast_mutex_lock, and config_mutex.

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().

00498 {
00499    ast_mutex_lock(&config_mutex);
00500 }

void misdn_cfg_reload ( void   ) 

Definition at line 1138 of file misdn_config.c.

References misdn_cfg_init().

Referenced by reload_config().

01139 {
01140    misdn_cfg_init(0, 1);
01141 }

static void misdn_cfg_unlock ( void   )  [inline, static]

Definition at line 502 of file misdn_config.c.

References ast_mutex_unlock, and config_mutex.

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().

00503 {
00504    ast_mutex_unlock(&config_mutex);
00505 }

void misdn_cfg_update_ptp ( void   ) 

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

01070 {
01071 #ifndef MISDN_1_2
01072    char misdn_init[BUFFERSIZE];
01073    char line[BUFFERSIZE];
01074    FILE *fp;
01075    char *tok, *p, *end;
01076    int port;
01077 
01078    misdn_cfg_get(0, MISDN_GEN_MISDN_INIT, &misdn_init, sizeof(misdn_init));
01079 
01080    if (!ast_strlen_zero(misdn_init)) {
01081       fp = fopen(misdn_init, "r");
01082       if (fp) {
01083          while(fgets(line, sizeof(line), fp)) {
01084             if (!strncmp(line, "nt_ptp", 6)) {
01085                for (tok = strtok_r(line,",=", &p);
01086                    tok;
01087                    tok = strtok_r(NULL,",=", &p)) {
01088                   port = strtol(tok, &end, 10);
01089                   if (end != tok && misdn_cfg_is_port_valid(port)) {
01090                      misdn_cfg_lock();
01091                      ptp[port] = 1;
01092                      misdn_cfg_unlock();
01093                   }
01094                }
01095             }
01096          }
01097          fclose(fp);
01098       } else {
01099          ast_log(LOG_WARNING,"Couldn't open %s: %s\n", misdn_init, strerror(errno));
01100       }
01101    }
01102 #else
01103    int i;
01104    int proto;
01105    char filename[128];
01106    FILE *fp;
01107 
01108    for (i = 1; i <= max_ports; ++i) {
01109       snprintf(filename, sizeof(filename), "/sys/class/mISDN-stacks/st-%08x/protocol", i << 8);
01110       fp = fopen(filename, "r");
01111       if (!fp) {
01112          ast_log(LOG_WARNING, "Could not open %s: %s\n", filename, strerror(errno));
01113          continue;
01114       }
01115       if (fscanf(fp, "0x%08x", &proto) != 1)
01116          ast_log(LOG_WARNING, "Could not parse contents of %s!\n", filename);
01117       else
01118          ptp[i] = proto & 1<<5 ? 1 : 0;
01119       fclose(fp);
01120    }
01121 #endif
01122 }

struct ast_jb_conf* misdn_get_global_jbconf ( void   ) 

Definition at line 1227 of file misdn_config.c.

References global_jbconf.

Referenced by misdn_new().

01227                                               {
01228    return &global_jbconf;
01229 }


Variable Documentation

ast_mutex_t config_mutex [static]

Definition at line 432 of file misdn_config.c.

Referenced by misdn_cfg_destroy(), misdn_cfg_init(), misdn_cfg_lock(), and misdn_cfg_unlock().

struct ast_jb_conf default_jbconf [static]

Global jitterbuffer configuration - by default, jb is disabled

Note:
Values shown here match the defaults shown in misdn.conf.sample

Definition at line 52 of file misdn_config.c.

struct misdn_cfg_spec gen_spec[] [static]

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

int* map [static]

Definition at line 430 of file misdn_config.c.

Referenced by append_mapping(), build_mapping(), build_translators(), clear_config_maps(), data_search_mapping_find(), 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 424 of file misdn_config.c.

union misdn_cfg_pt** port_cfg [static]

Definition at line 422 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 98 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 95 of file misdn_config.c.

int* ptp [static]

Definition at line 428 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 Mon Mar 19 11:30:50 2012 for Asterisk - The Open Source Telephony Project by  doxygen 1.4.7