]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
bridge_native_rtp.c: Fix direct media video RTP instance ACL check.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 23 Jun 2017 16:17:51 +0000 (11:17 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 5 Jul 2017 22:08:50 +0000 (17:08 -0500)
The video stream was using the audio stream RTP instance addresses to
check if the video RTP gets directed to an allowed direct media Access
Control List (ACL) address.  There is no guarantee that the video RTP
instance uses the same addresses as the audio RTP instance.

This looks like it has been a bug since v11 when direct media ACL was
first added to chan_sip and then faithfully reproduced through a couple
code refactorings into the new bridging architecture.

Change-Id: I8ddd56320e0eea769f3ceed3fa5b6bdfb51d681a

bridges/bridge_native_rtp.c

index 4e55a3e88ffaa1ec365cb4999176adeadc32250c..e25559363c2533d3bcd1c86b0248d24272d3c1a8 100644 (file)
@@ -184,10 +184,10 @@ static int rtp_glue_data_get(struct ast_channel *c0, struct rtp_glue_data *glue0
                }
        }
        if (glue0->video.result == glue1->video.result && glue1->video.result == AST_RTP_GLUE_RESULT_REMOTE) {
-               if (glue0->cb->allow_vrtp_remote && !glue0->cb->allow_vrtp_remote(c0, glue1->audio.instance)) {
-                       /* if the allow_vrtp_remote indicates that remote isn't allowed, revert to local bridge */
+               if (glue0->cb->allow_vrtp_remote && !glue0->cb->allow_vrtp_remote(c0, glue1->video.instance)) {
+                       /* If the allow_vrtp_remote indicates that remote isn't allowed, revert to local bridge */
                        glue0->video.result = glue1->video.result = AST_RTP_GLUE_RESULT_LOCAL;
-               } else if (glue1->cb->allow_vrtp_remote && !glue1->cb->allow_vrtp_remote(c1, glue0->audio.instance)) {
+               } else if (glue1->cb->allow_vrtp_remote && !glue1->cb->allow_vrtp_remote(c1, glue0->video.instance)) {
                        glue0->video.result = glue1->video.result = AST_RTP_GLUE_RESULT_LOCAL;
                }
        }