summaryrefslogtreecommitdiff
path: root/main/app.c
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2015-12-30 09:49:03 -0700
committerGeorge Joseph <george.joseph@fairview5.com>2016-01-04 16:28:48 -0700
commit4ec85a9f076d64d01110da32817e40fb96cd5321 (patch)
treeafeb222c5a92466a99705baa2a5ed11e4c6f3f3b /main/app.c
parentf42036bf6b4a188dd9a083669c9a00e37203e51c (diff)
voicemail: Move app_voicemail / res_mwi_external conflict to runtime
The menuselect conflict between app_voicemail and res_mwi_external makes it hard to package 1 version of Asterisk. There no actual build dependencies between the 2 so moving this check to runtime seems like a better solution. The ast_vm_register and ast_vm_greeter_register functions in app.c were modified to return AST_MODULE_LOAD_DECLINE instead of -1 if there is already a voicemail module registered. The modules' load_module functions were then modified to return DECLINE instead of -1 to the loader. Since -1 is interpreted by the loader as AST_MODULE_LOAD_FAILURE, the modules were incorrectly causing Asterisk to stop so this needed to be cleaned up anyway. Now you can build both and use modules.conf to decide which voicemail implementation to load. The default menuselect options still build app_voicemail and not res_mwi_external but if both ARE built, res_mwi_external will load first and become the voicemail provider unless modules.conf rules prevent it. This is noted in CHANGES. Change-Id: I7d98d4e8a3b87b8df9e51c2608f0da6ddfb89247
Diffstat (limited to 'main/app.c')
-rw-r--r--main/app.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/app.c b/main/app.c
index 8c33b9146..c4143d840 100644
--- a/main/app.c
+++ b/main/app.c
@@ -494,7 +494,7 @@ int __ast_vm_register(const struct ast_vm_functions *vm_table, struct ast_module
if (table) {
ast_log(LOG_WARNING, "Voicemail provider already registered by %s.\n",
table->module_name);
- return -1;
+ return AST_MODULE_LOAD_DECLINE;
}
table = ao2_alloc_options(sizeof(*table), NULL, AO2_ALLOC_OPT_LOCK_NOLOCK);
@@ -605,7 +605,7 @@ int __ast_vm_greeter_register(const struct ast_vm_greeter_functions *vm_table, s
if (table) {
ast_log(LOG_WARNING, "Voicemail greeter provider already registered by %s.\n",
table->module_name);
- return -1;
+ return AST_MODULE_LOAD_DECLINE;
}
table = ao2_alloc_options(sizeof(*table), NULL, AO2_ALLOC_OPT_LOCK_NOLOCK);