diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-03 18:39:51 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-03 18:39:51 +0000 |
commit | 82dbc8ee247f2e825ef5988bec09deac010a5af1 (patch) | |
tree | 02615028e3d698494ffd3ebc63ef971dd0686c65 /pbx | |
parent | 26301ecf018c673a73952c754e85530ad14b39cf (diff) |
Allow extension names, include context, and switches to use global variables
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1256 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-x | pbx/pbx_config.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index eb73c5b29..fb1fe6fb2 100755 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -1566,6 +1566,7 @@ static int pbx_load_module(void) if (!strcasecmp(v->name, "exten")) { char *stringp=NULL; int ipri = -2; + char realext[256]=""; tc = strdup(v->value); if(tc!=NULL){ stringp=tc; @@ -1614,20 +1615,24 @@ static int pbx_load_module(void) if (!data) data=""; - if (ast_add_extension2(con, 0, ext, ipri, cidmatch, appl, strdup(data), FREE, registrar)) { + pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1); + if (ast_add_extension2(con, 0, realext, ipri, cidmatch, appl, strdup(data), FREE, registrar)) { ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno); } free(tc); } else fprintf(stderr,"Error strdup returned NULL in %s\n",__PRETTY_FUNCTION__); } else if(!strcasecmp(v->name, "include")) { - if (ast_context_add_include2(con, v->value, registrar)) + pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1); + if (ast_context_add_include2(con, realvalue, registrar)) ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt); } else if(!strcasecmp(v->name, "ignorepat")) { - if (ast_context_add_ignorepat2(con, v->value, registrar)) + pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1); + if (ast_context_add_ignorepat2(con, realvalue, registrar)) ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt); } else if (!strcasecmp(v->name, "switch")) { char *stringp=NULL; - tc = strdup(v->value); + pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1); + tc = realvalue; stringp=tc; appl = strsep(&stringp, "/"); data = strsep(&stringp, ""); |