<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/2869/">https://reviewboard.asterisk.org/r/2869/</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;">Ship It!</pre>
<br />
<p>- Matt</p>
<br />
<p>On September 18th, 2013, 6:57 p.m. UTC, Michael Young wrote:</p>
<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.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Michael Young.</div>
<p style="color: grey;"><i>Updated Sept. 18, 2013, 6:57 p.m.</i></p>
<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-22428">ASTERISK-22428</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;">1st Issue
When a realtime peer sends an un-REGISTER request, Asterisk un-registers the peer but the database table record still has regseconds and fullcontact for the peer. This results in calls attempting to be routed to the peer which is no longer registered. The expected behavior is to get busy/congested when attempting to call an un-registered peer through the dial plan.
What was discovered is that we are clearing out the peer's registration in the database in parse_register_contact() when calling expire_register() but then upon returning from parse_register_contact(), update_peer() is run which stores back in the database table regseconds and fullcontact.
2nd Issue
The 200 ok being returned by Asterisk after un-registering a peer contains a Contact header with ;expires= and the Expires header is not set to 0.
Tests were created for this second issue (ASTERISK-22548). The tests have been reviewed and a Ship It! was received on those tests.
Patch
* Do not ignore the Expires header value even when it is set to 0. The patch sets the pvt->expiry earlier on in the function so that it is set properly and used.
* If pvt->expiry is 0, do not call update_peer since that means the peer has already been un-registered and there is no need to update the database record again since nothing has changed.</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;">The reporter has tested this latest patch. He also helped to point out the Expires header problem.
Tested this on my local dev machines as well.</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/11/channels/chan_sip.c <span style="color: grey">(399258)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2869/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>