From 9e2b2a9837bc25adfc4a6d760a8ffa7bb4d379d9 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 15 Aug 2017 11:14:20 -0500 Subject: 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 --- res/res_pjsip/location.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'res') diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index 557aeb6b9..2273273e3 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -460,7 +460,10 @@ static int prune_boot_contacts_cb(void *obj, void *arg, int flags) { 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); } -- cgit v1.2.3