]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] Add app_disable_expand_variables channel variable. When true, application...
authorChris Rienzo <chris@signalwire.com>
Fri, 15 Jan 2021 13:37:09 +0000 (08:37 -0500)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:40 +0000 (22:00 +0300)
src/switch_core_session.c

index acda5eaf7b00ae9d3e7c5d89f51db918c0e67e1d..147900e784f239e544d9f973d389ca0f7a455f84 100644 (file)
@@ -2849,6 +2849,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
        int scope = 0;
        char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
        char *app_uuid = uuid_str;
+       switch_bool_t expand_variables = !switch_true(switch_channel_get_variable(session->channel, "app_disable_expand_variables"));
 
        if ((app_uuid_var = switch_channel_get_variable(channel, "app_uuid"))) {
                app_uuid = (char *)app_uuid_var;
@@ -2866,10 +2867,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
        app = application_interface->interface_name;
 
        if (arg) {
-               expanded = switch_channel_expand_variables(session->channel, arg);
+               if (expand_variables) {
+                       expanded = switch_channel_expand_variables(session->channel, arg);
+               } else {
+                       expanded = (char *)arg;
+               }
        }
 
-       if (expanded && *expanded == '%' && (*(expanded+1) == '[' || *(expanded+2) == '[')) {
+       if (expand_variables && expanded && *expanded == '%' && (*(expanded+1) == '[' || *(expanded+2) == '[')) {
                char *p, *dup;
                switch_event_t *ovars = NULL;