]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
never do anything when you call switch_channel_answer on an outbound channel leg
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 11 Mar 2010 20:41:46 +0000 (20:41 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 11 Mar 2010 20:41:46 +0000 (20:41 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16970 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_channel.c

index bd4700b48df43577d663cdf2d1d99348a0fb9bed..fe661d4d66faf8171de95e03d7bb13a214013093 100644 (file)
@@ -2370,6 +2370,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
 
        switch_assert(channel != NULL);
 
+       if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (channel->hangup_cause || channel->state >= CS_HANGUP) {
                return SWITCH_STATUS_FALSE;
        }
@@ -2377,12 +2381,11 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
        if (switch_channel_test_flag(channel, CF_ANSWERED)) {
                return SWITCH_STATUS_SUCCESS;
        }
+       
+       msg.message_id = SWITCH_MESSAGE_INDICATE_ANSWER;
+       msg.from = channel->name;
+       status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
 
-       if (!switch_channel_test_flag(channel, CF_OUTBOUND)) {
-               msg.message_id = SWITCH_MESSAGE_INDICATE_ANSWER;
-               msg.from = channel->name;
-               status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line);
-       }
 
        if (status == SWITCH_STATUS_SUCCESS) {
                switch_channel_perform_mark_answered(channel, file, func, line);