chan_sip: fix problem directmediapermit/deny uses the wrong address

When remotely bridging calls with directmedia, Asterisk would check
the address of the peers/users holding directmedia ACLs (set via
directmediapermit/directmediadeny) instead of the bridged peer. This
is similar to r366547, but trunk specific and involves changes to
the rtpengine instead of just chan_sip.

(closes issue AST-876)
review: https://reviewboard.asterisk.org/r/1924/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2012-05-24 18:56:43 +00:00
parent d0ed332750
commit bdaecbb66b
3 changed files with 105 additions and 15 deletions

View File

@@ -1339,6 +1339,22 @@ enum ast_bridge_result ast_rtp_instance_bridge(struct ast_channel *c0, struct as
audio_glue1_res = glue1->get_rtp_info(c1, &instance1);
video_glue1_res = glue1->get_vrtp_info ? glue1->get_vrtp_info(c1, &vinstance1) : AST_RTP_GLUE_RESULT_FORBID;
/* If the channels are of the same technology, they might have limitations on remote bridging */
if (ast_channel_tech(c0) == ast_channel_tech(c1)) {
if (audio_glue0_res == audio_glue1_res && audio_glue1_res == AST_RTP_GLUE_RESULT_REMOTE) {
if (glue0->allow_rtp_remote && !(glue0->allow_rtp_remote(c0, c1))) {
/* If the allow_rtp_remote indicates that remote isn't allowed, revert to local bridge */
audio_glue0_res = audio_glue1_res = AST_RTP_GLUE_RESULT_LOCAL;
}
}
if (video_glue0_res == video_glue1_res && video_glue1_res == AST_RTP_GLUE_RESULT_REMOTE) {
if (glue0->allow_vrtp_remote && !(glue0->allow_vrtp_remote(c0, c1))) {
/* if the allow_vrtp_remote indicates that remote isn't allowed, revert to local bridge */
video_glue0_res = video_glue1_res = AST_RTP_GLUE_RESULT_LOCAL;
}
}
}
/* If we are carrying video, and both sides are not going to remotely bridge... fail the native bridge */
if (video_glue0_res != AST_RTP_GLUE_RESULT_FORBID && (audio_glue0_res != AST_RTP_GLUE_RESULT_REMOTE || video_glue0_res != AST_RTP_GLUE_RESULT_REMOTE)) {
audio_glue0_res = AST_RTP_GLUE_RESULT_FORBID;