]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
expand vars
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 21 Dec 2006 20:48:09 +0000 (20:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 21 Dec 2006 20:48:09 +0000 (20:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3786 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr.c

index a996989d36cbd99a08a5cacfecefeeea8d1bdcfa..28c16363eed8097123e63e01c7c02808b13069cb 100644 (file)
@@ -4489,6 +4489,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
             int proceed = 0, ovector[30];
             char substituted[1024] = "";
             char *odata = NULL;
+            char *expanded = NULL;
 
             if ((proceed = switch_perform_regex(data, pattern, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
                 for (action = switch_xml_child(input, "action"); action; action = action->next) {
@@ -4501,7 +4502,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
                     } else {
                         odata = adata;
                     }
+                    
+                    expanded = switch_channel_expand_variables(channel, odata);
 
+                    if (expanded == odata) {
+                        expanded = NULL;
+                    } else {
+                        odata = expanded;
+                    }
+                    
                     switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Handle %s:[%s] (%s)\n", func, odata, lang);
 
                     if (!strcasecmp(func, "play-file")) {
@@ -4556,6 +4565,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
             }
 
             switch_clean_re(re);
+            switch_safe_free(expanded);
         }
 
         input = input->next;