]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
have resume media on hold not send invite back out at the holder but rather enable...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 10 Oct 2014 21:09:43 +0000 (16:09 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 10 Oct 2014 21:09:43 +0000 (16:09 -0500)
src/include/switch_types.h
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c
src/switch_ivr.c

index 910b44b3380f5d3afb1ce43e2c7a7cecb1539f5f..9fd067c0f508799ff83acffd328ec63a1ca141e6 100644 (file)
@@ -460,7 +460,9 @@ typedef enum {
        SMF_HOLD_BLEG = (1 << 5),
        SMF_IMMEDIATE = (1 << 6),
        SMF_EXEC_INLINE = (1 << 7),
-       SMF_PRIORITY = (1 << 8)
+       SMF_PRIORITY = (1 << 8),
+       SMF_REPLYONLY_A = (1 << 9),
+       SMF_REPLYONLY_B = (1 << 10)
 } switch_media_flag_enum_t;
 typedef uint32_t switch_media_flag_t;
 
index dde3c88e1a2637ceae15f2b232bca57354ba7625..11e73fff81340129c061515eacf0289457375204 100644 (file)
@@ -1451,13 +1451,15 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        
                        switch_core_media_gen_local_sdp(session, SDP_TYPE_REQUEST, NULL, 0, NULL, 1);
 
-                       if (send_invite) {
-                               if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
-                                       switch_channel_set_flag(channel, CF_REQ_MEDIA);
+                       if (!msg->numeric_arg) {
+                               if (send_invite) {
+                                       if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
+                                               switch_channel_set_flag(channel, CF_REQ_MEDIA);
+                                       }
+                                       sofia_glue_do_invite(session);
+                               } else {
+                                       status = SWITCH_STATUS_FALSE;
                                }
-                               sofia_glue_do_invite(session);
-                       } else {
-                               status = SWITCH_STATUS_FALSE;
                        }
                }
                break;
index 94adf806ec86cb2a0cb45de30d19847c29a1f13c..496d95faf03a600edd7d8ae6ed5fba2cfa015613 100644 (file)
@@ -6367,7 +6367,7 @@ void *SWITCH_THREAD_FUNC media_on_hold_thread_run(switch_thread_t *thread, void
                                switch_channel_wait_for_flag(channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL);
                                switch_channel_wait_for_flag(other_channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL);
 
-                               switch_ivr_media(switch_core_session_get_uuid(other_session), SMF_REBRIDGE);
+                               switch_ivr_media(switch_core_session_get_uuid(other_session), SMF_REBRIDGE|SMF_REPLYONLY_B);
 
                                if (switch_core_media_ready(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO)) {
                                        switch_core_media_clear_rtp_flag(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_RTP_FLAG_AUTOADJ);
index a08bb0a40df777dc2312b9cbf37a8148484a9ab1..c328e177f1e51257adfd0d25cd1cc94b1f4071ae 100644 (file)
@@ -1568,20 +1568,30 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(const char *uuid, switch_media_
                        status = SWITCH_STATUS_SUCCESS;
 
                        /* If we had early media in bypass mode before, it is no longer relevant */
-                       if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
-                               switch_core_session_message_t msg2 = { 0 };
-
-                               msg2.message_id = SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS;
-                               msg2.from = __FILE__;
-                               switch_core_session_receive_message(session, &msg2);
-                       }
-
+                       if (switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
+                               switch_core_session_message_t msg2 = { 0 };
+                               
+                               msg2.message_id = SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS;
+                               msg2.from = __FILE__;
+                               switch_core_session_receive_message(session, &msg2);
+                       }
+                       
+                       if ((flags & SMF_REPLYONLY_A)) {
+                               msg.numeric_arg = 1;
+                       }
+                                       
                        if (switch_core_session_receive_message(session, &msg) != SWITCH_STATUS_SUCCESS) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't re-establsh media on %s\n", switch_channel_get_name(channel));
                                switch_core_session_rwunlock(session);
                                return SWITCH_STATUS_GENERR;
                        }
 
+                       if ((flags & SMF_REPLYONLY_B)) {
+                               msg.numeric_arg = 1;
+                       } else {
+                               msg.numeric_arg = 0;
+                       }
+
                        if ((flags & SMF_IMMEDIATE)) {
                                switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 250, NULL);
                                switch_yield(250000);