]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6186 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 5 Feb 2014 02:15:08 +0000 (07:15 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 5 Feb 2014 02:15:08 +0000 (07:15 +0500)
conf/vanilla/sip_profiles/internal.xml
src/include/switch_types.h
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/switch_core_media.c

index bc02775a033f60f07b1803fa721405736dfc0ff3..c070e63d161a1d3b5beadda8173a7169e919d8f1 100644 (file)
         when you press the hold button.
     -->
     <!--<param name="media-option" value="resume-media-on-hold"/> -->
+
+    <!-- bypass again when hold is complete -->
+    <!-- <param ame="media-option" value="bypass-media-after-hold"/> -->
+
     <!--
         This will allow a call after an attended transfer go back to
         bypass media after an attended transfer.
index e9b6fca591e496fdff0fed1f927b90d5f39e38c7..93647fcb3c4452a9b491db16a04b4d231d30ef0e 100644 (file)
@@ -1399,6 +1399,7 @@ typedef enum {
        CF_SLA_INTERCEPT,
        CF_VIDEO_BREAK,
        CF_MEDIA_PAUSE,
+       CF_BYPASS_MEDIA_AFTER_HOLD,
        /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
        /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
        CF_FLAG_MAX
index 62586e251b23864c11458891a4b5a9071bcd6709..ea3bdbc08423a973085e19e86f130643e465382d 100644 (file)
@@ -319,6 +319,7 @@ typedef enum {
        TFLAG_CAPTURE,
        TFLAG_REINVITED,
        TFLAG_PASS_ACK,
+       TFLAG_BYPASS_MEDIA_AFTER_HOLD,
        /* No new flags below this line */
        TFLAG_MAX
 } TFLAGS;
index f8542f3ae2e90305a51a14e30bd859486053ca42..c59d4487388f8eb392d7785fdb5fc068d881b43f 100644 (file)
@@ -4306,6 +4306,13 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
                                                } else if (!strcasecmp(val, "bypass-media-after-att-xfer")) {
                                                        profile->media_options |= MEDIA_OPT_BYPASS_AFTER_ATT_XFER;
                                                }
+                                       } else if (!strcasecmp(var, "bypass-media-after-hold") && switch_true(val)) {
+                                               if(profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) {
+                                                       sofia_set_flag(profile, TFLAG_BYPASS_MEDIA_AFTER_HOLD);
+                                               } else {
+                                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                                                                               "bypass-media-after-hold can be set only with resume-media-on-hold media-option\n");
+                                               }
                                        } else if (!strcasecmp(var, "pnp-provision-url")) {
                                                profile->pnp_prov_url = switch_core_strdup(profile->pool, val);
                                        } else if (!strcasecmp(var, "manage-presence")) {
@@ -8541,6 +8548,10 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
                switch_channel_set_flag(channel, CF_PROXY_MODE);
        }
 
+       if (sofia_test_flag(tech_pvt, TFLAG_BYPASS_MEDIA_AFTER_HOLD)) {
+               switch_channel_set_flag(channel, CF_BYPASS_MEDIA_AFTER_HOLD);
+       }
+
        if (sofia_test_flag(tech_pvt, TFLAG_PROXY_MEDIA)) {
                switch_channel_set_flag(channel, CF_PROXY_MEDIA);
        }
index 4f036881dd2d6d81d8eb59b6d0d133cb8005be5c..23ba5e7fe737af7c1dabae46e422270d34e4bb08 100644 (file)
@@ -3755,6 +3755,12 @@ SWITCH_DECLARE(int) switch_core_media_toggle_hold(switch_core_session_t *session
 
                        switch_yield(250000);
 
+                       if (b_channel && (switch_channel_test_flag(session->channel, CF_BYPASS_MEDIA_AFTER_HOLD) ||
+                               switch_channel_test_flag(b_channel, CF_BYPASS_MEDIA_AFTER_HOLD))) {
+                               /* try to stay out from media stream */
+                               switch_ivr_nomedia(switch_core_session_get_uuid(session), SMF_REBRIDGE);
+                       }
+
                        if (a_engine->max_missed_packets && a_engine->rtp_session) {
                                switch_rtp_reset_media_timer(a_engine->rtp_session);
                                switch_rtp_set_max_missed_packets(a_engine->rtp_session, a_engine->max_missed_packets);