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

Kevin Harwell asteriskteam at digium.com
Wed Aug 11 12:13:11 CDT 2021


Attention is currently required from: Sean Bright, Joshua Colp, Joe.
Kevin Harwell 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 8:

(3 comments)

File res/res_pjsip/location.c:

https://gerrit.asterisk.org/c/asterisk/+/16160/comment/559a4b40_cdb3237a 
PS7, Line 209: return unreachable ? 0 : CMP_MATCH;
> I know, that confused me too. […]
Aah yes I see now. I was thinking it was removing vs keeping.

Leaving it two separate functions is fine. A bit of code duplication but I agree on the readability side.


File res/res_pjsip_registrar.c:

https://gerrit.asterisk.org/c/asterisk/+/16160/comment/b3969650_76a2626b 
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);
             : 		}
> Yes, but once remove_existing is enabled, then we can just chalk up the removal to remove_existing. […]
Ack


https://gerrit.asterisk.org/c/asterisk/+/16160/comment/46120cf5_e9aa88ef 
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);
             : 		}
> We only enter this branch if !aor->remove_existing so I don't think it's a factor.
Ack



-- 
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: 8
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: Joe <ynadiv at corpit.xyz>
Gerrit-Comment-Date: Wed, 11 Aug 2021 17:13:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joe <ynadiv at corpit.xyz>
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/a780b7a6/attachment.html>


More information about the asterisk-code-review mailing list