aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authormnick <mnick@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-04 21:07:16 +0000
committermnick <mnick@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-04 21:07:16 +0000
commit45519410e87a59640409b2770211a89c8b9f9c6d (patch)
tree307ab50545da39e82ae1bb6b87e72a47768c48f3 /pbx
parent169876ec3fc99f2ad1c511aba74189342f41b738 (diff)
Merged revisions 233093 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r233093 | mnick | 2009-12-04 11:15:47 -0600 (Fri, 04 Dec 2009) | 8 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.2@233240 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_config.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index b9a40f4ce..16e58cea5 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -1497,13 +1497,29 @@ process_extension:
/* No arguments */
data = "";
} else {
+ char *orig_appl = ast_strdup(appl);
+
+ if (!orig_appl)
+ return -1;
+
appl = strsep(&stringp, "(");
- data = S_OR(stringp, "");
- 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);
+ /* set no data */
+ data = "";
+ /* no variable before application found -> go ahead */
} else {
- ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
+ data = S_OR(stringp, "");
+ if ((end = strrchr(data, ')'))) {
+ *end = '\0';
+ } else {
+ ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
+ }
}
+ ast_free(orig_appl);
}
appl = ast_skip_blanks(appl);