<p> Attention is currently required from: Joshua Colp, George Joseph, Kevin Harwell. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/16160">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_registrar.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16160/comment/abce0780_d4114d19">Patch Set #11, Line 733:</a> <code style="font-family:monospace,monospace">                        remove_excess_contacts(unavail_contacts, contacts, contact_count - aor->max_contacts, aor->remove_existing);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">If for some reason 'unavail_contacts' is NULL here (which it could because 'ast_sip_location_retriev […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">We have a null check at line 726, and if it fails unavail_count is 0 at line 731, so this branch will not be executed.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16160/comment/724879a2_8ea69a61">Patch Set #11, Line 736:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">                 contacts = ast_sip_location_retrieve_aor_contacts_nolock(aor);<br>                        if (!contacts) {<br>                              response->code = 500;<br>                              pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), details.pool);<br>                         return;<br>                       }<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Were you able to determine why the contacts are not being removed from the 'contacts' container in t […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Agreed that this is hacky.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I based this idea of the original version of the remove_existing code before this commit:</p><p style="white-space: pre-wrap; word-wrap: break-word;">https://github.com/asterisk/asterisk/commit/cbf082ed53aa669b999ba57b80966e3382d773d4</p><p style="white-space: pre-wrap; word-wrap: break-word;">I cannot figure out why contacts is not updating as it really is supposed to.  I hate to ask, but since @jcolp wrote the commit above, maybe he can shed some light on why this might not work?  If I can figure this part out it will fix multiple potential issues.</p><p style="white-space: pre-wrap; word-wrap: break-word;">As far the the unref, contacts gets unref'd at the end of this function (keep in mind that contacts already exists here, we're just refreshing it).</p><p style="white-space: pre-wrap; word-wrap: break-word;">Your second point is valid but I don't know of another way to grab the contacts once they've been changed.</p><p style="white-space: pre-wrap; word-wrap: break-word;">A concern I had is what would happen if max_contacts=1 and remove_unavail=yes, then after the (only) contact is removed we'll return a 500.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16160">change 16160</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16160"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ia2711b08f2b4d1177411b1be23e970d7fdff5784 </div>
<div style="display:none"> Gerrit-Change-Number: 16160 </div>
<div style="display:none"> Gerrit-PatchSet: 11 </div>
<div style="display:none"> Gerrit-Owner: Joe <ynadiv@corpit.xyz> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-CC: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Attention: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 23 Sep 2021 01:45:47 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>