]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Reset all DIAL variables back to blank, in case Dial is called multiple times
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 28 Oct 2008 17:04:56 +0000 (17:04 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 28 Oct 2008 17:04:56 +0000 (17:04 +0000)
per call (which could otherwise lead to inconsistent status reports).
(closes issue #13216)
 Reported by: ruddy
 Patches:
       20081014__bug13216.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ruddy

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

apps/app_dial.c

index 8eaacce9f433f6ec9c238c6a6e8f1107dee1e6e0..6c835fcec6d5fcaae4e08fc6ddc33ea2c17b0360 100644 (file)
@@ -877,6 +877,13 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                return -1;
        }
 
+       /* Reset all DIAL variables back to blank, to prevent confusion (in case we don't reset all of them). */
+       pbx_builtin_setvar_helper(chan, "DIALSTATUS", "");
+       pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", "");
+       pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", "");
+       pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", "");
+       pbx_builtin_setvar_helper(chan, "DIALEDTIME", "");
+
        u = ast_module_user_add(chan);
 
        parse = ast_strdupa(data);