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

FreeSWITCH SVN anthm at freeswitch.org
Thu Jun 25 11:56:37 PDT 2009


Author: anthm
Date: Thu Jun 25 13:56:37 2009
New Revision: 13963

Log:
unhold before media timeout

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

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	Thu Jun 25 13:56:37 2009
@@ -385,7 +385,7 @@
 		} else {
 			switch_snprintf(reason, sizeof(reason), "FreeSWITCH;cause=%d;text=\"%s\"", cause, switch_channel_cause2str(cause));
 		}
-		
+
 		if (switch_channel_test_flag(channel, CF_ANSWERED)) {
 			if (!tech_pvt->got_bye) {
 				switch_channel_set_variable(channel, "sip_hangup_disposition", "send_bye");
@@ -620,6 +620,10 @@
 			status = switch_rtp_zerocopy_read_frame(tech_pvt->video_rtp_session, &tech_pvt->video_read_frame, flags);
 			if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
 				if (status == SWITCH_STATUS_TIMEOUT) {
+					if (sofia_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
+						sofia_glue_toggle_hold(tech_pvt, 0);
+						sofia_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
+					}
 					switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_MEDIA_TIMEOUT);
 				}
 				return status;
@@ -728,6 +732,12 @@
 
 			if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
 				if (status == SWITCH_STATUS_TIMEOUT) {
+					
+					if (sofia_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
+						sofia_glue_toggle_hold(tech_pvt, 0);
+						sofia_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
+					}
+					
 					switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_MEDIA_TIMEOUT);
 				}
 				return status;



More information about the Freeswitch-svn mailing list