<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2121/">https://reviewboard.asterisk.org/r/2121/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On September 20th, 2012, 10:44 a.m., <b>Mark Michelson</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/2121/diff/3/?file=31315#file31315line1690" style="color: black; font-weight: bold; text-decoration: underline;">trunk/apps/app_queue.c</a>
<span style="font-weight: normal;">
(Diff revision 3)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int handle_statechange(void *datap)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1690</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="cm">/* check every member until we find one NOT_INUSE */</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1691</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">avail</span> <span class="o">&&</span> <span class="p">(</span><span class="n">m</span><span class="o">-></span><span class="n">status</span> <span class="o">==</span> <span class="n">AST_DEVICE_NOT_INUSE</span><span class="p">)</span> <span class="o">&&</span> <span class="o">!</span><span class="n">m</span><span class="o">-></span><span class="n">paused</span><span class="p">)</span> <span class="p">{</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1692</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                                <span class="n">avail</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1693</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This isn't sufficient to determine if a member is available.
For instance, members who use analog devices will appear as AST_DEVICE_UNKNOWN when they are currently available.
Also, if the queue has ringinuse set to "yes" then members who are AST_DEVICE_INUSE are considered available to the queue.
There is a function available called num_available_members() that can be used to determine the number of members available for a queue. Use that instead.</pre>
</blockquote>
<p>On September 20th, 2012, 11:14 a.m., <b>Matt Jordan</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">You wouldn't be able to directly call num_available_members, as you just want to determine whether or not a member is actually available - not the number of available members. You'd have to refactor out the portion of num_available_members that determines if a member is available to be callable by num_avilable_members and by this function.
That's a fairly minor correction that can be made to this patch.</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">queue_function_mem_read() to determine if a member is 'free' does the same, I copied it :)
Perhaps to be closer to what I trying to achieve for 'available' I should have copied the 'ready' check from queue_function_mem_read().
What I was trying to achieve with an 'available' light is;
if a call was put through there would be minimal reason for the call to go unanswered by a human, as agent(s) are in theory logged in and available to take a call.
</pre>
<br />
<p>- Alec</p>
<br />
<p>On September 19th, 2012, 4:45 p.m., Alec Davis wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Alec Davis.</div>
<p style="color: grey;"><i>Updated Sept. 19, 2012, 4:45 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Receptionist will love this.
The ability to see via a BLF that some members are logged in and free to take the calls. "I'll just put you through now", with less chance that the call goes to voicemail or what ever dialplan logic then followed.
When all agents are logged out, the BLF goes INUSE.
When agents are logged in, but are all busy, the BLF goes INUSE.
Like any BLF, if INUSE the call may go to Voicemail, at least the Operator can warn the caller.
When an agent is free to take a call the BLF goes NOT_IN_USE, IE. can put a call through.
Related to https://reviewboard.asterisk.org/r/1619/
I did think about combining the queue ringing hint from review 1619 but it's a different function, and only required by co-workers that may be able to help.
Many other divisions want to be able to drop a call into a queue, with the prior knowledge that it should be answered (NOTINUSE), or will possibly go to voicemail (INUSE).
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">In use on our headoffice production system.
Below is a hint for our itg_queue
exten => 8501,hint,Queue:itg_queue_avail
Note: '_avail' is added to the queuename</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>trunk/CHANGES <span style="color: grey">(373162)</span></li>
<li>trunk/apps/app_queue.c <span style="color: grey">(373162)</span></li>
<li>trunk/configs/extensions.conf.sample <span style="color: grey">(373162)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2121/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>