From 4a801c8626e1f56bbad86fed1ab47cd021da0e2a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 13 Jul 2012 14:58:15 -0500 Subject: [PATCH] only decode rtp packets in srtp mode --- src/switch_rtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 47e02d99bc..adbda9ffe2 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2947,7 +2947,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t #endif #ifdef ENABLE_SRTP - if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_RECV)) { + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_RECV) && rtp_session->rtp_recv_msg.header.version == 2) { int sbytes = (int) *bytes; err_status_t stat = 0; @@ -3066,7 +3066,7 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t } #ifdef ENABLE_SRTP - if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_RECV)) { + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_RECV) && rtp_session->rtp_recv_msg.header.version == 2) { int sbytes = (int) *bytes; err_status_t stat = 0;