[Freeswitch-svn] [commit] r5474 - freeswitch/branches/spditner/trunk/src

Freeswitch SVN spditner at freeswitch.org
Tue Jun 26 13:11:35 EDT 2007


Author: spditner
Date: Tue Jun 26 13:11:35 2007
New Revision: 5474

Modified:
   freeswitch/branches/spditner/trunk/src/switch_ivr.c

Log:
Patch to allow transfers to work when hangup_after_bridge=true


Modified: freeswitch/branches/spditner/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/spditner/trunk/src/switch_ivr.c	(original)
+++ freeswitch/branches/spditner/trunk/src/switch_ivr.c	Tue Jun 26 13:11:35 2007
@@ -897,8 +897,14 @@
 			switch_core_session_rwunlock(other_session);
 		}
 
-		if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE))
-			&& (other_session = switch_core_session_locate(uuid))) {
+		/* If HANGUP_AFTER_BRIDGE is set to 'true', SWITCH_SIGNAL_BRIDGE_VARIABLE 
+		 * will not have a value, so we need to check SWITCH_BRIDGE_VARIABLE */
+		uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE);
+		if(!uuid) {
+			uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
+		}
+
+		if (uuid && (other_session = switch_core_session_locate(uuid))) {
 			other_channel = switch_core_session_get_channel(other_session);
 			assert(other_channel != NULL);
 
@@ -908,6 +914,10 @@
 			switch_channel_set_variable(channel, SWITCH_BRIDGE_VARIABLE, NULL);
 			switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL);
 
+			/* If we are transferring the CALLER out of the bridge, we do not want
+			   to hang up on them */
+			switch_channel_set_variable(channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "false");
+
 			switch_channel_hangup(other_channel, SWITCH_CAUSE_BLIND_TRANSFER);
 			switch_ivr_media(uuid, SMF_NONE);
 



More information about the Freeswitch-svn mailing list