aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-11 20:11:36 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-11 20:11:36 +0000
commitfb65069ee540628a2ca356cb16f01a560e07a562 (patch)
treee944fdb93f967cb2664065d7cff5acbaa6ab9122 /apps
parenta30eab6ea04f57e14520d6fe9a19bf10d1535b83 (diff)
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) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@19302 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index e2eb2b80b..0ee6e3f8b 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -841,6 +841,21 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
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");