do expand_variables in the set app
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8952 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
78c3533e28
commit
61d081ee59
|
@ -705,6 +705,9 @@ SWITCH_STANDARD_APP(set_function)
|
||||||
if (switch_strlen_zero(data)) {
|
if (switch_strlen_zero(data)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No variable name specified.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No variable name specified.\n");
|
||||||
} else {
|
} else {
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
char *expanded = NULL;
|
||||||
|
|
||||||
var = switch_core_session_strdup(session, data);
|
var = switch_core_session_strdup(session, data);
|
||||||
val = strchr(var, '=');
|
val = strchr(var, '=');
|
||||||
|
|
||||||
|
@ -715,8 +718,16 @@ SWITCH_STANDARD_APP(set_function)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SET [%s]=[%s]\n", var, val ? val : "UNDEF");
|
if (val) {
|
||||||
switch_channel_set_variable(switch_core_session_get_channel(session), var, val);
|
expanded = switch_channel_expand_variables(channel, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SET [%s]=[%s]\n", var, expanded ? expanded : "UNDEF");
|
||||||
|
switch_channel_set_variable(channel, var, expanded);
|
||||||
|
|
||||||
|
if (expanded && expanded != val) {
|
||||||
|
switch_safe_free(expanded);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue