summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorMatthew Nicholson <mnicholson@digium.com>2009-11-09 16:28:31 +0000
committerMatthew Nicholson <mnicholson@digium.com>2009-11-09 16:28:31 +0000
commitaabff54c4bfb687714df72119a0241af6a14edf4 (patch)
treeaaa40c2e99c78775d8af21bd824d466099e9a7e3 /apps/app_queue.c
parentfef304e641b301205fa231b6a201584cf7021779 (diff)
Add the 'relative-periodic-announce' option to app_queue to allow for calculating the time of announcments from the end of the previous announcment rather than from the beginning.
(closes issue #15260) Reported by: tonils git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index bdbb91560..c0b32ff90 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -930,6 +930,7 @@ struct call_queue {
unsigned int maskmemberstatus:1;
unsigned int realtime:1;
unsigned int found:1;
+ unsigned int relativeperiodicannounce:1;
enum empty_conditions joinempty;
enum empty_conditions leavewhenempty;
int announcepositionlimit; /*!< How many positions we announce? */
@@ -1720,6 +1721,8 @@ static void queue_set_param(struct call_queue *q, const char *param, const char
}
} else if (!strcasecmp(param, "periodic-announce-frequency")) {
q->periodicannouncefrequency = atoi(val);
+ } else if (!strcasecmp(param, "relative-periodic-announce")) {
+ q->relativeperiodicannounce = ast_true(val);
} else if (!strcasecmp(param, "random-periodic-announce")) {
q->randomperiodicannounce = ast_true(val);
} else if (!strcasecmp(param, "retry")) {
@@ -3029,7 +3032,10 @@ static int say_periodic_announcement(struct queue_ent *qe, int ringing)
}
/* update last_periodic_announce_time */
- qe->last_periodic_announce_time = now;
+ if (qe->parent->relativeperiodicannounce)
+ time(&qe->last_periodic_announce_time);
+ else
+ qe->last_periodic_announce_time = now;
/* Update the current periodic announcement to the next announcement */
if (!qe->parent->randomperiodicannounce) {