From 7a1b8669586f8e800f92a5b78cacf44b482431bf Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 22 Jan 2009 22:14:37 +0000 Subject: [PATCH] tweak git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11409 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_state_machine.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/switch_core_state_machine.c b/src/switch_core_state_machine.c index 9cab8f85c1..d508771fad 100644 --- a/src/switch_core_state_machine.c +++ b/src/switch_core_state_machine.c @@ -422,17 +422,23 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session) char *arg = NULL; char *expanded = NULL; - if ((arg = strchr(cmd, ' '))) { + if ((arg = strchr(cmd, ':')) && *(arg+1) == ':') { *arg++ = '\0'; + *arg++ = '\0'; + } else { + if ((arg = strchr(cmd, ' '))) { + *arg++ = '\0'; + } } + SWITCH_STANDARD_STREAM(stream); switch_channel_get_variables(session->channel, &stream.param_event); expanded = switch_channel_expand_variables(session->channel, arg); - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hangup Command %s(%s):\n%s\n", cmd, expanded, - switch_str_nil((char *) stream.data)); switch_api_execute(cmd, expanded, use_session, &stream); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hangup Command %s(%s):\n%s\n", cmd, switch_str_nil(expanded), + switch_str_nil((char *) stream.data)); + if (expanded != arg) { switch_safe_free(expanded); }