From b0d95efd09d010154a8422c611feb64c64a1e71f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 31 Oct 2013 17:22:09 -0500 Subject: [PATCH] dont byteswap the extended bit headers in the actual packet so it can properly echo back without modification --- src/switch_rtp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 08b310c2c3..325a41fd07 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -4160,14 +4160,13 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t if (!rtp_session->flags[SWITCH_RTP_FLAG_PROXY_MEDIA] && !rtp_session->flags[SWITCH_RTP_FLAG_UDPTL] && rtp_session->recv_msg.header.version == 2 && rtp_session->recv_msg.header.x) { /* header extensions */ + uint16_t length; rtp_session->recv_msg.ext = (switch_rtp_hdr_ext_t *) rtp_session->recv_msg.body; + length = ntohs((uint16_t)rtp_session->recv_msg.ext->length); - rtp_session->recv_msg.ext->length = ntohs((uint16_t)rtp_session->recv_msg.ext->length); - rtp_session->recv_msg.ext->profile = ntohs((uint16_t)rtp_session->recv_msg.ext->profile); - - if (rtp_session->recv_msg.ext->length < SWITCH_RTP_MAX_BUF_LEN_WORDS) { - rtp_session->recv_msg.ebody = rtp_session->recv_msg.body + (rtp_session->recv_msg.ext->length * 4) + 4; + if (length < SWITCH_RTP_MAX_BUF_LEN_WORDS) { + rtp_session->recv_msg.ebody = rtp_session->recv_msg.body + (length * 4) + 4; } }