From 87ebaded7e284ac009792ba7b8521283b6f514ac Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 19 Jan 2009 16:25:49 +0000 Subject: [PATCH] just fail silently in these cases. see FSCORE-272 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11278 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_channel.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index 5c0e78fe61..053b691248 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1641,12 +1641,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel return SWITCH_STATUS_FALSE; } - if (switch_channel_test_flag(channel, CF_OUTBOUND)) { - switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CRIT, "INVALID! Channel [%s] is an outbound leg\n", channel->name); - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - return SWITCH_STATUS_FALSE; - } - if (switch_channel_test_flag(channel, CF_ANSWERED)) { return SWITCH_STATUS_SUCCESS; } @@ -1655,6 +1649,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel return SWITCH_STATUS_SUCCESS; } + if (switch_channel_test_flag(channel, CF_OUTBOUND)) { + return SWITCH_STATUS_SUCCESS; + } + msg.message_id = SWITCH_MESSAGE_INDICATE_PROGRESS; msg.from = channel->name; status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line); @@ -1679,12 +1677,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel return SWITCH_STATUS_FALSE; } - if (switch_channel_test_flag(channel, CF_OUTBOUND)) { - switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CRIT, "INVALID! Channel [%s] is an outbound leg\n", channel->name); - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - return SWITCH_STATUS_FALSE; - } - if (switch_channel_test_flag(channel, CF_ANSWERED)) { return SWITCH_STATUS_SUCCESS; } @@ -1693,6 +1685,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel return SWITCH_STATUS_SUCCESS; } + if (switch_channel_test_flag(channel, CF_OUTBOUND)) { + return SWITCH_STATUS_SUCCESS; + } + msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING; msg.from = channel->name; status = switch_core_session_perform_receive_message(channel->session, &msg, file, func, line); @@ -1794,13 +1790,11 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t * return SWITCH_STATUS_FALSE; } - if (switch_channel_test_flag(channel, CF_OUTBOUND)) { - switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CRIT, "INVALID! Channel [%s] is an outbound leg\n", channel->name); - switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - return SWITCH_STATUS_FALSE; + if (switch_channel_test_flag(channel, CF_ANSWERED)) { + return SWITCH_STATUS_SUCCESS; } - if (switch_channel_test_flag(channel, CF_ANSWERED)) { + if (switch_channel_test_flag(channel, CF_OUTBOUND)) { return SWITCH_STATUS_SUCCESS; } @@ -1814,8 +1808,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t * switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); } - - return status; }