]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_registrar: Remove unavailable contacts if exceeds max_contacts
authorJoseph Nadiv <ynadiv@corpit.xyz>
Wed, 21 Jul 2021 21:36:03 +0000 (17:36 -0400)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Fri, 24 Sep 2021 16:48:22 +0000 (11:48 -0500)
commit6a04c430352728d0acab2ad57e9d25c0f0092228
tree999f2804448b82286295434cc3b8ed8898143eac
parent35a94ec708a40a6ceeaf43a9c18d563bd748cacd
res_pjsip_registrar: Remove unavailable contacts if exceeds max_contacts

The behavior of max_contacts and remove_existing are connected.  If
remove_existing is enabled, the soonest expiring contacts are removed.
This may occur when there is an unavailable contact.  Similarly,
when remove_existing is not enabled, registrations from good
endpoints are rejected in favor of retaining unavailable contacts.

This commit adds a new AOR option remove_unavailable, and the effect
of this setting will depend on remove_existing.  If remove_existing
is set to no, we will still remove unavailable contacts when they
exceed max_contacts, if there are any. If remove_existing is set to
yes, we will prioritize the removal of unavailable contacts before
those that are expiring soonest.

ASTERISK-29525

Change-Id: Ia2711b08f2b4d1177411b1be23e970d7fdff5784
configs/samples/pjsip.conf.sample
contrib/ast-db-manage/config/versions/f56d79a9f337_pjsip_create_remove_unavailable.py [new file with mode: 0644]
doc/CHANGES-staging/res_pjsip_registrar.txt [new file with mode: 0644]
include/asterisk/res_pjsip.h
res/res_pjsip.c
res/res_pjsip/location.c
res/res_pjsip_registrar.c