[Freeswitch-trunk] [commit] r6169 - freeswitch/trunk/src
Freeswitch SVN
anthm at freeswitch.org
Tue Nov 6 19:00:52 EST 2007
Author: anthm
Date: Tue Nov 6 19:00:51 2007
New Revision: 6169
Modified:
freeswitch/trunk/src/switch_channel.c
Log:
recurse variable expansion in api variables
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Tue Nov 6 19:00:51 2007
@@ -1379,12 +1379,21 @@
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);
More information about the Freeswitch-trunk
mailing list