mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-20 12:20:12 +00:00
Allow extension names, include context, and switches to use global variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
-- Allow extension names, include context, switch to use global vars.
|
||||||
|
-- Allow variables in extensions.conf to reference previously defined ones
|
||||||
-- Merge voicemail enhancements (app_voicemail2)
|
-- Merge voicemail enhancements (app_voicemail2)
|
||||||
-- Add multiple queueing strategies
|
-- Add multiple queueing strategies
|
||||||
-- Merge support for 'T'
|
-- Merge support for 'T'
|
||||||
|
@@ -1566,6 +1566,7 @@ static int pbx_load_module(void)
|
|||||||
if (!strcasecmp(v->name, "exten")) {
|
if (!strcasecmp(v->name, "exten")) {
|
||||||
char *stringp=NULL;
|
char *stringp=NULL;
|
||||||
int ipri = -2;
|
int ipri = -2;
|
||||||
|
char realext[256]="";
|
||||||
tc = strdup(v->value);
|
tc = strdup(v->value);
|
||||||
if(tc!=NULL){
|
if(tc!=NULL){
|
||||||
stringp=tc;
|
stringp=tc;
|
||||||
@@ -1614,20 +1615,24 @@ static int pbx_load_module(void)
|
|||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
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);
|
ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno);
|
||||||
}
|
}
|
||||||
free(tc);
|
free(tc);
|
||||||
} else fprintf(stderr,"Error strdup returned NULL in %s\n",__PRETTY_FUNCTION__);
|
} else fprintf(stderr,"Error strdup returned NULL in %s\n",__PRETTY_FUNCTION__);
|
||||||
} else if(!strcasecmp(v->name, "include")) {
|
} 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);
|
ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
|
||||||
} else if(!strcasecmp(v->name, "ignorepat")) {
|
} 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);
|
ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt);
|
||||||
} else if (!strcasecmp(v->name, "switch")) {
|
} else if (!strcasecmp(v->name, "switch")) {
|
||||||
char *stringp=NULL;
|
char *stringp=NULL;
|
||||||
tc = strdup(v->value);
|
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
|
||||||
|
tc = realvalue;
|
||||||
stringp=tc;
|
stringp=tc;
|
||||||
appl = strsep(&stringp, "/");
|
appl = strsep(&stringp, "/");
|
||||||
data = strsep(&stringp, "");
|
data = strsep(&stringp, "");
|
||||||
|
Reference in New Issue
Block a user