Prevent local RTP bridges from sending inappropriate formats to participants.

A change for Asterisk 11 caused a check for failure to incorrectly check the return
value. This resulted in the possibility of transmitting media that a party had not
negotiated. If this media happened to be G.729, then this could potentially result
in one-way audio if no G.729 translators are installed.

(closes issue ASTERISK-20296)
reported by NITESH BANSAL
........

Merged revisions 372118 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
changes/78/78/1
Mark Michelson 13 years ago
parent 1ab2639cf2
commit e7ef469826

@ -2789,7 +2789,7 @@ static int bridge_p2p_rtp_write(struct ast_rtp_instance *instance, unsigned int
}
/* 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 (!ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(instance1), 0, NULL, bridged_payload) &&
if ((ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(instance1), 0, NULL, bridged_payload) == -1) &&
!ast_rtp_codecs_get_payload_format(ast_rtp_instance_get_codecs(instance1), bridged_payload)) {
return -1;
}

Loading…
Cancel
Save