I’ve been trying to see if res_mwi_external is a good solution for some non-voicemail related MWI needs. I already have voicemail on my Asterisk system and MWI working fine, but I am trying to add Station Message Waiting and thinking of the best way of doing that.
While the Asterisk documentation officially says app_voicemail and res_mwi_external cannot be used together, it seems there was a change 5 years ago which makes that no longer the case:
- app_voicemail and res_mwi_external can now be built together. The default remains to build app_voicemail and not res_mwi_external but if they are both built, the load order will cause res_mwi_external to load first and app_voicemail will be skipped. Use ‘preload=app_voicemail.so’ in modules.conf to force app_voicemail to be the voicemail provider.
Looking through the code, this seems like a good fit for my needs: asterisk/res_mwi_external.c at master · asterisk/asterisk · GitHub
I recompiled with res_mwi_external and added the preload => app_voicemail.so to my modules.conf as instructed so that voicemail would still work. Now, both are built together fine, but res_external_mwi will not load. If I try to manually load it, I get:
Unable to load module res_mwi_external Command 'module load res_mwi_external' failed. [2021-04-18 09:22:36] WARNING: app.c:457 __ast_vm_register: Voicemail provider already registered by app_voicemail. [2021-04-18 09:22:36] ERROR: res_mwi_external.c:941 load_module: Failure registering as a voicemail provider
So, it seems as if they cannot both be used simultaneously, which seems to contradict what the change suggested.
I don’t want to use res_mwi_external for voicemail, only for MWI. Right now, I can manually send an MWI notify with something like “sip notify activate-mwi mysipdevice” and clear using a similar CLI command. This works well for activating, but I only want to clear MWI if all messages are gone. The fact that voicemail also does MWI complicates things. It seemed res_mwi_external would allow for the creation of pseudo mailboxes to make this easier, including for lines without voicemail.
What I’m trying to avoid doing is storing messages in AstDB and then having to repeatedly send an MWI activate/clear notify every time, say, the phone goes back on hook. It seems res_mwi_external could handle the MWI for me - but can it really be used in conjunction with app_voicemail?