diff options
author | Jonathan Rose <jrose@digium.com> | 2012-05-24 18:56:43 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2012-05-24 18:56:43 +0000 |
commit | bdaecbb66b1d6f92f32d14e34fb399634bb5079a (patch) | |
tree | d5ca35238263604d3f34e52cd48e132677f2a8ee /main/rtp_engine.c | |
parent | d0ed332750da99d21a83d6e247d6f4dddd7f0116 (diff) |
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
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r-- | main/rtp_engine.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c index 522ed0db1..d0188a945 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -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; |