From 38b36e91afa24d840e30a2d4206fe45f1e5a4702 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 11 Mar 2010 20:41:46 +0000 Subject: [PATCH] never do anything when you call switch_channel_answer on an outbound channel leg git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16970 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_channel.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index bd4700b48d..fe661d4d66 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -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);