[asterisk-commits] mnicholson: trunk r228947 - in /trunk: ./ apps/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 9 10:28:35 CST 2009


Author: mnicholson
Date: Mon Nov  9 10:28:31 2009
New Revision: 228947

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=228947
Log:
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

Modified:
    trunk/CHANGES
    trunk/apps/app_queue.c
    trunk/configs/queues.conf.sample

Modified: trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/trunk/CHANGES?view=diff&rev=228947&r1=228946&r2=228947
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Mon Nov  9 10:28:31 2009
@@ -158,6 +158,9 @@
   * A new option, 'I' has been added to both app_queue and app_dial.
     By setting this option, Asterisk will not update the caller with
     connected line changes or redirecting party changes when they occur.
+  * A 'relative-peroidic-announce' option has been added to queues.conf.  When
+    enabled, this option will cause periodic announce times to be calculated
+    from the end of announcements rather than from the beginning.
 
 mISDN channel driver (chan_misdn) changes
 ----------------------------------------

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=228947&r1=228946&r2=228947
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon Nov  9 10:28:31 2009
@@ -930,6 +930,7 @@
 	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 @@
 		}
 	} 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 @@
 	}
 
 	/* 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) {

Modified: trunk/configs/queues.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/queues.conf.sample?view=diff&rev=228947&r1=228946&r2=228947
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Mon Nov  9 10:28:31 2009
@@ -253,6 +253,12 @@
 ; Should the periodic announcements be played in a random order? Default is no.
 ;
 ;random-periodic-announce=no
+;
+; If set to yes, the periodic announcment frequency will be timed from the end
+; of each announcment rather than from the start of each announcment.  This
+; defaults to off.
+;
+;relative-periodic-announce=yes
 ;
 ; Should we include estimated hold time in position announcements?
 ; Either yes, no, or only once.




More information about the asterisk-commits mailing list