Cisco CallManager 4 with Asterisk VM (SIP)

By · · 4 mins read

Back in 2005 after upgrading to CallManager 4, I updated my previous tutorial to describe Asterisk Voicemail integration using SIP instead of H323.

These instructions are below.

Overview

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

At the time this tutorial was written, the current version of Cisco Callmanager supports SIP trunks with the features required to setup a fully integrated voicemail system (particularly RDNIS).

Requirements

  • A version of Asterisk. This guide was written for Asterisk 1.0.8.
  • Callmanager 4.0 or higher. This guide was writen with Callmanager 4.1(2)sr1.
  • Asterisk needs to be integrated with Callmanager using a SIP trunk.

Caveats

  • 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’.
  • Messages can be accessed by pressing the ‘Messages’ button, 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 by pressing the messages key.
  • All the standard Asterisk voicemail features including voicemail to email are functional.

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 (assuming four digit extensions).
  • What number will enable message waiting on Asterisk. This guide will use 231XXXX (assuming 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. 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 the 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

If there is no RDNIS, Asterisk believes that a user is trying to access their own mailbox and plays 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/vm.sh.

The script can be downloaded from here.

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

In voicemail.conf, add: externnotify=/var/lib/asterisk/scripts/vm.sh

Save and reload Asterisk.

Conclusion

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