]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix bypass_media mode
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 7 Jan 2008 18:02:01 +0000 (18:02 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 7 Jan 2008 18:02:01 +0000 (18:02 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7128 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c

index 31b68378b18be5a1bd8eeed8fc1e44ab08f929ec..27664ee6a19fe324871adfc413d70fb20c4ad3e4 100644 (file)
@@ -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());
                        }
                        
index ebcdd1bc61e32e7ee5453734ab05195d43317b4f..5652697bde57034029d476d23c5a45be41651149 100644 (file)
@@ -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;