mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user