pjsip: Update ACLs on named ACL changes.

This change extends the Sorcery API to allow a wizard to be
told to explicitly reload objects or a specific object type
even if the wizard believes that nothing has changed.

This has been leveraged by res_pjsip and res_pjsip_acl to
reload endpoints and PJSIP ACLs when a named ACL changes.

ASTERISK-28697

Change-Id: Ib8fee9bd9dd490db635132c479127a4114c1ca0b
This commit is contained in:
Joshua C. Colp
2020-02-18 13:10:16 +00:00
committed by Joshua Colp
parent 78b01f41ae
commit d6712790cd
5 changed files with 112 additions and 1 deletions

View File

@@ -323,6 +323,9 @@ struct ast_sorcery_wizard {
/* \brief Callback for whether or not the wizard believes the object is stale */
int (*is_stale)(const struct ast_sorcery *sorcery, void *data, void *object);
/*! \brief Optional callback for forcing a reload to occur, even if wizard has determined no changes */
void (*force_reload)(void *data, const struct ast_sorcery *sorcery, const char *type);
};
/*! \brief Interface for a sorcery object type observer */
@@ -1059,6 +1062,17 @@ void ast_sorcery_load_object(const struct ast_sorcery *sorcery, const char *type
*/
void ast_sorcery_reload(const struct ast_sorcery *sorcery);
/*!
* \brief Inform any wizards to reload persistent objects, even if no changes determined
*
* \param sorcery Pointer to a sorcery structure
*
* \since 13.32.0
* \since 16.9.0
* \since 17.3.0
*/
void ast_sorcery_force_reload(const struct ast_sorcery *sorcery);
/*!
* \brief Inform any wizards of a specific object type to reload persistent objects
*
@@ -1067,6 +1081,19 @@ void ast_sorcery_reload(const struct ast_sorcery *sorcery);
*/
void ast_sorcery_reload_object(const struct ast_sorcery *sorcery, const char *type);
/*!
* \brief Inform any wizards of a specific object type to reload persistent objects
* even if no changes determined
*
* \param sorcery Pointer to a sorcery structure
* \param type Name of the object type to reload
*
* \since 13.32.0
* \since 16.9.0
* \since 17.3.0
*/
void ast_sorcery_force_reload_object(const struct ast_sorcery *sorcery, const char *type);
/*!
* \brief Increase the reference count of a sorcery structure
*