Asterisk PBX as Voicemail for CUCM

Asterisk PBX as Voicemail for CUCM

Configure Asterisk PBX as Voicemail Server for Cisco Unified Communications Manager (CUCM) which will use SIP Trunk Integration between the Asterisk and CUCM.  The callers can deposit voicemail if the extension is busy/unavailable/unregistered. The end users can also listen to their voicemail as well.

How are we going to achieve this? 

Our scenario:

Extension Range on CUCM and Asterisk – 8109XXXX
Voicemail Pilot – *81099999
No Answer, Busy, Unregistered call forwarding to VM on Extensions – *8109XXXX   (Replace XXXX with the last 4 digit of extension configured on CUCM/Asterisk)

What are we going to do in our taken scenario?

On Cisco Unified Communications Manager –

We will create two extensions in Cisco Unified Communications Manager i.e., 81091000 and 81091001.
We will create a Route Pattern with *.8109XXXX and point it to SIP Trunk to Asterisk. We will discard pre-dot characters.
We will create a Voicemail Pilot with *81099999
We will create a Voicemail Profile and associate *8109999 Voicemail Pilot

On Asterisk PBX Server-

We will configure the same number in Asterisk as Virtual Extension as 81091000 and 81091001 and enable voicemail and create Voicemail password for the extensions.
We will create a Misc. Destination and point it to *97
We will create Inbound Route with 8109999 and Point it to Misc. Destination

Configuration on Cisco Unified Communications Manager : 

Configure Voicemail Pilot and Voicemail Profile

  • Go to Advance Features > Voice Mail > Voice Mail Pilot > Add New
  • Voice Mail Pilot Number > *81099999
  • Calling Search Space > Select appropriate Calling Search Space
  • Description > Voicemail Pilot to Asterisk PBX
  • Click on Save
  • Go to Advance Features > Voice Mail > Voice Mail Profile > Add New
  • Voice Mail Profile Name * > Asterisk-VMP
  • Description > Asterisk Voicemail Profile
  • Voice Mail Pilot ** > Select *81099999 from the drop down menu
  • Click on Save

Configure Extensions in CUCM

  • Create a extension as 81091000
  • Associate Asterisk-VMP as created in the above step
  • Forward Busy Internal > *81091000 and assign appropriate Calling Search Space
    Forward Busy External > *81091000 and assign appropriate Calling Search Space
    Forward No Answer Internal > *81091000 and assign appropriate Calling Search Space
    Forward No Answer External > *81091000 and assign appropriate Calling Search Space
    Forward No Coverage Internal > *81091000 and assign appropriate Calling Search Space
    Forward No Coverage External > *81091000 and assign appropriate Calling Search Space
    Forward on CTI Failure > *81091000 and assign appropriate Calling Search Space
    Forward Unregistered Internal > *81091000 and assign appropriate Calling Search Space
    Forward Unregistered External > *81091000 and assign appropriate Calling Search Space
  • Similarly create another extension as 81091001 and use the same forward procedure as *81091000 but replace 1000 with 1001

Configure Route Pattern

  • Go to Call Routing > Route/Hunt > Route Pattern
  • Click on Add New
  • Route Pattern > *.8109XXXX
  • Route Partition > Select appropriate Route Partition
  • Description > Route Pattern to Asterisk PBX for Voice Mail
  • Gateway/Route List > Select the SIP Trunk that was created to route the calls between CUCM and Asterisk
  • Discard Digits > Select PreDot from the Drop Down Menu
  • Click on Save

Configuration in Asterisk PBX

Configure Misc. Destinations

  • Login to Asterisk PBX Server
  • Under Internal Options & Configuration > Click on Misc. Destinations > Click on Add Misc. Destination
  • Description > CUCM-VM-Pilot-Trigger
  • Dial > *97
  • Click on Submit Changes
  • Click on Apply Config

Configure Virtual Extensions 

  • Under Basic > Click on Extensions
  • Device > Select “None (Virtual Exten)” from the Drop Down Menu
  • Click on Submit
    • User Extension > 81091000
    • Display Name > User A
    • Voicemail Status > Select “Enabled” from Drop Down Menu
    • Voicemail Password > Enter a Password which will be used to access the voicemail
    • Fill all other necessary details if required.
    • Click on Submit
    • Click on Apply Config
  • Similarly create another Virtual Extension for the User B with extension 81091001

Configure Inbound Routes

  • Under Inbound Call Control > Click on Inbound Routes
  • Description > Inbound Route from CUCM to Asterisk Voicemail Pilot
  • DID Number > 81099999
  • Set Destination > Select Misc. Destination from the Drop Down Menu > Select CUCM-VM-Pilot-Trigger
  • Click on Submit
  • Click on Apply Config

Time to test the configuration

Depositing Voice Mail

  • Now make a call from extension 81091000 to 81091001
  • Let the call ring the extension and after few rings the call will go to Voicemail of Extension 81091000. You try to leave a Voicemail.

Retrieving Voice Mail using Message Button and Listening to the Voice Mails

  • Now click on Message button on IP Phone on Extension 81091000.
  • You will hear something like “Comedian Mail..”
  • Enter UserID as Extension 81091000
  • You will now hear “Password”
  • Enter the Password created for the extensions
  • You will be logged into your voicemail box and can listen to the Voice Mails.

Accessing Voice Mail using the Voice Mail Pilot Number

  • From the extension 81091000 > Dial 8109999
  • You will hear something like “Comedian Mail..”
  • Enter UserID as Extension 81091000
  • You will now hear “Password”
  • Enter the Password created for the extensions
  • You will be logged into your voicemail box and can listen to the Voice Mails.

Update 19/12/2022 – Here is the video guide on how to configure Asterisk PBX as Voicemail for CUCM and also fix for MWI.


If you have not done CUCM and Asterisk SIP Trunk Integration, kindly refer to the below post.

If you would like to change the default “Comedian Mail” Audio Greetings in Asterisk PBX , kindly refer to the below post.
Hope this helps!

You may also like...

19 Responses

  1. Yiannis says:

    When VM is activated , elastix is playing the mailbox access greeting.
    Could you help ?

    • Administrator says:

      Can you please share the call flow and let me know if you are dialing the voicemail pilot number or you are trying to call an extension, if the extension is not picking the call, you are trying to deposit a voicemail into a user’s mailbox?

  2. Ken says:

    Hello, I am having the same problem as the other user. If I call an extension and it goes to voicemail, it shows “Comedian Mail, Extension”, instead of getting the voicemail prompt. I have following the tutorial to the “T”. Any ideas?

    • Ken says:

      I figured it out. The sections in “directory number” in CUCM where we would put “*EXT” (ex. *1000) I checked the check box labeled “voice mail”. Unchecking them all the way down made it so it reached the voicemail prompt. Thank you for sharing this!! Now to figure out how incorporate MWI….

      • Ken says:

        If anyone is interested in incorporating MWI using the above tutorial, look at the shell script here: Where it says “callman” in the script (twice) change that to reflect the name of the SIP trunk going from FreePBX to CUCM server.

        • Administrator says:

          Hello Ken,
          Thank you for confirming!
          Did you follow the steps provided in the link shared and had MWI work for you? If yes, then this is a great news. Now techies can use CUCM with Asterisk as VM in full fledge.

          • Ken says:

            Hello! I followed your tutorial to the “T” and was able to get voicemail setup properly. The link I provided above, I simply copied the script, created the file in /var/lib/asterisk/scripts/ (had to create the “scripts” direectory) and then referenced that file under “externotify” within voicemail.conf (/etc/asterisk). One thing I forgot to mention above is, you need to setup MWI On/Off extensions in CUCM (Advanced Features -> Voicemail -> Message Waiting). Then, in the shell script where it shows “turnon” and “turnoff” change the extensions (script shows 1002 and 1003) to the MWI on/off extensions you create within CUCM.

          • Administrator says:

            Hello Ken,
            Thanks for the feedback, your confirmation on MWI working scenario will surely help all the readers to follow the link you have provided. Appreciate your time to reply back with the confirmation. Keep in touch!

        • shivani sharma says:

          Hello Ken,
          I followed all the steps you mentioned in your posts to get MWI working, but I still dont have luck. Would you be able to provide more details on the MWI setup? I copied the script with the changes (CUCM IP address, MWI extensions) in the location you has specified. I also created MWI extensions on CUCM. Do I have to create similar extensions on Asterisk?

  3. Ken says:

    Hello again, sorry to keep asking questions. I know your tutorial states that to access voicemail you hit the VM button, enter your extension, and then password. I am wondering if you know how to alter this setup so that when you hit the VM button you would just enter your password and then your voicemail would play. I know in Asterisk *97 is for your personal voicemail, where as *98 is the pilot. Even though the Misc Destination is sending us to *97 it’s acting as if it’s *98. I looked at the asterisk debugs when hitting the VM button, and it shows a few ERROR messages but not finding much on Google about it. Just curious if you have any suggestions. Otherwise everything is working great!

    • Administrator says:

      Hi Ken,
      The solution you are looking for is something that i have tried already but could not make it work. My understanding was that if we create an extension in Asterisk with same extension as in CUCM it would not prompt for username, it will only prompt for password when you dial into voicemail. I tried but failed for some reasons. Hence that was the reason i posted the above method.
      Try if this works for you.
      10000 as the extension in asterisk and 10000 in cucm. In asterisk, forward all calls to Voicemail for the extension 10000. Now dial the Voicemail Pilot Number and see if the username prompt is eliminated.

      • Ken says:

        Thank you for providing me that. I will give it a shot later on today.

        • Ken says:

          I was unable to figure out how to “forward” an extension within Asterisk, but after some more poking around I got it to work. Instead of creating a “virtual extension” within FreePBX, I chose a “Custom Extension”. Fill in the information just as you would a virtual, and once the extension is created, hit apply settings. Now if you hit the voicemail button on the Cisco phone you get “Password”. And this is exactly what I was looking for.

  4. Johnb77 says:

    I think you have noted some very interesting points , appreciate it for the post.

  5. Jason says:

    I have set this up for our environment. I do have one problem currently. It seems that DTMF tones are not passing from CUCM over the SIP trunk to FreePBX. I leave a voicemail and when I am finished recording, it states to press #. I do this and nothing happens. Also, when I call into voicemail, it asks for a password, but it doesn’t think I typed anything in. Lastly, when I go to Settings – Voicemail Admin, I don’t see any messages in inboxes.

    Any help anyone can supply would be greatly appreciated!

  6. Michael says:

    Hello Avinash,

    This is possibly the best article I found on the web to use Asterisk for voicemail in a CUCM environment!

    I’ve been trying to do just that with CME and FreePBX 16 but although your notes here deepened my understanding of the process, I’m still unsucessful achieving that. Is there any chance you can provide a walkthrough with commands for CME and screenshots of FreePBX 16?

    Thank you.


Leave a Reply

Your email address will not be published. Required fields are marked *