Parse global variables or expressions in hint extensions
Parse global variables or expressions in hint extensions. Like: exten => 400,hint,DAHDI/i2/${GLOBAL(var)} (closes issue #16166) Reported by: rmudgett Tested by: mnick, rmudgett git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
74c5417696
commit
89b02b583a
|
@ -1496,7 +1496,21 @@ process_extension:
|
||||||
/* No arguments */
|
/* No arguments */
|
||||||
data = "";
|
data = "";
|
||||||
} else {
|
} else {
|
||||||
|
char *orig_appl = ast_strdup(appl);
|
||||||
|
|
||||||
|
if (!orig_appl)
|
||||||
|
return -1;
|
||||||
|
|
||||||
appl = strsep(&stringp, "(");
|
appl = strsep(&stringp, "(");
|
||||||
|
|
||||||
|
/* check if there are variables or expressions without an application, like: exten => 100,hint,DAHDI/g0/${GLOBAL(var)} */
|
||||||
|
if (strstr(appl, "${") || strstr(appl, "$[")){
|
||||||
|
/* set appl to original one */
|
||||||
|
strcpy(appl, orig_appl);
|
||||||
|
/* set no data */
|
||||||
|
data = "";
|
||||||
|
/* no variable before application found -> go ahead */
|
||||||
|
} else {
|
||||||
data = S_OR(stringp, "");
|
data = S_OR(stringp, "");
|
||||||
if ((end = strrchr(data, ')'))) {
|
if ((end = strrchr(data, ')'))) {
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
|
@ -1504,6 +1518,8 @@ process_extension:
|
||||||
ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
|
ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ast_free(orig_appl);
|
||||||
|
}
|
||||||
|
|
||||||
appl = ast_skip_blanks(appl);
|
appl = ast_skip_blanks(appl);
|
||||||
if (ipri) {
|
if (ipri) {
|
||||||
|
|
Loading…
Reference in New Issue