[Freeswitch-svn] [commit] r7851 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Mon Mar 10 12:19:55 EDT 2008


Author: anthm
Date: Mon Mar 10 12:19:55 2008
New Revision: 7851

Modified:
   freeswitch/trunk/src/switch_ivr.c

Log:
update

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Mon Mar 10 12:19:55 2008
@@ -682,6 +682,8 @@
 {
 	switch_core_session_message_t msg = { 0 };
 	switch_channel_t *channel = switch_core_session_get_channel(session);
+	const char *stream;
+	const char *other_uuid;
 
 	msg.message_id = SWITCH_MESSAGE_INDICATE_HOLD;
 	msg.from = __FILE__;
@@ -691,6 +693,14 @@
 
 	switch_core_session_receive_message(session, &msg);
 
+
+	if ((stream = switch_channel_get_variable(channel, SWITCH_HOLD_MUSIC_VARIABLE))) {
+		if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+			switch_ivr_broadcast(other_uuid, stream, SMF_ECHO_ALEG | SMF_LOOP);
+		}
+	}
+	
+
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -710,6 +720,8 @@
 {
 	switch_core_session_message_t msg = { 0 };
 	switch_channel_t *channel = switch_core_session_get_channel(session);
+	const char *other_uuid;
+	switch_core_session_t *b_session;
 
 	msg.message_id = SWITCH_MESSAGE_INDICATE_UNHOLD;
 	msg.from = __FILE__;
@@ -719,6 +731,15 @@
 
 	switch_core_session_receive_message(session, &msg);
 
+
+	if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (b_session = switch_core_session_locate(other_uuid))) {
+		switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
+		switch_channel_stop_broadcast(b_channel);
+		switch_channel_wait_for_flag(b_channel, CF_BROADCAST, SWITCH_FALSE, 5000);
+		switch_core_session_rwunlock(b_session);
+	}
+
+
 	return SWITCH_STATUS_SUCCESS;
 }
 



More information about the Freeswitch-svn mailing list