From: Michael Jerris Date: Wed, 3 Mar 2010 02:34:55 +0000 (+0000) Subject: fix silly conundrum X-Git-Tag: v1.0.6~268 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40a660cdf87d3e2dc5d60605cd2822360a485ceb;p=thirdparty%2Ffreeswitch.git fix silly conundrum git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16872 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_channel.c b/src/switch_channel.c index cb430a57cb..ff02c7d293 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -2319,14 +2319,17 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan (!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE)))) && !zstr(var)) { char *arg = NULL; + char *colon = NULL; app = switch_core_session_strdup(channel->session, var); - if ((arg = strchr(app, ':')) && *(arg + 1) == ':') { + arg = strchr(app, ' '); + colon = strchr(app, ':'); + if (colon && (!arg || arg > colon) && *(colon + 1) == ':') { switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), 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, ' '))) { + if (arg) { *arg++ = '\0'; } switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)\n", channel->name, app,