/* 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;
cs[1] = c1;
cs[2] = NULL;
for (;;) {
+ /* If the underlying formats have changed force this bridge to break */
+ if ((c0->rawreadformat != c1->rawwriteformat) || (c1->rawreadformat != c0->rawwriteformat)) {
+ ast_debug(3, "p2p-rtp-bridge: Oooh, formats changed, backing out\n");
+ res = AST_BRIDGE_FAILED_NOWARN;
+ break;
+ }
/* Check if anything changed */
if ((c0->tech_pvt != pvt0) ||
(c1->tech_pvt != pvt1) ||