[asterisk-commits] tilghman: branch 1.4 r164082 - /branches/1.4/apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Dec 13 17:22:03 CST 2008


Author: tilghman
Date: Sat Dec 13 17:22:02 2008
New Revision: 164082

URL: http://svn.digium.com/view/asterisk?view=rev&rev=164082
Log:
Change the default calldurationlimit from the special value 0 to -1, so we
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

Modified:
    branches/1.4/apps/app_dial.c

Modified: branches/1.4/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_dial.c?view=diff&rev=164082&r1=164081&r2=164082
==============================================================================
--- branches/1.4/apps/app_dial.c (original)
+++ branches/1.4/apps/app_dial.c Sat Dec 13 17:22:02 2008
@@ -876,7 +876,7 @@
 	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 @@
 		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 @@
 		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;
 			}




More information about the asterisk-commits mailing list