]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Wed, 27 Sep 2006 17:02:12 +0000 (17:02 +0000)
committerAutomerge script <automerge@asterisk.org>
Wed, 27 Sep 2006 17:02:12 +0000 (17:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@43791 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
res/res_features.c

index a823e67ca27b765412666ca27f1201c66df9444c..ae5d5f79c308e5fbc85e4753575f56168320ead9 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -3351,7 +3351,7 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
                if (bridge_end.tv_sec) {
                        to = ast_tvdiff_ms(bridge_end, ast_tvnow());
                        if (to <= 0) {
-                               res = AST_BRIDGE_RETRY;
+                               res = AST_BRIDGE_COMPLETE;
                                break;
                        }
                } else
@@ -3510,8 +3510,10 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
                if (!ast_tvzero(nexteventts)) {
                        now = ast_tvnow();
                        to = ast_tvdiff_ms(nexteventts, now);
-                       if (to < 0)
-                               to = 0;
+                       if (to <= 0) {
+                               res = AST_BRIDGE_COMPLETE;
+                               break;
+                       }
                }
 
                if (config->timelimit) {
index 3d6f22cc5faa7b36125df55df52e3e23444fba16..fc1b4af489d0e93421f4214bbf7f6311702788ad 100644 (file)
@@ -1274,7 +1274,6 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
        int hasfeatures=0;
        int hadfeatures=0;
        struct ast_option_header *aoh;
-       struct timeval start = { 0 , 0 };
        struct ast_bridge_config backup_config;
        char *monitor_exec;
 
@@ -1323,14 +1322,11 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
                peer->cdr = NULL;
        }
        for (;;) {
-               if (config->feature_timer)
-                       start = ast_tvnow();
-
                res = ast_channel_bridge(chan, peer, config, &f, &who);
 
                if (config->feature_timer) {
                        /* Update time limit for next pass */
-                       diff = ast_tvdiff_ms(ast_tvnow(), start);
+                       diff = ast_tvdiff_ms(ast_tvnow(), config->start_time);
                        config->feature_timer -= diff;
                        if (hasfeatures) {
                                /* Running on backup config, meaning a feature might be being
@@ -1367,7 +1363,12 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
                                        hadfeatures = hasfeatures;
                                        /* Continue as we were */
                                        continue;
-                               }
+                               } else if (!f) {
+                                       /* The bridge returned without a frame and there is a feature in progress.
+                                        * However, we don't think the feature has quite yet timed out, so just
+                                        * go back into the bridge. */
+                                       continue;
+                               }
                        } else {
                                if (config->feature_timer <=0) {
                                        /* We ran out of time */