Asterisk Cisco CallManager Voicemail Integration

This is my first wiki entry and needs to be tidied up a bit. I'll do that when I get around to it, my main priority for now was getting this information online as it seems to be in demand.

Some time ago I wrote a tutorial on using Asterisk as a voicemail for CCM using H323. This has not been wikified, but is available at . H323 does not provide the high level of integration that SIP does.


Asterisk provides a flexible voicemail system that is a viable option for companies using Cisco Callmanager that do not wish to implement Cisco Unity.

Current version of Cisco Callmanager support SIP trunks with the features required to setup a fully integrated voicemail system. (particularly RDNIS).


  • A version of Asterisk. This guide was written with Asterisk 1.0.8.
  • Callmanager 4.0 or higher. This guide was written with Callmanager 4.1(2)sr1 and some menu options may differ between versions. This will NOT work with Callmanager 3.3(5) or lower.
  • Asterisk needs to be integrated with Callmanager using a SIP trunk as detailed Here.


  • If a SIP telephone registered to the Asterisk machine acting as voicemail calls through to a Callmanager user and subsequently is sent to voicemail, the call will be dropped. This can be resolved by configuring the device in sip.conf as something like [sipexten] (eg: [sip7222]) rather than [exten] (eg: [7222]).

Features provided

  • MWI
  • Voicemail on the CCM side is enabled by selecting Forward to 'Voicemail' rather than forwarding calls to a mailbox specific extension number.
  • Messages are accessed by pressing the 'Messages' button on the CCM phones, or dialing the VM pilot number.
  • If a CCM user doesn't want to take a call, they can press the iDivert softkey to send to voicemail immediately.
  • CCM users can forward all calls to voicemail in the ccmuser pages, or by pressing CFwdAll and entering the pilot number or messages.
  • All the standard Asterisk voicemail features work just fine, eg: vm to email.
  • etc

Before we begin

You need to plan the following:
  • What your voicemail number will be. This guide will use 8888.
  • What number will disable message waiting on Callmanager. This guide will use 28888.
  • What number will enable message waiting on Callmanager. This guide will use 28889.
  • What number will disable message waiting on Asterisk. This guide will use 230XXXX (we have four digit extensions).
  • What number will enable message waiting on Asterisk. This guide will use 231XXXX (we have four digit extensions).

Callmanager Configuration

  • You need to ensure that "Redirecting Number Delivery - Outbound" is checked on your SIP trunk configuration in Callmanager.

Voicemail pilot configuration

  • Go to Feature -> Voice Mail -> Voice Mail Pilot.

You should have a pilot called 'Default' which we will use. If you don't add a new one. We will configure this pilot as follows:

  • Update the pilot.

Voicemail Profile configuration.

  • Feature -> Voice Mail -> Voice Mail Profile

You should have a profile called 'Default'. If not, add one. Configure it as follows:

MWI configuration

  • Feature -> Voice Mail -> Message Waiting

We will be adding two new numbers, 28888 and 28889 as follows:

Activate Voicemail

  • Activate voicemail on any CCM phones that require it. This is configured in Device -> Phone -> Device Name -> Directory Number.

The settings are fairly straightforward and look like:

iDivert configuration

Where you want the user to be able to send a call to voicemail (whether it's ringing, on hold, etc.) open up the softkey template and add the iDivert softkey to the relevant call states. I'm assuming you know how to do this, so I won't go into detail. Your phones will need to be reset after doing this.

Asterisk Configuration

The fun part.

First we need to configure extensions.conf to handle the voicemail.

In a context that Callmanager has access to (set in sip.conf), add the following:

exten => 8888,1,GotoIf($[[${RDNIS}]?2:400)
exten => 8888,2,MailboxExists(${RDNIS}@default)
exten => 8888,3,Congestion
exten => 8888,103,Voicemail(su${RDNIS})
exten => 8888,104,Playback(vm-goodbye)
exten => 8888,105,Hangup
exten => 8888,400,VoicemailMain

Here is a version for Asterisk 1.4+ :

exten => 8888,1,GotoIf($["${CALLERID(rdnis)}" = ""]?400)
exten => 8888,2,MailboxExists(${CALLERID(rdnis)}@default)
exten => 8888,3,Congestion
exten => 8888,103,103,Voicemail(su${CALLERID(rdnis)})
exten => 8888,104,Playback(vm-goodbye)
exten => 8888,105,Hangup
exten => 8888,400,VoicemailMain

This is what I have done AsteriskNow 1.7

exten => 8888,1,GotoIf($[{CALLERID(rdnis)}]?2:400) ;erm is there a typo or 2 in the 1.4 version?
exten => 8888,2,Dial(SIP/8898@callman01) ;I couldnt work out how to call MWI
; from stuff below but this worked. Put it before calling voicemail to allow caller to
; hang up and light still go on.
exten => 8888,3,VoiceMail(${CALLERID(rdnis)},su)
exten => 8888,4,Playback(vm-goodbye)
exten => 8888,5,Hangup
exten => 8888,400,VoicemailMain
exten => 8888,401,Dial(SIP/8899@callman01)
; perhaps an expert, or someone who understands, could explain in a tad more detail for us noobs.

If there is no rdnis, Asterisk believes that a user is trying to access their own mailbox and says the login prompt.

Next is the mwi, still in extensions.conf.

You need to add a context that matches your voicemail context. For example, [default].

In this context, we'll add:

exten => _230XXXX,1,SetCallerID(${EXTEN:3})
exten => _230XXXX,2,Dial(SIP/28888@ciscocm)
exten => _230XXXX,3,Answer
exten => _230XXXX,4,Wait,1
exten => _230XXXX,5,Hangup

exten => _231XXXX,1,SetCallerID(${EXTEN:3})
exten => _231XXXX,2,Dial(SIP/28889@ciscocm)
exten => _231XXXX,3,Answer
exten => _231XXXX,4,Wait,1
exten => _231XXXX,5,Hangup

Change the dial lines to match your configuration.

We'll now create the script that calls voicemail. We shall call this /var/lib/asterisk/scripts/

This script can be downloaded from

Don't forget to chmod to 755, and make sure the script can write in /var/spool/asterisk/outgoing/

In voicemail.conf, add:

Save and reload Asterisk.


That should be it. Leave yourself a message and hopefully everything should work.

Created by: shaunewing, Last modification: Fri 01 of Jul, 2011 (08:49 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+