[asterisk-commits] mnick: branch 1.4 r233091 - /branches/1.4/pbx/pbx_config.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Dec 4 10:59:26 CST 2009
Author: mnick
Date: Fri Dec 4 10:59:21 2009
New Revision: 233091
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=233091
Log:
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
Modified:
branches/1.4/pbx/pbx_config.c
Modified: branches/1.4/pbx/pbx_config.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/pbx/pbx_config.c?view=diff&rev=233091&r1=233090&r2=233091
==============================================================================
--- branches/1.4/pbx/pbx_config.c (original)
+++ branches/1.4/pbx/pbx_config.c Fri Dec 4 10:59:21 2009
@@ -2266,16 +2266,30 @@
/* Neither found */
data = "";
} else {
+ char *orig_appl = strdup(appl);
+
+ if (!orig_appl)
+ return -1;
+
/* Final remaining case is parenthesis found first */
appl = strsep(&stringp, "(");
- data = stringp;
- end = strrchr(data, ')');
- if ((end = strrchr(data, ')'))) {
- *end = '\0';
+
+ /* 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);
+ data = "";
} else {
- ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
+ data = stringp;
+ end = strrchr(data, ')');
+ if ((end = strrchr(data, ')'))) {
+ *end = '\0';
+ } else {
+ ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
+ }
+ ast_process_quotes_and_slashes(data, ',', '|');
}
- ast_process_quotes_and_slashes(data, ',', '|');
+ ast_free(orig_appl);
}
if (!data)
More information about the asterisk-commits
mailing list