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



<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;">
 <tr>
  <td>
   <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been discarded.</h1>
  </td>
 </tr>
</table>
<br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers and rmudgett.</div>
<div>By George Joseph.</div>


<p style="color: grey;"><i>Updated April 11, 2015, 4:06 p.m.</i></p>









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


<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;">Currently when Asterisk starts initial qualifies of contacts are spread out randomly between 0 and qualify_timeout to prevent network and system overload.  If a contact's qualify_frequency is 5 minutes however, that contact may be unavailable to accept calls for the entire 5 minutes after startup.  So while staggering the initial qualifies is a good idea, basing the time on qualify_timeout could leave contacts unavailable for too long.

This patch adds a new global parameter "max_initial_qualify_time" that sets the maximum time for the initial qualifies.  This way you could make sure that all your contacts are initialy, ransomly qualified within say 30 seconds but still have the contact's ongoing qualifies at a 5 minute interval.

If max_initial_qualify_time is > 0, the formula is initial_interval = min(max_initial_interval, qualify_timeout * random().  If not set, qualify_timeout is used.

The default is "0" (disabled).

</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;">Tested in my own pbx with 15 endpoints.  If max_initial_qualify_time is > 0 and < qualify_time, it's used, otherwise qualify_timeout is used.

Testsuite test forthcoming.
</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>branches/13/res/res_pjsip/pjsip_options.c <span style="color: grey">(434653)</span></li>

 <li>branches/13/res/res_pjsip/config_global.c <span style="color: grey">(434653)</span></li>

 <li>branches/13/res/res_pjsip.c <span style="color: grey">(434653)</span></li>

 <li>branches/13/include/asterisk/res_pjsip.h <span style="color: grey">(434653)</span></li>

 <li>branches/13/contrib/ast-db-manage/config/versions/45119a33fbbe_add_pjsip_max_initial_qualify_time.py <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/13/CHANGES <span style="color: grey">(434653)</span></li>

</ul>

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







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




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