]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix broken attended transfers
authorJeff Peeler <jpeeler@digium.com>
Wed, 27 May 2009 16:49:38 +0000 (16:49 +0000)
committerJeff Peeler <jpeeler@digium.com>
Wed, 27 May 2009 16:49:38 +0000 (16:49 +0000)
The bridge was terminating immediately after the attended transfer was
completed. The problem was because upon reentering ast_channel_bridge
nexteventts was checked to see if it was set and if so could possibly
return AST_BRIDGE_COMPLETE.

(closes issue #15183)
Reported by: andrebarbosa
Tested by: andrebarbosa, tootai, loloski

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197124 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/channel.h
main/channel.c

index 29713b8ca0401e4177fb9890f971eec335081653..8757a3ad493db0742f3eb0b1b6c50acca0772943 100644 (file)
@@ -534,6 +534,7 @@ struct ast_bridge_config {
        struct ast_flags features_callee;
        struct timeval start_time;
        struct timeval nexteventts;
+       struct timeval partialfeature_timer;
        long feature_timer;
        long timelimit;
        long play_warning;
index 74929dcbbd69439eef8e3f0e55b803f6138eaf54..00a379970404fc9ebe17c692eacb2392a8924e06 100644 (file)
@@ -3961,10 +3961,11 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
                ast_jb_empty_and_reset(c0, c1);
 
        if (config->feature_timer > 0 && ast_tvzero(config->nexteventts)) {
-               /* nexteventts is not set when the bridge is not scheduled to
-                * break, so calculate when the bridge should possibly break
+               /* calculate when the bridge should possibly break
                 * if a partial feature match timed out */
-               config->nexteventts = ast_tvadd(ast_tvnow(), ast_samp2tv(config->feature_timer, 1000));
+               config->partialfeature_timer = ast_tvadd(ast_tvnow(), ast_samp2tv(config->feature_timer, 1000));
+       } else {
+               memset(&config->partialfeature_timer, 0, sizeof(config->partialfeature_timer));
        }
 
        for (;;) {
@@ -3994,8 +3995,8 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
                         * to not break, leave the channel bridge when the feature timer
                         * time has elapsed so the DTMF will be sent to the other side. 
                         */
-                       if (!ast_tvzero(config->nexteventts)) {
-                               int diff = ast_tvdiff_ms(config->nexteventts, ast_tvnow());
+                       if (!ast_tvzero(config->partialfeature_timer)) {
+                               int diff = ast_tvdiff_ms(config->partialfeature_timer, ast_tvnow());
                                if (diff <= 0) {
                                        res = AST_BRIDGE_RETRY;
                                        break;