[asterisk-commits] res pjsip: Fix prune on boot to remove only contacts for the... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 16 06:30:42 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6225 )

Change subject: res_pjsip: Fix prune_on_boot to remove only contacts for the host.
......................................................................

res_pjsip: Fix prune_on_boot to remove only contacts for the host.

* Check that the contact's reg_server matches the host's name before
deleting any prune_on_boot contacts.  We don't want to delete reliable
transport contacts made with other servers if the ps_contacts database
table is shared with other servers.

Thanks to Ross Beer for pointing out that the original prune logic would
delete reliable transport contacts from other servers.

ASTERISK-27147

Change-Id: I8e439d0d1c266ffdfd7b73d1e5e466180a689bd0
---
M res/res_pjsip/location.c
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 09da2fc..ddde5c4 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -467,7 +467,10 @@
 {
 	struct ast_sip_contact *contact = obj;
 
-	if (contact->prune_on_boot) {
+	if (contact->prune_on_boot
+		&& !strcmp(contact->reg_server, ast_config_AST_SYSTEM_NAME ?: "")) {
+		ast_verb(3, "Removed contact '%s' from AOR '%s' due to system boot\n",
+			contact->uri, contact->aor);
 		ast_sip_location_delete_contact(contact);
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/6225
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I8e439d0d1c266ffdfd7b73d1e5e466180a689bd0
Gerrit-Change-Number: 6225
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170816/ee81818c/attachment-0001.html>


More information about the asterisk-commits mailing list