]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9634 #resolve [RTCP mux is always proposed on outbound channels even if rtcp_mux...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Oct 2016 17:32:14 +0000 (12:32 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Oct 2016 17:32:22 +0000 (12:32 -0500)
src/switch_core_media.c

index 36f404e1504adadd483d3b1b9fa718cf08256c90..b8f384e5de8432e8eb1402fcca452386b44e4c7f 100644 (file)
@@ -3776,6 +3776,10 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
                                engine->rtcp_mux = SWITCH_TRUE;
                                engine->remote_rtcp_port = engine->cur_payload_map->remote_sdp_port;
                                got_rtcp_mux++;
+
+                               if (!smh->mparams->rtcp_audio_interval_msec) {
+                                       smh->mparams->rtcp_audio_interval_msec = SWITCH_RTCP_AUDIO_INTERVAL_MSEC;
+                               }                               
 #endif
                        } else if (!strcasecmp(attr->a_name, "candidate")) {
                                switch_channel_set_flag(smh->session->channel, CF_ICE);
@@ -4630,6 +4634,9 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                if (!strcasecmp(attr->a_name, "rtcp-mux")) {
                                        got_rtcp_mux = 1;
                                        skip_rtcp = 1;
+                                       if (!smh->mparams->rtcp_video_interval_msec) {
+                                               smh->mparams->rtcp_video_interval_msec = SWITCH_RTCP_VIDEO_INTERVAL_MSEC;
+                                       }                                       
                                } else if (!strcasecmp(attr->a_name, "ice-ufrag")) {
                                        skip_rtcp = 1;
                                }
@@ -8926,6 +8933,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
        const char *vbw;
        int bw = 256;
        uint8_t fir = 0, nack = 0, pli = 0, tmmbr = 0, has_vid = 0;
+       const char *use_rtcp_mux = NULL;
 
        switch_assert(session);
 
@@ -8937,8 +8945,14 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
        v_engine = &smh->engines[SWITCH_MEDIA_TYPE_VIDEO];
        t_engine = &smh->engines[SWITCH_MEDIA_TYPE_TEXT];
 
-       if ((!a_engine->rtcp_mux && !v_engine->rtcp_mux) && 
-               (sdp_type == SDP_TYPE_REQUEST || switch_true(switch_channel_get_variable(session->channel, "rtcp_mux")))) {
+       use_rtcp_mux = switch_channel_get_variable(session->channel, "rtcp_mux");
+
+       if (use_rtcp_mux && switch_false(use_rtcp_mux)) {
+               a_engine->rtcp_mux = -1;
+               v_engine->rtcp_mux = -1;
+       }
+
+       if ((a_engine->rtcp_mux != -1 && !v_engine->rtcp_mux != -1) && (sdp_type == SDP_TYPE_REQUEST)) {
                a_engine->rtcp_mux = 1;
                v_engine->rtcp_mux = 1;
        }