From a94c8562fd70bc5b317a434db36f19fd34c70f8c Mon Sep 17 00:00:00 2001 From: George Joseph Date: Thu, 20 Feb 2014 20:45:30 +0000 Subject: sorcery: Create sorcery instance registry. In order to retrieve an arbitrary sorcery instance from a dialplan function (or any place else) there needs to be a registry of sorcery instances. ast_sorcery_init now creates a hashtab as a registry. ast_sorcery_open now checks the hashtab for an existing sorcery instance matching the caller's module name. If it finds one, it bumps the refcount and returns it. If not, it creates a new sorcery instance, adds it to the hashtab, then returns it. ast_sorcery_retrieve_by_module_name is a new function that does a hashtab lookup by module name. It can be called by the future dialplan function. res_pjsip/config_system needed a small change to share the main res_pjsip sorcery instance. tests/test_sorcery was updated to include a test for the registry. (closes issue ASTERISK-22537) Review: http://reviewboard.asterisk.org/r/3184/ ........ Merged revisions 408518 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408519 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_pjsip/include/res_pjsip_private.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'res/res_pjsip/include') diff --git a/res/res_pjsip/include/res_pjsip_private.h b/res/res_pjsip/include/res_pjsip_private.h index 87ff7f3ac..00aeea49f 100644 --- a/res/res_pjsip/include/res_pjsip_private.h +++ b/res/res_pjsip/include/res_pjsip_private.h @@ -67,6 +67,11 @@ int ast_sip_initialize_outbound_authentication(void); */ int ast_sip_initialize_system(void); +/*! + * \brief Destroy system configuration + */ +void ast_sip_destroy_system(void); + /*! * \brief Initialize global configuration * -- cgit v1.2.3