]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
eat rtp frames with the wrong payload type number
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 13 Jan 2011 02:02:49 +0000 (20:02 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 13 Jan 2011 02:02:49 +0000 (20:02 -0600)
src/switch_rtp.c

index a56b5d11ddfcfb8ee401673268e8beb3e8594514..5794ae7f28364606ba2d512022bc51390e2b6cbe 100644 (file)
@@ -2493,7 +2493,14 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                                return_cng_frame();
                        }
                }
-               
+
+               if (rtp_session->recv_msg.header.pt != 13 && 
+                       (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) && 
+                       rtp_session->recv_msg.header.pt != rtp_session->payload) {
+                       /* drop frames of incorrect payload number and return CNG frame instead */
+                       return_cng_frame();
+               }
+
                if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_ENABLE_RTCP) && rtp_session->rtcp_read_pollfd) {
                        rtcp_poll_status = switch_poll(rtp_session->rtcp_read_pollfd, 1, &rtcp_fdr, 0);