]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Change the default calldurationlimit from the special value 0 to -1, so we
authorTilghman Lesher <tilghman@meg.abyt.es>
Sat, 13 Dec 2008 23:22:02 +0000 (23:22 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sat, 13 Dec 2008 23:22:02 +0000 (23:22 +0000)
can better detect an exceptional case.  This follows on to the changes made
in revision 156386.  Related to issue #13851.
(closes issue #13974)
 Reported by: paradise
 Patches:
       20081208__bug13974.diff.txt uploaded by Corydon76 (license 14)
 Tested by: file, blitzrage, ZX81

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

apps/app_dial.c

index 1cc08564a2e24711e6aecb515fffaeeee5e929a4..7e3f0ac63596d27d2ece9d02003d37ec461a9fec 100644 (file)
@@ -876,7 +876,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
        char numsubst[256];
        char cidname[AST_MAX_EXTENSION] = "";
        int privdb_val = 0;
-       unsigned int calldurationlimit = 0;
+       unsigned int calldurationlimit = -1;
        long timelimit = 0;
        long play_warning = 0;
        long warning_freq = 0;
@@ -1017,7 +1017,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                start_sound = S_OR(var, NULL);  /* XXX not much of a point in doing this! */
 
                /* undo effect of S(x) in case they are both used */
-               calldurationlimit = 0;
+               calldurationlimit = -1;
                /* more efficient to do it like S(x) does since no advanced opts */
                if (!play_warning && !start_sound && !end_sound && timelimit) {
                        calldurationlimit = timelimit / 1000;
@@ -1751,7 +1751,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                if (!res) {
                        if (calldurationlimit > 0) {
                                peer->whentohangup = time(NULL) + calldurationlimit;
-                       } else if (timelimit > 0) {
+                       } else if (calldurationlimit != -1 && timelimit > 0) {
                                /* Not enough granularity to make it less, but we can't use the special value 0 */
                                peer->whentohangup = time(NULL) + 1;
                        }