<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11203">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: Fix a few member pause bugs<br><br>* Always set member->lastpause when setting member->paused<br><br>* Fixed typo (using member->lastcall instead of member->lastpause) in<br> 'queue show' output.<br><br>* Use a constant 'now' in 'queue show' output for a better point-in-time<br> view of time based stats.<br><br>ASTERISK-27541 #close<br>Reported by: César Benjamín García Martínez<br><br>Change-Id: Ib41ced90cfdb66f9bb1e7b263d0f6fc1ac6e18fa<br>---<br>M apps/app_queue.c<br>1 file changed, 11 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/03/11203/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 2ad468d..6cda3b3 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -3463,6 +3463,9 @@</span><br><span> ast_copy_string(m->rt_uniqueid, rt_uniqueid, sizeof(m->rt_uniqueid));</span><br><span> if (paused_str) {</span><br><span> m->paused = paused;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (paused) {</span><br><span style="color: hsl(120, 100%, 40%);">+ time(&m->lastpause); /* XXX: Should this come from realtime? */</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> ast_devstate_changed(m->paused ? QUEUE_PAUSED_DEVSTATE : QUEUE_UNPAUSED_DEVSTATE,</span><br><span> AST_DEVSTATE_CACHABLE, "Queue:%s_pause_%s", q->name, m->interface);</span><br><span> }</span><br><span>@@ -9749,14 +9752,14 @@</span><br><span> mem->dynamic ? ast_term_color(COLOR_CYAN, COLOR_BLACK) : "", mem->dynamic ? " (dynamic)" : "", ast_term_reset(),</span><br><span> mem->realtime ? ast_term_color(COLOR_MAGENTA, COLOR_BLACK) : "", mem->realtime ? " (realtime)" : "", ast_term_reset(),</span><br><span> mem->starttime ? ast_term_color(COLOR_BROWN, COLOR_BLACK) : "", mem->starttime ? " (in call)" : "", ast_term_reset());</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if (mem->paused) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_strlen_zero(mem->reason_paused)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_str_append(&out, 0, " %s(paused was %ld secs ago)%s",</span><br><span style="color: hsl(0, 100%, 40%);">- ast_term_color(COLOR_BROWN, COLOR_BLACK), (long) (time(NULL) - mem->lastpause), ast_term_reset());</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_str_append(&out, 0, " %s(paused:%s was %ld secs ago)%s", ast_term_color(COLOR_BROWN, COLOR_BLACK),</span><br><span style="color: hsl(0, 100%, 40%);">- mem->reason_paused, (long) (time(NULL) - mem->lastcall), ast_term_reset());</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_str_append(&out, 0, " %s(paused%s%s was %ld secs ago)%s",</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_term_color(COLOR_BROWN, COLOR_BLACK),</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_strlen_zero(mem->reason_paused) ? "" : ":",</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_strlen_zero(mem->reason_paused) ? "" : mem->reason_paused,</span><br><span style="color: hsl(120, 100%, 40%);">+ (long) (now - mem->lastpause),</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_term_reset());</span><br><span> }</span><br><span> </span><br><span> ast_str_append(&out, 0, " (%s%s%s)",</span><br><span>@@ -9766,7 +9769,7 @@</span><br><span> ast_devstate2str(mem->status), ast_term_reset());</span><br><span> if (mem->calls) {</span><br><span> ast_str_append(&out, 0, " has taken %d calls (last was %ld secs ago)",</span><br><span style="color: hsl(0, 100%, 40%);">- mem->calls, (long) (time(NULL) - mem->lastcall));</span><br><span style="color: hsl(120, 100%, 40%);">+ mem->calls, (long) (now - mem->lastcall));</span><br><span> } else {</span><br><span> ast_str_append(&out, 0, " has taken no calls yet");</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11203">change 11203</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/+/11203"/><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: Ib41ced90cfdb66f9bb1e7b263d0f6fc1ac6e18fa </div>
<div style="display:none"> Gerrit-Change-Number: 11203 </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-MessageType: newchange </div>