voicemail: Move app_voicemail / res_mwi_external conflict to runtime
authorGeorge Joseph <george.joseph@fairview5.com>
Wed, 30 Dec 2015 16:49:03 +0000 (09:49 -0700)
committerGeorge Joseph <george.joseph@fairview5.com>
Mon, 4 Jan 2016 23:31:24 +0000 (17:31 -0600)
commit6d18fe151c0e88924737c8b7a986a7278fd120bc
tree2aae54dfd57384a4d71424034ee568be9c7cef68
parent839f328601ff0a98a6c6b4fb6ca73445f264588f
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
CHANGES
apps/app_voicemail.c
include/asterisk/app.h
include/asterisk/module.h
main/app.c
res/res_mwi_external.c