[Asterisk-code-review] Add reload options to CLI/AMI stale object commands. (asterisk[13])

Mark Michelson asteriskteam at digium.com
Mon Jan 30 15:55:48 CST 2017


Mark Michelson has posted comments on this change. ( https://gerrit.asterisk.org/4818 )

Change subject: Add reload options to CLI/AMI stale object commands.
......................................................................


Patch Set 2:

> Works ok for outbound registrations.
 > Doesn't work for qualify.  No change when calling with reload.

I've investigated, and essentially the way that qualifies are handled is a bit...bad, we'll say. Taking the cache out of the equation, the ONLY way to get qualifies to get updated is one of the following:
* For permanent contacts, reload res_pjsip.so.
* For dynamic contacts, wait for a reregistration.

Let's examine this one-by-one.

Permanent contacts are initially created when an AOR is loaded from its backend. You would suspect that retrieving an updated AOR would update the permanent contact to have its updated qualify setting applied. You would be wrong. Instead, the reason that reloading actually works is because in res_pjsip.c, reloading calls ast_res_pjsip_init_options_handling(). That causes the OPTIONs code to iterate over permanent contacts on AORs and update the qualify settings.

With dynamic contacts, the registrar code specifically applies qualify settings from the AOR to the updated contact when the contact is re-registered.

What would be better is if retrieving an AOR with updated qualify frequency resulted in updating all its contacts (permanent or dynamic) to apply the new qualify settings. If such a change were made, then using the command in this code review to mark an AOR stale and reload it would result in qualifies being updated. It would also centralize some logic with regards to updating qualify settings for contacts and contact_statuses.

I will submit this as a follow-up change to this one.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ieb1fe7270ceed491f057ec5cbf0e097bde96c5c8
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list