]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure when the timeout occurs that we actually break the bridge (bug #5252)
authorMark Spencer <markster@digium.com>
Fri, 14 Oct 2005 17:02:20 +0000 (17:02 +0000)
committerMark Spencer <markster@digium.com>
Fri, 14 Oct 2005 17:02:20 +0000 (17:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6791 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
channels/chan_iax2.c
channels/chan_vpb.c
channels/chan_zap.c
rtp.c

index 61562f70350391d1015f6227fcca96fbb4d9878d..8e38d35888fad69f98a421ee21729fad7c828ccc 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -2974,12 +2974,16 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
                }
                who = ast_waitfor_n(cs, 2, &toms);
                if (!who) {
+                       if (!toms) {
+                               res = AST_BRIDGE_RETRY;
+                               break;
+                       }
                        ast_log(LOG_DEBUG, "Nobody there, continuing...\n"); 
                        if (c0->_softhangup == AST_SOFTHANGUP_UNBRIDGE || c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE) {
                                if (c0->_softhangup == AST_SOFTHANGUP_UNBRIDGE)
-                                       c0->_softhangup = 0;
-                               if (c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE)
-                                       c1->_softhangup = 0;
+                                       c0->_softhangup = 0;
+                               if (c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE)
+                                       c1->_softhangup = 0;
                                c0->_bridge = c1;
                                c1->_bridge = c0;
                        }
@@ -3215,7 +3219,8 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
                                ast_clear_flag(c0, AST_FLAG_NBRIDGE);
                                ast_clear_flag(c1, AST_FLAG_NBRIDGE);
                        }
-                       
+                       if (res == AST_BRIDGE_RETRY)
+                               continue;
                        switch (res) {
                        case AST_BRIDGE_RETRY:
 /*                             continue; */
index 7292e9f09add47a5604d7931a2b7194f12573eef..4633f80d6df69d06283087699ca55c9691cec723 100755 (executable)
@@ -3184,6 +3184,10 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha
                                timeoutms = 0;
                }
                if (!who) {
+                       if (!timeoutms) {
+                               res = AST_BRIDGE_RETRY;
+                               break;
+                       }
                        if (ast_check_hangup(c0) || ast_check_hangup(c1)) {
                                res = AST_BRIDGE_FAILED;
                                break;
index cebe6e2f7ab89e44f60e03e51490bb80d5567af6..93ab04e67543807a419e77a7d96e822e76893ff2 100755 (executable)
@@ -518,6 +518,10 @@ static enum ast_bridge_result vpb_bridge(struct ast_channel *c0, struct ast_chan
                        /* Are we really ment to be doing nothing ?!?! */
                        who = ast_waitfor_n(cs, 2, &timeoutms);
                        if (!who) {
+                               if (!timeoutms) {
+                                       res = AST_BRIDGE_RETRY;
+                                       break;
+                               }
                                ast_log(LOG_DEBUG, "%s: vpb_bridge: Empty frame read...\n",p0->dev);
                                /* check for hangup / whentohangup */
                                if (ast_check_hangup(c0) || ast_check_hangup(c1))
index 077eba2f613bb606b58e3452a5d93a4930b85b42..eac9c21c0a5da4f9899b6f45450eccbe709216f8 100755 (executable)
@@ -3139,7 +3139,8 @@ static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_chann
                ast_mutex_unlock(&c0->lock);
                ast_mutex_unlock(&c1->lock);
 
-               if ((op0 != p0) ||
+               if (!timeoutms || 
+                   (op0 != p0) ||
                    (op1 != p1) || 
                    (ofd0 != c0->fds[0]) || 
                    (ofd1 != c1->fds[0]) ||
diff --git a/rtp.c b/rtp.c
index 468445e5f41ecab628940e1c4e103607376837cb..284e99b1b346d6956d36e176b2c4bc19f45caebe 100755 (executable)
--- a/rtp.c
+++ b/rtp.c
@@ -1677,6 +1677,8 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel
                }
                who = ast_waitfor_n(cs, 2, &timeoutms);
                if (!who) {
+                       if (!timeoutms) 
+                               return AST_BRIDGE_RETRY;
                        if (option_debug)
                                ast_log(LOG_DEBUG, "Ooh, empty read...\n");
                        /* check for hangup / whentohangup */