summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2014-04-02 18:57:29 +0000
committerMark Michelson <mmichelson@digium.com>2014-04-02 18:57:29 +0000
commiteefcb79bfb4ce2bd0236fc4bb5d960a6df9f3cc4 (patch)
tree15e35325d8e0cd53f0dae6bfbb987abb84456bc2 /res
parentc704795dcbc5caa5676a1685d6a5996e92875ae9 (diff)
Prevent duplicate sorcery wizards from being applied to sorcery object types.
This commit contains several changes to sorcery: 1) Application of sorcery configuration based on module name is automatically performed when sorcery is opened for a module. 2) Sorcery will not attempt to apply the same wizard to an object type more than once. 3) Sorcery gives more exact results when attempting to apply a wizard, whether as the default or based on configuration. Sorcery unit tests still pass for me after making these changes. Review: https://reviewboard.asterisk.org/r/3326 ........ Merged revisions 411159 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_mwi_external.c6
-rw-r--r--res/res_pjsip/config_system.c2
-rw-r--r--res/res_pjsip/pjsip_configuration.c2
3 files changed, 2 insertions, 8 deletions
diff --git a/res/res_mwi_external.c b/res/res_mwi_external.c
index c3fc0eaf4..875f32773 100644
--- a/res/res_mwi_external.c
+++ b/res/res_mwi_external.c
@@ -163,10 +163,8 @@ static int mwi_sorcery_init(void)
}
/* Map the external MWI wizards. */
- res = !!ast_sorcery_apply_config(mwi_sorcery, "res_mwi_external");
- res &= !!ast_sorcery_apply_default(mwi_sorcery, MWI_MAILBOX_TYPE, "astdb",
- MWI_ASTDB_PREFIX);
- if (res) {
+ if (ast_sorcery_apply_default(mwi_sorcery, MWI_MAILBOX_TYPE, "astdb",
+ MWI_ASTDB_PREFIX) == AST_SORCERY_APPLY_FAIL) {
ast_log(LOG_ERROR, "MWI external: Sorcery could not setup wizards.\n");
return -1;
}
diff --git a/res/res_pjsip/config_system.c b/res/res_pjsip/config_system.c
index f88b96b89..7f8da8597 100644
--- a/res/res_pjsip/config_system.c
+++ b/res/res_pjsip/config_system.c
@@ -117,8 +117,6 @@ int ast_sip_initialize_system(void)
return -1;
}
- ast_sorcery_apply_config(system_sorcery, "res_pjsip");
-
ast_sorcery_apply_default(system_sorcery, "system", "config", "pjsip.conf,criteria=type=system");
if (ast_sorcery_object_register_no_reload(system_sorcery, "system", system_alloc, NULL, system_apply)) {
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 164ca4a0e..857805a83 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -1619,8 +1619,6 @@ int ast_res_pjsip_initialize_configuration(const struct ast_module_info *ast_mod
return -1;
}
- ast_sorcery_apply_config(sip_sorcery, "res_pjsip");
-
ast_sip_initialize_cli();
if (ast_sip_initialize_sorcery_auth()) {