From 6c5a17894c32df67955c816fd29d89bc8665042e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 5 Dec 2013 16:35:49 -0600 Subject: [PATCH] accept any payload when no payload map is present --- src/switch_rtp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 6e6c594f05..afd308b9c5 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -4112,10 +4112,12 @@ static int jb_valid(switch_rtp_t *rtp_session) static int check_recv_payload(switch_rtp_t *rtp_session) { - int ok = 0; + int ok = 1; if (rtp_session->pmaps && *rtp_session->pmaps) { payload_map_t *pmap; + ok = 0; + switch_mutex_lock(rtp_session->flag_mutex); for (pmap = *rtp_session->pmaps; pmap && pmap->allocated; pmap = pmap->next) { if (!pmap->negotiated) { @@ -5040,11 +5042,13 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ rtp_session->recv_msg.header.pt != 13 && rtp_session->recv_msg.header.pt != rtp_session->recv_te && (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt)) { - int accept_packet = 0; + int accept_packet = 1; if (rtp_session->pmaps && *rtp_session->pmaps) { payload_map_t *pmap; + accept_packet = 0; + switch_mutex_lock(rtp_session->flag_mutex); for (pmap = *rtp_session->pmaps; pmap && pmap->allocated; pmap = pmap->next) {