<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6582">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: Only do announcement logic between ringing cycles<br><br>This patch reverts the change by patch 2263 from old reviewboard.<br>Note that reverting that 2263-patch still preserves the behaviour that<br>the commit log of the 2263-patch claimed to add. The reason for this is:<br><br>The function wait_for_answer is only called from try_calling which<br>in turn is only called from the main for loop in queue_exec, and<br>earlier in that loop we already check the things that's removed by<br>this patch. There's no need to check those things twice each loop<br>iteration, and I think the proper place to check it is before each<br>ringing cycle. By checking it in wait_for_answer, you allow the issue<br>explained in the jira - that the head caller hears announcements while<br>the agents' sip phones are actively ringing.<br><br>Reported-by: Stefan Engström<br>Tested-by: Stefan Engström<br>ASTERISK-27216 #close<br><br>Change-Id: Ic4290dc75256f9743900c6762ee1bb915f672db0<br>---<br>M apps/app_queue.c<br>1 file changed, 4 insertions(+), 14 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/6582/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/apps/app_queue.c b/apps/app_queue.c<br>index ef40a89..b6079af 100644<br>--- a/apps/app_queue.c<br>+++ b/apps/app_queue.c<br>@@ -4831,7 +4831,7 @@<br>  *<br>  * \todo eventually all call forward logic should be intergerated into and replaced by ast_call_forward()<br>  */<br>-static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed, int ringing)<br>+static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed)<br> {<br>    const char *queue = qe->parent->name;<br>   struct callattempt *o, *start = NULL, *prev = NULL;<br>@@ -5348,16 +5348,6 @@<br>                   ast_frfree(f);<br>                }<br>     }<br>-<br>- /* Make a position announcement, if enabled */<br>-       if (qe->parent->announcefrequency && qe->parent->announce_to_first_user) {<br>-               say_position(qe, ringing);<br>-   }<br>-<br>-         /* Make a periodic announcement, if enabled */<br>-       if (qe->parent->periodicannouncefrequency && qe->parent->announce_to_first_user) {<br>-               say_periodic_announcement(qe, ringing);<br>-      }<br> <br>  if (!*to) {<br>           for (o = start; o; o = o->call_next) {<br>@@ -6788,7 +6778,7 @@<br>      ring_one(qe, outgoing, &numbusies);<br>       lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies,<br>                 ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT),<br>-         forwardsallowed, ringing);<br>+           forwardsallowed);<br> <br>  ao2_lock(qe->parent);<br>      if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_RRORDERED) {<br>@@ -8259,14 +8249,14 @@<br> <br>            if (makeannouncement) {<br>                       /* Make a position announcement, if enabled */<br>-                       if (qe.parent->announcefrequency)<br>+                 if (qe.parent->announcefrequency && qe.parent->announce_to_first_user)<br>                          if ((res = say_position(&qe,ringing)))<br>                                    goto stop;<br>            }<br>             makeannouncement = 1;<br> <br>              /* Make a periodic announcement, if enabled */<br>-               if (qe.parent->periodicannouncefrequency) {<br>+               if (qe.parent->periodicannouncefrequency && qe.parent->announce_to_first_user) {<br>                        if ((res = say_periodic_announcement(&qe,ringing))) {<br>                             goto stop;<br>                    }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6582">change 6582</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/6582"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic4290dc75256f9743900c6762ee1bb915f672db0 </div>
<div style="display:none"> Gerrit-Change-Number: 6582 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Stefan Engström <stefanen@kth.se> </div>