<p>Jaco Kroon has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19950">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: periodic announcement configurable start time.<br><br>This newly introduced periodic-announce-startdelay makes it possible to<br>configure the initial start delay of the first periodic announcement<br>after which periodic-announce-frequency takes over.<br><br>ASTERISK-30437 #close<br>Change-Id: Ia79984b6377ef78f167ad9ea2ac084bec29955d0<br>Signed-off-by: Jaco Kroon <jaco@uls.co.za><br>---<br>M apps/app_queue.c<br>M configs/samples/queues.conf.sample<br>A doc/CHANGES-staging/app_queue.txt<br>3 files changed, 39 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/50/19950/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index f549af7..d2de993 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -1856,6 +1856,7 @@</span><br><span>         int announcepositionlimit;          /*!< How many positions we announce? */</span><br><span>       int announcefrequency;              /*!< How often to announce their position */</span><br><span>  int minannouncefrequency;           /*!< The minimum number of seconds between position announcements (def. 15) */</span><br><span style="color: hsl(120, 100%, 40%);">+ int periodicannouncestartdelay;     /*!< How long into the queue should the periodic accouncement start */</span><br><span>        int periodicannouncefrequency;      /*!< How often to play periodic announcement */</span><br><span>       int numperiodicannounce;            /*!< The number of periodic announcements configured */</span><br><span>       int randomperiodicannounce;         /*!< Are periodic announcments randomly chosen */</span><br><span>@@ -2987,6 +2988,7 @@</span><br><span>     q->weight = 0;</span><br><span>    q->timeoutrestart = 0;</span><br><span>    q->periodicannouncefrequency = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+  q->periodicannouncestartdelay = -1;</span><br><span>       q->randomperiodicannounce = 0;</span><br><span>    q->numperiodicannounce = 0;</span><br><span>       q->relativeperiodicannounce = 0;</span><br><span>@@ -3445,6 +3447,8 @@</span><br><span>                  ast_str_set(&q->sound_periodicannounce[0], 0, "%s", val);</span><br><span>                   q->numperiodicannounce = 1;</span><br><span>               }</span><br><span style="color: hsl(120, 100%, 40%);">+     } else if (!strcasecmp(param, "periodic-announce-startdelay")) {</span><br><span style="color: hsl(120, 100%, 40%);">+            q->periodicannouncestartdelay = atoi(val);</span><br><span>        } else if (!strcasecmp(param, "periodic-announce-frequency")) {</span><br><span>            q->periodicannouncefrequency = atoi(val);</span><br><span>         } else if (!strcasecmp(param, "relative-periodic-announce")) {</span><br><span>@@ -8613,6 +8617,10 @@</span><br><span>    qe.last_pos_said = 0;</span><br><span>        qe.last_pos = 0;</span><br><span>     qe.last_periodic_announce_time = time(NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (qe.parent->periodicannouncestartdelay >= 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+               qe.last_periodic_announce_time += qe.parent->periodicannouncestartdelay;</span><br><span style="color: hsl(120, 100%, 40%);">+           qe.last_periodic_announce_time -= qe.parent->periodicannouncefrequency;</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span>    qe.last_periodic_announce_sound = 0;</span><br><span>         qe.valid_digits = 0;</span><br><span>         if (join_queue(args.queuename, &qe, &reason, position)) {</span><br><span>diff --git a/configs/samples/queues.conf.sample b/configs/samples/queues.conf.sample</span><br><span>index fbb5653..d8308ca 100644</span><br><span>--- a/configs/samples/queues.conf.sample</span><br><span>+++ b/configs/samples/queues.conf.sample</span><br><span>@@ -291,6 +291,13 @@</span><br><span> ;</span><br><span> ;periodic-announce-frequency=60</span><br><span> ;</span><br><span style="color: hsl(120, 100%, 40%);">+; If given indicates the number of seconds after entering the queue the first</span><br><span style="color: hsl(120, 100%, 40%);">+; periodic announcement should be played.  The default (and historic) behavior</span><br><span style="color: hsl(120, 100%, 40%);">+; is to play the first periodic announcement at periodic-announce-frequency</span><br><span style="color: hsl(120, 100%, 40%);">+; seconds after entering the queue.</span><br><span style="color: hsl(120, 100%, 40%);">+;</span><br><span style="color: hsl(120, 100%, 40%);">+;periodic-announce-startdelay=10</span><br><span style="color: hsl(120, 100%, 40%);">+;</span><br><span> ; Should the periodic announcements be played in a random order? Default is no.</span><br><span> ;</span><br><span> ;random-periodic-announce=no</span><br><span>diff --git a/doc/CHANGES-staging/app_queue.txt b/doc/CHANGES-staging/app_queue.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..f71bcb0</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_queue.txt</span><br><span>@@ -0,0 +1,9 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_queue</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Introduce a new queue configuration option called</span><br><span style="color: hsl(120, 100%, 40%);">+'periodic-announce-startdelay' which will vary the normal (historic) behavior</span><br><span style="color: hsl(120, 100%, 40%);">+of starting the periodic announcement cycle at periodic-announce-frequency</span><br><span style="color: hsl(120, 100%, 40%);">+seconds after entering the queue to start the periodic announcement cycle at</span><br><span style="color: hsl(120, 100%, 40%);">+period-announce-startdelay seconds after joining the queue.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The default behavior if this config option is not set remains unchanged.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19950">change 19950</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19950"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: Ia79984b6377ef78f167ad9ea2ac084bec29955d0 </div>
<div style="display:none"> Gerrit-Change-Number: 19950 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>