FreePBX Voicemail Integration for Cisco CME ssc 3/30/2024 FreePBX ver 16.0.40.7 Cisco CME ver 8.6 I have a Cisco CME less voicemail and I want to add voicemail to it. So here is a configuration of FreePBX and Cisco CME forIVR, Voicemail and MWI service. The (sip) PSTN and (sccp) extensions remain connected as-is to CME, with FreePBX added only for voicemail and ivr. My setup: +--------------------------------------+ | +-------------+ | | | FreePBX16.0 | | | +------+------+ | | 172.24.0.68| | | |sip | |172.24.0.161| | | +------+------+ t t t t | | | CiscoCME8.6 |---+--+--+--+--- | | +------+------+ Extensions | | | | | <-------+ | | PSTN | +--------------------------------------+ My dial plan: 1000~1039 --> User Extensions 1070~1079 --> Voicemail Service codes 1070=mwi-on, 1071=mwi-off, 1077=pilot, 1079=ivr 1081~1084 --> Call park 1088 --> Paging === FreePBX gui: 1. Setup the PJSIP trunk to CME Voice Router Connectivity> Trunks> +Add Trunk> +Add SIP General Tab> Trunk Name: CME-Router pjsip Settings Tab> Authentication: None, Sip Server: 172.24.0.161, Context: from-internal 2. Setup outbound route Connectivity> Outbound Routes> +Add Outbound Route Route Settings Tab> Route Name: 1, Trunk Seq: CME-Router Dial Patterns Tab> match pattern: 10[0-3]. match pattern: 910[0-3]. Settings> Voicemail Admin> Dialplan Behavior> Operator Extension: 91001 3. Setup extensions (voice mail users) Applications Tab> Extensions Tab> +Add Extension> + Add Virtual> General Tab> User Extension: 1001, Display Name: 1001 Voicemail Tab> Enabled: Yes 4. Setup service extensions and dial route Admin> Config Edit> extensions_custom.conf add the following lines below between >>> and <<< >>> [from-internal] exten => 1077,1,VoicemailMain(${CALLERID(NUM)},s) exten => 1077,2,Wait(1) exten => 1077,3,Hangup [from-did-direct-ivr] exten => _10[0-3]X,1,goto(outbound-allroutes,${EXTEN},1) exten => _10[0-3]X#,1,goto(outbound-allroutes,${EXTEN:0:4},1) <<< Applications> Misc Destinations> Add Misc Destination> Description: 1078, Dial: *98 Applications> Misc Applications> Add Misc Application> Description: 1078, Feature Code: 1078, Destination: Misc Destinations> 1078 5. Setup IVR Admin> System Recordings> Add Recording> Name: basic-pbx-ivr-main, Add System Recording: Select> basic-pbx-ivr-main Applications> IVR> Add-IVR> IVR Name: Main, Announcement: basic-pbx-ivr-main, Enable Direct Dial: Enabled 6. Setup Ext for IVR Applications> Misc Applications> Add Misc Application> Description: 1079, Feature Code: 1079, Destination: IVR> Main 7. Setup Voicemail External Notify Settings> Voicemail Admin> Settings> External Notify=/home/asterisk/vm.sh 8. Cli into FreePBX, create /home/asterisk/vm.sh add the following lines below between >>> and <<< >>> #!/bin/bash if [ 0 -lt $3 ] then asterisk -rx "channel originate PJSIP/1070$2@CME-Router application Playback tt$ else asterisk -rx "channel originate PJSIP/1071$2@CME-Router application Playback tt$ fi <<< 9. Run the commands to set file permissions chown asterisk:asterisk /home/asterisk/vm.sh chmod 774 /home/asterisk/vm.sh === === CME-Router cli: 1. Add voicemail to the telephony-service telephony-service voicemail 1077 2. Setup the MWI extensions ephone-dn 70 number 1070.... no-reg both mwi on ! ephone-dn 71 number 1071.... no-reg both mwi off 3. Add FreePBX IP to trusted hosts voice service voip ip address trusted list ipv4 172.24.0.68 4. Add call forward busy and noan on the extensions ephone-dn 1 number 1001.... no-reg both call-forward busy 5001001 call-forward noan 5001001 timeout 20 ! ephone-dn 2 number 1002.... no-reg both call-forward busy 5001002 call-forward noan 5001002 timeout 20 ! ephone-dn 79 number 1079.... no-reg both call-forward all 5001079 5. Setup translation rules for FreePBX voice translation-rule 10 rule 1 /50010/ /10/ ! voice translation-profile VM_FORWARD translate called 10 ! voice translation-rule 90 rule 1 /^9/ // ! voice translation-profile FreePBX translate called 90 6. Setup dial-peers for FreePBX dial-peer voice 1070 voip description **VM PILOT** destination-pattern 1077 session protocol sipv2 session target ipv4:172.24.0.68 dtmf-relay rtp-nte codec g711ulaw no vad ! dial-peer voice 1071 voip description **FROM FREEPBX** translation-profile incoming FreePBX session protocol sipv2 session target ipv4:172.24.0.161 incoming called-number 910[0-3]. dtmf-relay rtp-nte codec g711ulaw no vad ! dial-peer voice 1072 voip description **CALL FWD BUSY NOAN** translation-profile outgoing VM_FORWARD destination-pattern 50010..$ session protocol sipv2 session target ipv4:172.24.0.68 dtmf-relay rtp-nte codec g711ulaw no vad === Troubleshooting mwi asterisk -rvvv (mwi on) -- Executing [s@app-missedcall-hangup:7] AGI("PJSIP/CME-Router-0000009a", "agi://127.0.0.1/missedcallnotify.php,s,,s,0,,PJSIP/CME-Router-0000009a,,,,") in new stack -- Remote UNIX connection -- Remote UNIX connection disconnected -- Called 10711001@CME-Router -- AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0 (mwi off) -- Executing [s@app-missedcall-hangup:7] AGI("PJSIP/CME-Router-0000009c", "agi://127.0.0.1/missedcallnotify.php,s,,s,0,,PJSIP/CME-Router-0000009c,CHANUNAVAIL,,,") in new stack -- Remote UNIX connection -- Remote UNIX connection disconnected -- Called 10701002@CME-Router -- PJSIP/CME-Router-0000009d is ringing -- AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0