<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16370">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Kevin Harwell: Looks good to me, approved
  George Joseph: Looks good to me, but someone else must approve; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: Don't reset queue stats on reload<br><br>Prevents reloads of app_queue from also resetting<br>queue statistics.<br><br>Also preserves individual queue agent statistics<br>if we're just reloading members.<br><br>ASTERISK-28701<br><br>Change-Id: Ib5d4cdec175e44de38ef0f6ede4a7701751766f1<br>---<br>M apps/app_queue.c<br>A doc/CHANGES-staging/app_queue_stats.txt<br>2 files changed, 14 insertions(+), 3 deletions(-)<br><br></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 f5550bb..4d908a5 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -9335,9 +9335,13 @@</span><br><span>   if ((newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0, state_interface, ringinuse, wrapuptime))) {</span><br><span>                newm->wrapuptime = wrapuptime;</span><br><span>            if (cur) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      /* Round Robin Queue Position must be copied if this is replacing an existing member */</span><br><span>                      ao2_lock(q->members);</span><br><span style="color: hsl(120, 100%, 40%);">+                      /* Round Robin Queue Position must be copied if this is replacing an existing member */</span><br><span>                      newm->queuepos = cur->queuepos;</span><br><span style="color: hsl(120, 100%, 40%);">+                 /* Don't reset agent stats either */</span><br><span style="color: hsl(120, 100%, 40%);">+                      newm->calls = cur->calls;</span><br><span style="color: hsl(120, 100%, 40%);">+                       newm->lastcall = cur->lastcall;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                      ao2_link(q->members, newm);</span><br><span>                       ao2_unlink(q->members, cur);</span><br><span>                      ao2_unlock(q->members);</span><br><span>@@ -10402,7 +10406,7 @@</span><br><span>         }</span><br><span> </span><br><span>        if (!header_found) {</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_set_flag(&mask, AST_FLAGS_ALL);</span><br><span style="color: hsl(120, 100%, 40%);">+               ast_set_flag(&mask, AST_FLAGS_ALL & ~QUEUE_RESET_STATS);</span><br><span>     }</span><br><span> </span><br><span>        if (!reload_handler(1, &mask, queuename)) {</span><br><span>@@ -11141,7 +11145,7 @@</span><br><span>    } else if (!strcasecmp(a->argv[2], "parameters")) {</span><br><span>             ast_set_flag(&mask, QUEUE_RELOAD_PARAMETERS);</span><br><span>    } else if (!strcasecmp(a->argv[2], "all")) {</span><br><span style="color: hsl(0, 100%, 40%);">-               ast_set_flag(&mask, AST_FLAGS_ALL);</span><br><span style="color: hsl(120, 100%, 40%);">+               ast_set_flag(&mask, AST_FLAGS_ALL & ~QUEUE_RESET_STATS);</span><br><span>     }</span><br><span> </span><br><span>        if (a->argc == 3) {</span><br><span>diff --git a/doc/CHANGES-staging/app_queue_stats.txt b/doc/CHANGES-staging/app_queue_stats.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..36c0c3d</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_queue_stats.txt</span><br><span>@@ -0,0 +1,7 @@</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%);">+Reload behavior in app_queue has been changed so</span><br><span style="color: hsl(120, 100%, 40%);">+queue and agent stats are not reset during full</span><br><span style="color: hsl(120, 100%, 40%);">+app_queue module reloads. The queue reset stats</span><br><span style="color: hsl(120, 100%, 40%);">+CLI command may still be used to reset stats while</span><br><span style="color: hsl(120, 100%, 40%);">+Asterisk is running.</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16370">change 16370</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/+/16370"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ib5d4cdec175e44de38ef0f6ede4a7701751766f1 </div>
<div style="display:none"> Gerrit-Change-Number: 16370 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>