]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9612 #resolve [RTCP-MUX wrongly enabled in cases where answer contains rtcp but...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 5 Oct 2016 06:22:46 +0000 (01:22 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 5 Oct 2016 06:22:46 +0000 (01:22 -0500)
src/switch_core_media.c
src/switch_rtp.c

index 4410a41b87edce3fdd4d0629e98a9772e74edfed..274ec4dc424bb47616585b509c3e3a6eb45425bc 100644 (file)
@@ -4105,7 +4105,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
        int codec_ms = 0;
        uint32_t remote_codec_rate = 0, fmtp_remote_codec_rate = 0;
        const char *tmp;
-       int m_idx = 0, skip_rtcp = 0, skip_video_rtcp = 0;
+       int m_idx = 0, skip_rtcp = 0, skip_video_rtcp = 0, got_rtcp_mux = 0, got_video_rtcp_mux = 0;
        int nm_idx = 0;
        int vmatch_pt = 0;
        int rtcp_auto_audio = 0, rtcp_auto_video = 0;
@@ -4609,12 +4609,20 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                        }
 
                        skip_rtcp = 0;
+                       got_rtcp_mux = 0;
                        for (attr = m->m_attributes; attr; attr = attr->a_next) {
-                               if (!strcasecmp(attr->a_name, "rtcp-mux") || !strcasecmp(attr->a_name, "ice-ufrag")) {
+                               if (!strcasecmp(attr->a_name, "rtcp-mux")) {
+                                       got_rtcp_mux = 1;
+                                       skip_rtcp = 1;
+                               } else if (!strcasecmp(attr->a_name, "ice-ufrag")) {
                                        skip_rtcp = 1;
                                }
                        }
 
+                       if (!got_rtcp_mux) {
+                               a_engine->rtcp_mux = -1;
+                       }
+                       
                        for (attr = m->m_attributes; attr; attr = attr->a_next) {
                                if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value && !skip_rtcp) {
                                        a_engine->remote_rtcp_port = (switch_port_t)atoi(attr->a_value);
@@ -5264,12 +5272,20 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                        }
 
                        skip_video_rtcp = 0;
+                       got_video_rtcp_mux = 0;
                        for (attr = m->m_attributes; attr; attr = attr->a_next) {
-                               if (!strcasecmp(attr->a_name, "rtcp-mux") || !strcasecmp(attr->a_name, "ice-ufrag")) {
+                               if (!strcasecmp(attr->a_name, "rtcp-mux")) {
+                                       got_video_rtcp_mux = 1;
+                                       skip_video_rtcp = 1;
+                               } else if (!strcasecmp(attr->a_name, "ice-ufrag")) {
                                        skip_video_rtcp = 1;
                                }
                        }
 
+                       if (!got_video_rtcp_mux) {
+                               v_engine->rtcp_mux = -1;
+                       }
+
                        for (attr = m->m_attributes; attr; attr = attr->a_next) {
                                if (!strcasecmp(attr->a_name, "framerate") && attr->a_value) {
                                        //framerate = atoi(attr->a_value);
index 7620d2dac09d19b07b5291dabf5d7bbe75d0c042..f9a7ec7901babd17a0dfbe2e3a81207cfe5cd52f 100644 (file)
@@ -5315,9 +5315,12 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
                        }
                }
 
-               if (rtp_session->has_rtp) {
+               if (rtp_session->has_rtp || rtp_session->flags[SWITCH_RTP_FLAG_UDPTL]) {
                        rtp_session->missed_count = 0;
                        switch_cp_addr(rtp_session->rtp_from_addr, rtp_session->from_addr);     
+               }
+               
+               if (rtp_session->has_rtp) {
                        rtp_session->last_rtp_hdr = rtp_session->recv_msg.header;