]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix silly conundrum
authorMichael Jerris <mike@jerris.com>
Wed, 3 Mar 2010 02:34:55 +0000 (02:34 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 3 Mar 2010 02:34:55 +0000 (02:34 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16872 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_channel.c

index cb430a57cb21c383406534d46ff1ea5176825b4a..ff02c7d293e6f43043274f2f0e9eb8b0feb0b1fd 100644 (file)
@@ -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,