[Asterisk-code-review] res_pjsip_registrar: Remove unavailable contacts if exceeds max_contacts (asterisk[16])

Joe asteriskteam at digium.com
Wed Aug 11 11:52:51 CDT 2021


Attention is currently required from: Sean Bright, Joshua Colp, Kevin Harwell.
Joe has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16160 )

Change subject: res_pjsip_registrar: Remove unavailable contacts if exceeds max_contacts
......................................................................


Patch Set 7:

(2 comments)

File res/res_pjsip_registrar.c:

https://gerrit.asterisk.org/c/asterisk/+/16160/comment/ced3ed26_e77ae29e 
PS7, Line 593: 		if (!remove_existing) {
             : 			registrar_contact_delete(CONTACT_DELETE_UNAVAILABLE, NULL, contact, contact->aor);
             : 		} else {
             : 			registrar_contact_delete(CONTACT_DELETE_EXISTING, NULL, contact, contact->aor);
             : 		}
> I'm not sure if this is correct. […]
Yes, but once remove_existing is enabled, then we can just chalk up the removal to remove_existing.  We anyway want to remove a contact, we just picked the unavail one.


https://gerrit.asterisk.org/c/asterisk/+/16160/comment/6be1505c_d7c54202 
PS7, Line 927: contact_count = ao2_container_count(existing_contacts) + updated + added;
             : 		if (contact_count > aor->max_contacts) {
             : 			/* Remove excess existing contacts that are unavailable or expire soonest */
             : 			remove_excess_contacts(existing_contacts, contacts, contact_count - aor->max_contacts,
             : 				aor->remove_existing);
             : 		}
> If unavailable contacts have been removed should the existing contacts now be updated and then check […]
We only enter this branch if !aor->remove_existing so I don't think it's a factor.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16160
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ia2711b08f2b4d1177411b1be23e970d7fdff5784
Gerrit-Change-Number: 16160
Gerrit-PatchSet: 7
Gerrit-Owner: Joe <ynadiv at corpit.xyz>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Wed, 11 Aug 2021 16:52:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210811/3ff6709e/attachment.html>


More information about the asterisk-code-review mailing list