]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Tue, 11 Apr 2006 21:06:53 +0000 (21:06 +0000)
committerAutomerge script <automerge@asterisk.org>
Tue, 11 Apr 2006 21:06:53 +0000 (21:06 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@19344 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c
include/asterisk/linkedlists.h

index 5ec60606228d3a584474ee536b211310191e4f95..c323480b2634a65ff1b420611070a53baf1de79f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster@digium.com>
  *
@@ -827,6 +827,21 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                if (!timelimit) {
                        timelimit = play_to_caller = play_to_callee = play_warning = warning_freq = 0;
                        warning_sound = NULL;
+               } 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");
index ed1d48340d0c2709f313e57c0393d1513329e027..5f8a57b167b942965081a6e3b92540257a0b563d 100644 (file)
@@ -439,6 +439,7 @@ struct {                                                            \
                if ((head)->last == (elm))                              \
                        (head)->last = curelm;                          \
        }                                                               \
+        (elm)->field.next = NULL;                                       \
 } while (0)
 
 #endif /* _ASTERISK_LINKEDLISTS_H */