Don't native bridge when we can't
authorMark Spencer <markster@digium.com>
Wed, 16 Jul 2003 15:17:25 +0000 (15:17 +0000)
committerMark Spencer <markster@digium.com>
Wed, 16 Jul 2003 15:17:25 +0000 (15:17 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1192 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 2b6013f..8e9f021 100755 (executable)
@@ -1807,10 +1807,16 @@ static int iax2_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags
                if ((c0->type != type) || (c1->type != type)) {
                        if (option_verbose > 2)
                                ast_verbose(VERBOSE_PREFIX_3 "Can't masquerade, we're different...\n");
+                       /* Remove from native mode */
+                       p0->bridgecallno = 0;
+                       p1->bridgecallno = 0;
                        return -2;
                }
                if (c0->nativeformats != c1->nativeformats) {
                        ast_verbose(VERBOSE_PREFIX_3 "Operating with different codecs, can't native bridge...\n");
+                       /* Remove from native mode */
+                       p0->bridgecallno = 0;
+                       p1->bridgecallno = 0;
                        return -2;
                }
                /* check if transfered and if we really want native bridging */
@@ -1867,6 +1873,7 @@ static int iax2_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags
                                                *fo = f;
                                                /* Take out of conference mode */
                                                res = 0;
+                                               /* Remove from native mode */
                                                break;
                                        } else 
                                                goto tackygoto;
@@ -1876,6 +1883,7 @@ static int iax2_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags
                                                *rc = c1;
                                                *fo = f;
                                                res =  0;
+                                               /* Remove from native mode */
                                                break;
                                        } else
                                                goto tackygoto;