<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/4587/">https://reviewboard.asterisk.org/r/4587/</a>
     </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.</div>
<div>By George Joseph.</div>


<p style="color: grey;"><i>Updated April 10, 2015, 12:13 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Addressed Josh's comments.
Killed a few more RAII_VARs.
Added CHANGES.
Added the alembic script which I forgot to 'svn add' before creating the patch.

</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/ASTERISK-24863">ASTERISK-24863</a>


</div>



<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;">This is the second follow-on to https://reviewboard.asterisk.org/r/4572/ and the discussion at http://lists.digium.com/pipermail/asterisk-dev/2015-March/073921.html 

The basic issues are that changes in contact status don't cause events to be emitted for the associated endpoint.  Only dynamic contact add/delete actions update the endpoint.  Also, the qualify timeout is fixed by pjsip at 32 seconds which is a long time.

This patch makes use of the new transaction timeout feature in r4585 and provides the following capabilities...

1.  A new aor/contact variable 'qualify_timeout' has been added that allows the user to specify the maximum time in milliseconds to wait for a response to an OPTIONS mesasge.  The default is 3000ms.  When the timer expires, the contact is marked unavailable.

2.  Contact status changes are now propagated up to the endpoint as follows...  When any contact is 'Available', the endpoint is marked as 'Reachable'.  When all contacts are 'Unavailable', the endpoint is marked as 'Unreachable'.  The existing endpoint events are generated appropriately.

</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;">Existing tests are unchanged.  I'm working on new testsuite tests to check the new functionality.

Tested-by: Dmitriy Serov
</pre>
  </td>
 </tr>
</table>


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

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

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

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

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

 <li>branches/13/main/endpoints.c <span style="color: grey">(434638)</span></li>

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

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

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

 <li>branches/13/configs/samples/pjsip.conf.sample <span style="color: grey">(434638)</span></li>

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

</ul>

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







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




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