<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18819">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: delay contact pruning on Asterisk start<br><br>Move the call to ast_sip_location_prune_boot_contacts() *after* the call<br>to ast_res_pjsip_init_options_handling() so that<br>res/res_pjsip/pjsip_options.c is informed about the contact deletion and<br>updates its sip_options_contact_statuses list. This allows for an AMI<br>event to be sent by res/res_pjsip/pjsip_options.c if the endpoint<br>registers again from the same remote address and port (i.e., same URI)<br>as used before the Asterisk restart.<br><br>ASTERISK-30109<br>Reported-by: Michael Neuhauser<br><br>Change-Id: I1ba4478019e4931a7085f62708d9b66837e901a8<br>---<br>M res/res_pjsip.c<br>M res/res_pjsip/pjsip_configuration.c<br>2 files changed, 8 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip.c b/res/res_pjsip.c</span><br><span>index d722bbe..2febf3d 100644</span><br><span>--- a/res/res_pjsip.c</span><br><span>+++ b/res/res_pjsip.c</span><br><span>@@ -2766,6 +2766,14 @@</span><br><span> goto error;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /*</span><br><span style="color: hsl(120, 100%, 40%);">+ * It is OK to prune the contacts now that</span><br><span style="color: hsl(120, 100%, 40%);">+ * ast_res_pjsip_init_options_handling() has added the contact observer</span><br><span style="color: hsl(120, 100%, 40%);">+ * of res/res_pjsip/pjsip_options.c to sorcery (to ensure that any</span><br><span style="color: hsl(120, 100%, 40%);">+ * pruned contacts are removed from this module's data structure).</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_sip_location_prune_boot_contacts();</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if (ast_res_pjsip_init_message_filter()) {</span><br><span> ast_log(LOG_ERROR, "Failed to initialize message IP updating. Aborting load\n");</span><br><span> goto error;</span><br><span>diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c</span><br><span>index 5f1f61e..6bc978d 100644</span><br><span>--- a/res/res_pjsip/pjsip_configuration.c</span><br><span>+++ b/res/res_pjsip/pjsip_configuration.c</span><br><span>@@ -2280,8 +2280,6 @@</span><br><span> </span><br><span> load_all_endpoints();</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_sip_location_prune_boot_contacts();</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> acl_change_sub = stasis_subscribe(ast_security_topic(), acl_change_stasis_cb, NULL);</span><br><span> stasis_subscription_accept_message_type(acl_change_sub, ast_named_acl_change_type());</span><br><span> stasis_subscription_set_filter(acl_change_sub, STASIS_SUBSCRIPTION_FILTER_SELECTIVE);</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18819">change 18819</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/+/18819"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I1ba4478019e4931a7085f62708d9b66837e901a8 </div>
<div style="display:none"> Gerrit-Change-Number: 18819 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Michael Neuhauser <mike@firmix.at> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>