diff options
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; |