From f7d55aecb8f3fd03afe0e4a4e9170d75d21d96f1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 20 May 2009 13:02:41 +0000 Subject: [PATCH] treat app::arg syntax in execute_on_answer as a broadcast request git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13400 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_channel.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index 09b5fe64db..880d7a4b49 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1893,12 +1893,17 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan char *arg = NULL; app = switch_core_session_strdup(channel->session, var); - - if ((arg = strchr(app, ' '))) { - *arg++ = '\0'; + + if ((arg = strchr(app, ':')) && *(arg+1) == ':') { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s execute on answer: %s (BROADCAST)\n", channel->name, app); + switch_ivr_broadcast(switch_core_session_get_uuid(channel->session), app, SMF_NONE); + } else { + if ((arg = strchr(app, ' '))) { + *arg++ = '\0'; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)\n", channel->name, app, switch_str_nil(arg)); + switch_core_session_execute_application(channel->session, app, arg); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)", channel->name, app, switch_str_nil(arg)); - switch_core_session_execute_application(channel->session, app, arg); } switch_channel_audio_sync(channel);