Skip to content
Snippets Groups Projects
Commit a9831e75 authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

perform global variable substitution before splitting extension and cidmatch...

perform global variable substitution before splitting extension and cidmatch when reading in dialplan (bug #4035)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 5c735f4c
No related branches found
No related tags found
No related merge requests found
...@@ -1662,7 +1662,8 @@ static int pbx_load_module(void) ...@@ -1662,7 +1662,8 @@ static int pbx_load_module(void)
ext = strsep(&stringp, ","); ext = strsep(&stringp, ",");
if (!ext) if (!ext)
ext=""; ext="";
cidmatch = strchr(ext, '/'); pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
cidmatch = strchr(realext, '/');
if (cidmatch) { if (cidmatch) {
*cidmatch = '\0'; *cidmatch = '\0';
cidmatch++; cidmatch++;
...@@ -1700,7 +1701,7 @@ static int pbx_load_module(void) ...@@ -1700,7 +1701,7 @@ static int pbx_load_module(void)
ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n"); ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
} else { } else {
if (sscanf(pri, "%i", &ipri) != 1) { if (sscanf(pri, "%i", &ipri) != 1) {
if ((ipri = ast_findlabel_extension2(NULL, con, ext, pri, cidmatch)) < 1) { if ((ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno); ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
ipri = 0; ipri = 0;
} }
...@@ -1733,7 +1734,6 @@ static int pbx_load_module(void) ...@@ -1733,7 +1734,6 @@ static int pbx_load_module(void)
if (!data) if (!data)
data=""; data="";
while(*appl && (*appl < 33)) appl++; while(*appl && (*appl < 33)) appl++;
pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
if (ipri) { if (ipri) {
if (plus) if (plus)
ipri += atoi(plus); ipri += atoi(plus);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment