From b3992a6eeed356a15089da558d2884c14f3b6689 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 7 Jan 2008 18:02:01 +0000 Subject: [PATCH] fix bypass_media mode git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7128 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 4 ++-- src/mod/endpoints/mod_sofia/sofia.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 31b68378b1..27664ee6a1 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -967,7 +967,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi reason = "Call Refused"; } - if (!(code > 400 && code < 700)) { + if (!code) { code = 488; } @@ -982,7 +982,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi sofia_reg_auth_challange(NULL, tech_pvt->profile, tech_pvt->nh, REG_INVITE, to_host, 0); switch_channel_hangup(channel, SWITCH_CAUSE_USER_CHALLENGE); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Rejecting with %d %s\n", code, reason); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding with %d %s\n", code, reason); nua_respond(tech_pvt->nh, code, reason, TAG_END()); } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index ebcdd1bc61..5652697bde 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1266,9 +1266,13 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status switch_core_session_t *other_session; if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) { + if (status == 200 && !switch_channel_test_flag(channel, CF_ANSWERED) && !switch_channel_test_flag(channel, CF_EARLY_MEDIA)) { + return; + } + if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) { switch_core_session_message_t msg; - + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Passing %d %s to other leg\n", status, phrase); msg.message_id = SWITCH_MESSAGE_INDICATE_RESPOND;