<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/1541/">https://reviewboard.asterisk.org/r/1541/</a>
     </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">As far as fixing this issue is concerned, this looks ok to me.

When I last looked in app_queue, I noticed that the membercount was incremented inconsistently.  However, I could not figure out what membercount was supposed to be counting since it seemed to be keeping track of two different types of members.  Membercount may not really be necessary as a stand alone element anymore since the ao2 container holding the members keeps a count of the objects in the container.</pre>
 <br />







<p>- rmudgett</p>


<br />
<p>On October 24th, 2011, 8:05 p.m., Terry Wilson 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 Terry Wilson.</div>


<p style="color: grey;"><i>Updated Oct. 24, 2011, 8:05 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;">With the situation:
queues.conf
[test]
strategy=ringall
member =&gt; Local/queue1@default,1
member =&gt; Local/queue2@default,1
member =&gt; Local/queue3@default,1

extensions.conf
[default]
exten =&gt; 100,1,Queue(test)
exten =&gt; _queueX,1,NoOp(Called ${EXTEN})
same =&gt; n,Ringing
same =&gt; n,Wait(5)
same =&gt; n,Hangup

Dialing 100 will ring all queue members. Changing the penalty of two of the members and doing a &#39;module reload app_queue.so&#39; and redialing would still ring all of the members on the first try instead of just the lowest penalty member. This was because a reload would set the membercount to 0 and then only increase the membercount for *new* members and not reloaded members. Then, since the penaltymemberlimit = 0 and the membercount = 0, we ignored the penalties and would dial all members.  This patch increases the member count for both reloaded and added members since we set the member count to zero on reloads anyway.</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;">Fixes the above scenario.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/AST-676">AST-676</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/branches/1.8/apps/app_queue.c <span style="color: grey">(342060)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1541/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>