recurse variable expansion in api variables

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6169 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-11-07 00:00:51 +00:00
parent f496c18787
commit 22d52836e0
1 changed files with 11 additions and 2 deletions

View File

@ -1379,12 +1379,21 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
SWITCH_STANDARD_STREAM(stream);
if (stream.data) {
char *expanded = NULL;
if ((expanded = switch_channel_expand_variables(channel, vval)) == vval) {
expanded = NULL;
} else {
vval = expanded;
}
if (switch_api_execute(vname, vval, channel->session, &stream) == SWITCH_STATUS_SUCCESS) {
func_val = stream.data;
sub_val = func_val;
} else {
free(stream.data);
}
switch_safe_free(expanded);
free(stream.data);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
free(data);