<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6095">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: Add 'moved_up' option to 'announce-position' setting<br><br>Change-Id: I173a124121422209485b043e2bf784f54242fce6<br>---<br>M CHANGES<br>M apps/app_queue.c<br>M configs/samples/queues.conf.sample<br>3 files changed, 26 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/6095/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/CHANGES b/CHANGES<br>index 5daa816..7df23fd 100644<br>--- a/CHANGES<br>+++ b/CHANGES<br>@@ -17,6 +17,11 @@<br> * PAUSEALL/UNPAUSEALL now sets the pause reason in the queue_log if it has<br> been defined.<br> <br>+ * A new option, "moved_up," has been added to the "announce-position"<br>+ configuration setting. Using this option will cause the Queue application<br>+ to announce the caller's position, but only if it has improved since we<br>+ last announced it.<br>+<br> ------------------------------------------------------------------------------<br> --- Functionality changes from Asterisk 14.6.0 to Asterisk 14.7.0 ------------<br> ------------------------------------------------------------------------------<br>diff --git a/apps/app_queue.c b/apps/app_queue.c<br>index 762119e..1e77ac8 100644<br>--- a/apps/app_queue.c<br>+++ b/apps/app_queue.c<br>@@ -1628,6 +1628,7 @@<br> #define ANNOUNCEPOSITION_NO 2 /*!< We don't announce position */<br> #define ANNOUNCEPOSITION_MORE_THAN 3 /*!< We say "Currently there are more than <limit>" */<br> #define ANNOUNCEPOSITION_LIMIT 4 /*!< We not announce position more than <limit> */<br>+#define ANNOUNCEPOSITION_MOVED_UP 5 /*!< Announce position if our position has improved */<br> <br> struct call_queue {<br> AST_DECLARE_STRING_FIELDS(<br>@@ -3166,6 +3167,8 @@<br> q->announceposition = ANNOUNCEPOSITION_LIMIT;<br> } else if (!strcasecmp(val, "more")) {<br> q->announceposition = ANNOUNCEPOSITION_MORE_THAN;<br>+ } else if (!strcasecmp(val, "moved_up")) {<br>+ q->announceposition = ANNOUNCEPOSITION_MOVED_UP;<br> } else if (ast_true(val)) {<br> q->announceposition = ANNOUNCEPOSITION_YES;<br> } else {<br>@@ -3911,6 +3914,11 @@<br> return 0;<br> }<br> <br>+ /* If our position has changed for the better, say position */<br>+ if (qe->parent->announceposition == ANNOUNCEPOSITION_MOVED_UP && qe->last_pos_said <= qe->pos) {<br>+ return 0;<br>+ }<br>+<br> if (ringing) {<br> ast_indicate(qe->chan,-1);<br> } else {<br>@@ -3919,6 +3927,7 @@<br> <br> if (qe->parent->announceposition == ANNOUNCEPOSITION_YES ||<br> qe->parent->announceposition == ANNOUNCEPOSITION_MORE_THAN ||<br>+ qe->parent->announceposition == ANNOUNCEPOSITION_MOVED_UP ||<br> (qe->parent->announceposition == ANNOUNCEPOSITION_LIMIT &&<br> qe->pos <= qe->parent->announcepositionlimit)) {<br> announceposition = 1;<br>diff --git a/configs/samples/queues.conf.sample b/configs/samples/queues.conf.sample<br>index b34a8d8..a7d6dea 100644<br>--- a/configs/samples/queues.conf.sample<br>+++ b/configs/samples/queues.conf.sample<br>@@ -314,14 +314,18 @@<br> ;announce-holdtime = yes|no|once<br> ;<br> ; Queue position announce?<br>-; Valid values are "yes," "no," "limit," or "more." If set to "no," then the caller's position will<br>-; never be announced. If "yes," then the caller's position in the queue will be announced<br>-; to the caller. If set to "more," then if the number of callers is more than the number<br>-; specified by the announce-position-limit option, then the caller will hear that there<br>-; are more than that many callers waiting (i.e. if a caller number 6 is in a queue with the<br>-; announce-position-limit set to 5, then that caller will hear that there are more than 5<br>-; callers waiting). If set to "limit," then only callers within the limit specified by announce-position-limit<br>-; will have their position announced.<br>+; Valid values are "yes," "no," "limit," "more," or "moved_up." If set to "no,"<br>+; then the caller's position will never be announced. If "yes," then the caller's<br>+; position in the queue will be announced to the caller. If set to "more," then<br>+; if the number of callers is more than the number specified by the<br>+; announce-position-limit option, then the caller will hear that there are more<br>+; than that many callers waiting (i.e. if a caller number 6 is in a queue with<br>+; the announce-position-limit set to 5, then that caller will hear that there are<br>+; more than 5 callers waiting). If set to "limit," then only callers within the<br>+; limit specified by announce-position-limit will have their position announced.<br>+; If set to "moved_up," the caller's position will be announced, but only if it<br>+; has improved (they've gotten closer to the head of the queue) since the last<br>+; time that we announced it.<br> ;<br> ;announce-position = yes<br> ;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6095">change 6095</a>. To unsubscribe, 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/6095"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I173a124121422209485b043e2bf784f54242fce6 </div>
<div style="display:none"> Gerrit-Change-Number: 6095 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Rodrigo Ramirez Norambuena <a@rodrigoramirez.com> </div>