Asterisk MWI with CUCM integration not working

Hello All,

I am using Asterisk 11.17.1/Freepbx as voicemail server for Cisco phones that I have registered to Cisco Call Manager. I have SIP trunk between CUCM and Freepbx and i am successfully able to leave and retrieve voice messages for the Cisco phone registered to CUCM. However, the MWI part is still not working. I configured the script for MWI from the link https://community.freepbx.org/t/cisco-call-manager-freepbx-for-voicemail/10711/4 and I have specified the file name in externnotify under voicemail.conf. But its still not working. When I try to run the script manually by doing ./vm.sh, I get below warnings on the asterisk cli.

[2017-07-19 17:48:23] WARNING[3206]: pbx_spool.c:289 apply_outgoing: At least one of app or extension must be specified, along with tech and dest in file /var/spool/asterisk/outgoing/.call
[2017-07-19 17:48:23] WARNING[3206]: pbx_spool.c:456 scan_service: Invalid file contents in /var/spool/asterisk/outgoing/.call, deleting

My script looks like below:

#!/bin/bash
CONTEXT=$1
EXTEN=$2
NUMVMS=$3

Turnoff="Channel: SIP/[email protected]\nCallerid: $EXTEN\nMaxRetries: 0\nRetryTime: 5\nWaitTime: 5\nContext: $CONTEXT\nExtension: $EXTEN"

Turnon="Channel: SIP/[email protected]\nCallerid: $EXTEN\nMaxRetries: 0\nRetryTime: 5\nWaitTime: 5\nContext: $CONTEXT\nExtension: $EXTEN"

if [[ $NUMVMS = "0" ]]; then
echo -e $Turnoff >> /var/spool/asterisk/outgoing/$date.call
else
echo -e $Turnon >> /var/spool/asterisk/outgoing/$date.call
fi

Also when I try to run the channel command ( echo -e Channel: SIP/[email protected]\nCallerid: 1205\nMaxRetries: 0\nRetryTime: 5\nWaitTime: 5\nContext: default\nExtension: 1205 >> /var/spool/asterisk/outgoing/$date.call) from the CLI it gives me same errors, as if the script is not getting the variable values from asterisk.

Can someone please help me how I can make MWI working for the phones registered to CUCM?

Other information:

Phone is configured as “custom” extension in asterisk.
I have MWI extensions (28888 and 288889) configured in CUCM.
I dont see asterisk trying to make a call to CUCM for MWI extensions when a message is left on voicemail.

Thanks!

Shivani

Hello,

Anyone has any ideas? Or any other way I can implement MWI?

I enabled debug level 2 and I saw below error message related to the voicemail. I am not sure why it says the folder is not available…

DEBUG[31438][C-0000304a] app_voicemail.c: /var/spool/asterisk/voicemail/default/1205/unavail doesn’t exist, doing what we can

1205 is my extension I am trying to leave the voice message for and as you see below asterisk has access to it.

drwxrwx— 6 asterisk asterisk 4096 Jul 17 18:38 1205

Thanks!

Thanks for the reply dicko. Once I changed the extension on Asterisk to virtual from custom, it started working. I am not sure why my script with externotify did not get activated if the extension is custom. It would be interesting to know. Also another difference is that when I configure extension as custom, I dont have to enter the extension (voicemail box) when we try to access the voicemail from an extension. It directly takes to password, which is good. Do you know if there is a way I can set virtual extension so that when the user tries to retrieve the voicemail, he does not have to enter his mailbox number/extension again?

Reading the WIKI and indeed the GUI itself, you will discover apropos voicemail

Require From Same Extension yes no

Maybe select NO ?