]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
ensure that the 'feature digit timeout' value is taken into account when deciding...
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 1 Aug 2006 23:07:06 +0000 (23:07 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 1 Aug 2006 23:07:06 +0000 (23:07 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@38686 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
res/res_features.c

index b2c29b3cb528d2ed068aaf8d2e0caa19f42b644b..efc099b0d33edb87f8e4767dd09e98148be182c3 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -3380,7 +3380,6 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
        struct timeval nexteventts = { 0, };
        char caller_warning = 0;
        char callee_warning = 0;
-       int to;
 
        if (c0->_bridge) {
                ast_log(LOG_WARNING, "%s is already in a bridge with %s\n", 
@@ -3432,20 +3431,28 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
        o0nativeformats = c0->nativeformats;
        o1nativeformats = c1->nativeformats;
 
-       if (config->timelimit) {
+       if (config->feature_timer) {
+               nexteventts = ast_tvadd(config->start_time, ast_samp2tv(config->feature_timer, 1000));
+       } else if (config->timelimit) {
                nexteventts = ast_tvadd(config->start_time, ast_samp2tv(config->timelimit, 1000));
                if (caller_warning || callee_warning)
                        nexteventts = ast_tvsub(nexteventts, ast_samp2tv(config->play_warning, 1000));
        }
 
        for (/* ever */;;) {
+               struct timeval now;
+               int to;
+
                to = -1;
-               if (config->timelimit) {
-                       struct timeval now;
+
+               if (!ast_tvzero(nexteventts)) {
                        now = ast_tvnow();
                        to = ast_tvdiff_ms(nexteventts, now);
                        if (to < 0)
                                to = 0;
+               }
+
+               if (config->timelimit) {
                        time_left_ms = config->timelimit - ast_tvdiff_ms(now, config->start_time);
                        if (time_left_ms < to)
                                to = time_left_ms;
index 703b7fd82e0bfb5d46ebef049223cab7f0cfc4db..3d6f22cc5faa7b36125df55df52e3e23444fba16 100644 (file)
@@ -1472,6 +1472,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
                                        config->start_sound = NULL;
                                        config->firstpass = 0;
                                }
+                               config->start_time = ast_tvnow();
                                config->feature_timer = featuredigittimeout;
                                ast_log(LOG_DEBUG, "Set time limit to %ld\n", config->feature_timer);
                        }