If we are doing video and we can't reinvite, then resort to generic bridging instead...
authorJoshua Colp <jcolp@digium.com>
Fri, 1 Sep 2006 17:54:22 +0000 (17:54 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 1 Sep 2006 17:54:22 +0000 (17:54 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41718 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
main/rtp.c

index f841816..072b41f 100644 (file)
@@ -16130,7 +16130,7 @@ static enum ast_rtp_get_result sip_get_vrtp_peer(struct ast_channel *chan, struc
                return AST_RTP_GET_FAILED;
 
        ast_mutex_lock(&p->lock);
-       if (!(p->rtp)) {
+       if (!(p->vrtp)) {
                ast_mutex_unlock(&p->lock);
                return AST_RTP_GET_FAILED;
        }
index b62ed14..4656be9 100644 (file)
@@ -3070,7 +3070,13 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel
        audio_p1_res = pr1->get_rtp_info(c1, &p1);
        video_p1_res = pr1->get_vrtp_info ? pr1->get_vrtp_info(c1, &vp1) : AST_RTP_GET_FAILED;
 
-       /* Check if bridge is still possible (In SIP canreinvite=no stops this, like NAT) */
+       /* If we are carrying video, and both sides are not reinviting... then fail the native bridge */
+       if (video_p0_res != AST_RTP_GET_FAILED && (audio_p0_res != AST_RTP_TRY_NATIVE || video_p0_res != AST_RTP_TRY_NATIVE))
+               audio_p0_res = AST_RTP_GET_FAILED;
+       if (video_p1_res != AST_RTP_GET_FAILED && (audio_p1_res != AST_RTP_TRY_NATIVE || video_p1_res != AST_RTP_TRY_NATIVE))
+               audio_p1_res = AST_RTP_GET_FAILED;
+
+       /* Check if a bridge is possible (partial/native) */
        if (audio_p0_res == AST_RTP_GET_FAILED || audio_p1_res == AST_RTP_GET_FAILED) {
                /* Somebody doesn't want to play... */
                ast_channel_unlock(c0);