[Freeswitch-svn] [commit] r7128 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Mon Jan 7 13:02:01 EST 2008


Author: anthm
Date: Mon Jan  7 13:02:01 2008
New Revision: 7128

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
fix bypass_media mode

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Jan  7 13:02:01 2008
@@ -967,7 +967,7 @@
 				reason = "Call Refused";
 			}
 
-			if (!(code > 400 && code < 700)) {
+			if (!code) {
 				code = 488;
 			}
 
@@ -982,7 +982,7 @@
 				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());
 			}
 			

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Mon Jan  7 13:02:01 2008
@@ -1266,9 +1266,13 @@
 		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;



More information about the Freeswitch-svn mailing list