Index: main/rtp.c =================================================================== --- main/rtp.c (revision 129342) +++ main/rtp.c (working copy) @@ -1062,10 +1062,6 @@ /* Check what the payload value should be */ rtpPT = ast_rtp_lookup_pt(rtp, payload); - /* If the payload coming in is not one of the negotiated ones then send it to the core, this will cause formats to change and the bridge to break */ - if (!bridged->current_RTP_PT[payload].code) - return -1; - /* If the payload is DTMF, and we are listening for DTMF - then feed it into the core */ if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) && !rtpPT.isAstFormat && rtpPT.code == AST_RTP_DTMF) return -1; @@ -1073,6 +1069,11 @@ /* Otherwise adjust bridged payload to match */ bridged_payload = ast_rtp_lookup_code(bridged, rtpPT.isAstFormat, rtpPT.code); + /* If the payload coming in is not one of the negotiated ones then send it to the core, this will cause formats to change and the bridge to break */ + if (!bridged->current_RTP_PT[bridged_payload].code) + return -1; + + /* If the mark bit has not been sent yet... do it now */ if (!ast_test_flag(rtp, FLAG_P2P_SENT_MARK)) { mark = 1;