<p>Rodrigo Ramirez Norambuena has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16355">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: Add LoginTime field for member in a queue:<br><br>Add a time_t logintime to storage a time when a member is added into a<br>queue.<br><br>Also, includes show this time (in seconds) using a 'queue show' command<br>and the field LoginTime for response for AMI events.<br><br>ASTERISK-16394 #close<br><br>Change-Id: Ied6c3a300f78d78eebedeb3e16a1520fc3fff190<br>---<br>M apps/app_queue.c<br>1 file changed, 13 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/55/16355/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 fdc5211..25e97df 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -1080,6 +1080,9 @@</span><br><span> <parameter name="LastPause"></span><br><span> <para>The time when started last paused the queue member.</para></span><br><span> </parameter></span><br><span style="color: hsl(120, 100%, 40%);">+ <parameter name="LoginTime"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>The time when a member login into the queue.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </parameter></span><br><span> <parameter name="InCall"></span><br><span> <para>Set to 1 if member is in call. Set to 0 after LastCall time is updated.</para></span><br><span> <enumlist></span><br><span>@@ -1615,6 +1618,7 @@</span><br><span> time_t starttime; /*!< The time at which the member answered the current caller. */</span><br><span> time_t lastcall; /*!< When last successful call was hungup */</span><br><span> time_t lastpause; /*!< When started the last pause */</span><br><span style="color: hsl(120, 100%, 40%);">+ time_t logintime; /*!< The time when started the login */</span><br><span> struct call_queue *lastqueue; /*!< Last queue we received a call */</span><br><span> unsigned int dead:1; /*!< Used to detect members deleted in realtime */</span><br><span> unsigned int delme:1; /*!< Flag to delete entry on reload */</span><br><span>@@ -2263,7 +2267,7 @@</span><br><span> </span><br><span> static struct ast_json *queue_member_blob_create(struct call_queue *q, struct member *mem)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: i, s: i, s: i, s: i, s: i, s: i, s: i, s: s, s: i, s: i}",</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: i, s: i, s: i, s: i, s: i, s: i, s: i, s: i, s: s, s: i, s: i}",</span><br><span> "Queue", q->name,</span><br><span> "MemberName", mem->membername,</span><br><span> "Interface", mem->interface,</span><br><span>@@ -2273,6 +2277,7 @@</span><br><span> "CallsTaken", mem->calls,</span><br><span> "LastCall", (int)mem->lastcall,</span><br><span> "LastPause", (int)mem->lastpause,</span><br><span style="color: hsl(120, 100%, 40%);">+ "LoginTime", (int)mem->logintime,</span><br><span> "InCall", mem->starttime ? 1 : 0,</span><br><span> "Status", mem->status,</span><br><span> "Paused", mem->paused,</span><br><span>@@ -2701,6 +2706,7 @@</span><br><span> if (paused) {</span><br><span> time(&cur->lastpause); /* Update time of last pause */</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ time(&cur->logintime);</span><br><span> ast_copy_string(cur->interface, interface, sizeof(cur->interface));</span><br><span> if (!ast_strlen_zero(state_interface)) {</span><br><span> ast_copy_string(cur->state_interface, state_interface, sizeof(cur->state_interface));</span><br><span>@@ -9735,6 +9741,10 @@</span><br><span> } else {</span><br><span> ast_str_append(&out, 0, " has taken no calls yet");</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_str_append(&out, 0, " %s(login 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%);">+ (long) (now - mem->logintime),</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_term_reset());</span><br><span> do_print(s, fd, ast_str_buffer(out));</span><br><span> ao2_ref(mem, -1);</span><br><span> }</span><br><span>@@ -10177,6 +10187,7 @@</span><br><span> "CallsTaken: %d\r\n"</span><br><span> "LastCall: %d\r\n"</span><br><span> "LastPause: %d\r\n"</span><br><span style="color: hsl(120, 100%, 40%);">+ "LoginTime: %d\r\n"</span><br><span> "InCall: %d\r\n"</span><br><span> "Status: %d\r\n"</span><br><span> "Paused: %d\r\n"</span><br><span>@@ -10185,7 +10196,7 @@</span><br><span> "%s"</span><br><span> "\r\n",</span><br><span> q->name, mem->membername, mem->interface, mem->state_interface, mem->dynamic ? "dynamic" : "static",</span><br><span style="color: hsl(0, 100%, 40%);">- mem->penalty, mem->calls, (int)mem->lastcall, (int)mem->lastpause, mem->starttime ? 1 : 0, mem->status,</span><br><span style="color: hsl(120, 100%, 40%);">+ mem->penalty, mem->calls, (int)mem->lastcall, (int)mem->lastpause, (int)mem->logintime, mem->starttime ? 1 : 0, mem->status,</span><br><span> mem->paused, mem->reason_paused, mem->wrapuptime, idText);</span><br><span> ++q_items;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16355">change 16355</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/+/16355"/><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-Change-Id: Ied6c3a300f78d78eebedeb3e16a1520fc3fff190 </div>
<div style="display:none"> Gerrit-Change-Number: 16355 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Rodrigo Ramirez Norambuena <a@rodrigoramirez.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>