[Freeswitch-svn] [commit] r8425 - in freeswitch/trunk/src: . mod/applications/mod_dptools

Freeswitch SVN anthm at freeswitch.org
Thu May 15 17:36:32 EDT 2008


Author: anthm
Date: Thu May 15 17:36:32 2008
New Revision: 8425

Modified:
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/trunk/src/switch_ivr_bridge.c

Log:
make the impossible possible

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Thu May 15 17:36:32 2008
@@ -1404,19 +1404,24 @@
 	switch_channel_set_flag(channel, CF_INNER_BRIDGE);
 	
 	switch_ivr_multi_threaded_bridge(session, peer_session, xfer_on_dtmf, peer_session, NULL);
-	
+
+	switch_channel_clear_flag(peer_channel, CF_INNER_BRIDGE);
+	switch_channel_clear_flag(channel, CF_INNER_BRIDGE);
+
 	if (bond) {
 		switch_core_session_t *b_session;
 		char buf[128] = "";
 
-		if ((b_session = switch_core_session_locate(bond))) {
+		if (!switch_channel_ready(channel)) {
+			switch_ivr_uuid_bridge(switch_core_session_get_uuid(peer_session), bond);
+		} else if ((b_session = switch_core_session_locate(bond))) {
 			switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
 			switch_snprintf(buf, sizeof(buf), "%s %s", switch_core_session_get_uuid(peer_session), switch_core_session_get_uuid(session));
 			switch_channel_set_variable(b_channel, "xfer_uuids", buf);
 
 			switch_snprintf(buf, sizeof(buf), "%s %s", switch_core_session_get_uuid(peer_session), bond);
 			switch_channel_set_variable(channel, "xfer_uuids", buf);
-			
+
 			switch_core_event_hook_add_state_change(session, hanguphook);
 			switch_core_event_hook_add_state_change(b_session, hanguphook);
 

Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c	(original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c	Thu May 15 17:36:32 2008
@@ -369,8 +369,8 @@
 	switch_channel_clear_state_handler(channel, &audio_bridge_peer_state_handlers);
 
 	state = switch_channel_get_state(channel);
-
-	if (!switch_channel_test_flag(channel, CF_TRANSFER) && state != CS_PARK && state != CS_ROUTING) {
+	
+	if (!switch_channel_test_flag(channel, CF_TRANSFER) && state != CS_PARK && state != CS_ROUTING && !switch_channel_test_flag(channel, CF_INNER_BRIDGE)) {
 		switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
 	}
 



More information about the Freeswitch-svn mailing list