[asterisk-commits] trunk r19302 - in /trunk: ./ apps/app_dial.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Apr 11 13:11:37 MST 2006


Author: kpfleming
Date: Tue Apr 11 15:11:36 2006
New Revision: 19302

URL: http://svn.digium.com/view/asterisk?rev=19302&view=rev
Log:
Merged revisions 19301 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r19301 | kpfleming | 2006-04-11 15:11:01 -0500 (Tue, 11 Apr 2006) | 2 lines

handle call time limit properly when warning is requested _after_ call would hae already ended (issue #6356)

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_dial.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?rev=19302&r1=19301&r2=19302&view=diff
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Tue Apr 11 15:11:36 2006
@@ -841,6 +841,21 @@
 			ast_log(LOG_WARNING, "Dial does not accept L(%s), hanging up.\n", limit_str);
 			LOCAL_USER_REMOVE(u);
 			return -1;
+		} else if (play_warning > timelimit) {
+			/* If the first warning is requested _after_ the entire call would end,
+			   and no warning frequency is requested, then turn off the warning. If
+			   a warning frequency is requested, reduce the 'first warning' time by
+			   that frequency until it falls within the call's total time limit.
+			*/
+
+			if (!warning_freq) {
+				play_warning = 0;
+			} else {
+				while (play_warning > timelimit)
+					play_warning -= warning_freq;
+				if (play_warning < 1)
+					play_warning = warning_freq = 0;
+			}
 		}
 
 		var = pbx_builtin_getvar_helper(chan,"LIMIT_PLAYAUDIO_CALLER");



More information about the asterisk-commits mailing list