]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 10 Mar 2008 16:19:55 +0000 (16:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 10 Mar 2008 16:19:55 +0000 (16:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7851 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr.c

index bb935f268e6574ea2aa1d637c84b2ba4fbecfe1d..c2218b7cee91f86efe10c026327cfa8e48f74b53 100644 (file)
@@ -682,6 +682,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session)
 {
        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_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session)
 
        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_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session
 {
        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_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session
 
        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;
 }