mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 06:53:41 +00:00
If the incoming RTP stream changes codec force the bridge to break if the other side does not support it.
(closes issue #11729) Reported by: tsearle Patches: new_codec_patch_udiff.patch uploaded by tsearle (license 373) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
main/rtp.c
10
main/rtp.c
@@ -1062,6 +1062,10 @@ static int bridge_p2p_rtp_write(struct ast_rtp *rtp, struct ast_rtp *bridged, un
|
|||||||
/* Check what the payload value should be */
|
/* Check what the payload value should be */
|
||||||
rtpPT = ast_rtp_lookup_pt(rtp, payload);
|
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 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)
|
if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) && !rtpPT.isAstFormat && rtpPT.code == AST_RTP_DTMF)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -3142,6 +3146,12 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
|
|||||||
cs[1] = c1;
|
cs[1] = c1;
|
||||||
cs[2] = NULL;
|
cs[2] = NULL;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
/* If the underlying formats have changed force this bridge to break */
|
||||||
|
if ((c0->rawreadformat != c1->rawwriteformat) || (c1->rawreadformat != c0->rawwriteformat)) {
|
||||||
|
ast_log(LOG_DEBUG, "Oooh, formats changed, backing out\n");
|
||||||
|
res = AST_BRIDGE_FAILED_NOWARN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
/* Check if anything changed */
|
/* Check if anything changed */
|
||||||
if ((c0->tech_pvt != pvt0) ||
|
if ((c0->tech_pvt != pvt0) ||
|
||||||
(c1->tech_pvt != pvt1) ||
|
(c1->tech_pvt != pvt1) ||
|
||||||
|
Reference in New Issue
Block a user