Friday, 5 September 2008

Part 1: Asterisk 1.6: Install and configure

As promissed, we thought we'd finally sit down and write this up as we've been able to successfully implement this confguration and are pleased the way it worked.
You will find in the sections and paragraphs below a tutorial to help you intergrate Asterisk with Exchange Server 2007 UM; thus avoiding the hassle we've gone thru trying to figure things out as a lot have broken since then.

We've devided this into three parts to make of ease of reading:

Part 1: Asterisk 1.6: Install and Configure. As rudimentary it might sound, it wasn't that intuitive to us when we first decided to get it started. So to help other skip the frustration, here's something to start from

Part 2: we'll be setting up and configuring Exchange with its Unified Messaging components
and Finally,

Part 3: we'll get things moving.

We've tried our best to present this guide in a self-explanatory manner; however, one's mileage will vary.

If any question, feel free to post your comment...


Claude Tambu

Part 1: Asterisk 1.6: Install and configure
A. Installing Asterisk 1.6

Ingredients: CentOS 5.0 + Asterisk 1.6

1. Install CentOS or your favourite linux distribution and ensure you have installed the latest updates
We had about +200 updates for our CentOS install.

Pre-req’s to Asterisk (if not installed, please go ahead and install):
yum install bison
yum install bison-devel
yum install ncurses
yum install ncurses-devel
yum install zlib
yum install zlib-devel
yum install openssl
yum install openssl-devel
yum install gnutls-devel
yum install gcc
yum install gcc-c++
HOW-TO install CentOS tutorials are countless on the web.
Additional steps after CentOS install

- Disable SELINUX
- Properly configure DNS with your internal DNS Server
- Set proper hostname [the default is localhost]. In our tutorial, we’ve chosen SIPTCP as our hostname and the FQDN name would siptcp.americas.local

Map of our systems

Local Domain name: AMERICAS
external email address:
Sever 1: EXBE @
 Exchange 2007 Server SP1 (Roles installed: Hub, CAS, Mailbox and UM)
 Windows Server 2003 R2 SP2 (DC, DNS)

Server 2: SIPTCP @
 CentOS 5 with latest updates
 Asterisk 1.6 rc4

2. Download and install Asterisk 1.6

Find the latest download link here and then wget them onto a folder.
Run the following commands from the folder you just downloaded the bits
a) Zaptel comes

tar zxvf zaptel*
cd zaptel*
make menuselect

make install
cd ..

b) Libri

No fancy commands for him
tar zxvf libpri*
cd libpri*
make install
cd ..

c) Asterisk itself [in our install, the latest version is 1.6 rc4]
tar zxvf asterisk*
cd asterisk*
make menuselect

make install
make samples
cd ..

Asterisk is now installed. You can confirm by running the following command

asterisk –vc

To start asterisk, just type asterisk and to access the Asterisk CLI, just type in
Asterisk -vvvvvvvvvvvvvr

Now that we have Asterisk installed, let’s configured the basic stuff to ensure it actually works before we tackle our topic

B: Setup basic configuration for Asterisk

1 – Create 2 extensions and configure them to call each other

Browse to /etc/asterisk/ and open sip.conf and scroll to the bottom of the file and add the following lines



Save your sip.conf once completed

Now, let’s setup both extension to “talk” to each other

Go to /etc/asterisk and open extensions.conf
and create the following at the bottom of the screen

exten => 4455,1,Dial(SIP/4455)
exten => 4466,1,Dial(SIP/4466)

Grab a softphone such as x-lite to test this out

At this point, both extensions should be able to ring each other; if not, review your codes and do not proceed further below unless you’ve passed this test.
2 – Create an extension for Exchange Server
We’re going to prepare Asterisk to be able to accept Exchange heartbeat pings. Essentially, in regular intervals, Exchange “pings” the SIP gateway by sending SIP OPTIONS messages to ensure it’s alive and ready to accept calls.

Go to /etc/asterisk and open sip.conf

First, we’re going to enable support for SIP over TCP. This is disable by default [Please note, earlier beta versions of Asterisk 1.6 did have this option enable for you]

Add the following onto your [general] context in sip.conf. If you did create samples (make samples), you should have this pre-populated; just un-comment it to get it on.
TCP runs, by default, on port 5060. We’ll come back to this one later on.
tcpbindaddr with will bind any IP address assigned to your asterisk box; comes in handy if you have a DHCP in place or are using multiple NIC or IP addresses

While, still in the sip.conf file, we scroll all the way down and create the Exchange Server “extension” within Asterisk


The most important settings here are transport=tcp as well as port=5065

Transport=tcp is basically self-explanatory. We’re just telling Asterisk to always use this protocol when communicating with this host [ie. Our Exchange Server.]

Port=5065; By default, Asterisk will send SIP traffic using port 5060; our Exchange UM service never actually answers any calls on that port; it rather uses it to acknowledge its presence/existence, but forwards any request to a different process: The UM Worker Process which runs on 5065 by default or any other port higher (the range is up to 5080, I believe) if this one is used. Restart the Microsoft Exchange Speech Service to find out which yours’ running on.
A typical Exchange UM call, rings Exchange UM which forwards to UM Worker Process and acknowledge the SIP Gateway by issuing a SIP 302 Move Temporarily
Asterisk doesn’t handle the SIP 302 properly, you r call will just ring and then briefly fails with a SIP 503 Service Unavailable message


CobrawNL said...

How can we see which port the exchange worker is using?

Claude Tambu said...

A number of ways amongst which you have:
- Restart the "Microsoft Exchange Speech Engine Service" and Event 1000 will be logged in your Application Events [UMWorkerProcess Category] saying something like [ The Unified Messaging Worker Process was started successfully on port "5065".]

- Anouther way, here you could actually change the default port if you have SP1 installed, is to look at the umrecyclerconfig.xml file

Hope that helps,

Claude T.

CobrawNL said...
This comment has been removed by the author.
CobrawNL said...


i have another problem:

i can call 4466 and 4455, but when i call 8800, 8888 or 9999 asterisk logged the following error:

-- Called EXUM/9999
-- SIP/EXUM-09bf6dc8 is ringing
-- SIP/EXUM-09bf6dc8 answered SIP/4466-09bd9fb8
-- Native bridging SIP/4466-09bd9fb8 and SIP/Exum-09bf6dc8
-- Got SIP response 415 "Unsupported Media Type" back from
== Spawn extension (internal, 9999, 1) exited non-zero on 'SIP/4466-09bd9fb8'

Where is my exchange server.

Claude Tambu said...

Check your codec...

while the call is in "progress type in Asterisk CLI
"sip show channel" (without the quotes)and look under the codec, I bet you'll see the word "nothing" or something not right.

YOu could also enable debugging on EXUM extension by issugin the followoing command in Asterisk

sip set debug off
sip set debug peer EXUM

--> enforce a codec for the EXUM extension by adding the following argument in your sip.conf under



Disallow must come first tho.



CobrawNL said...
This comment has been removed by the author.
CobrawNL said...

GREAT! its working!

This resolution works fine for me:


Now i'm wondering how i can activate the asterisk GUI?

CobrawNL said...

Does anybody know how i can activate the asterisk GUI?

Augustin said...

Hello - very useful post

from CUCM6.1, created the SIP trunk to Exchange UM, plus routing pattern.

Configured the Exchange UM for this user.

When I call from a Cisco CUCM phone, the SIP INVITE message reaches the EXchange UM but it returns "ICMP port unreachable".

I have checked using your advice that UM uses the 5065 port, modified the trunk accordingly but still, same old error.

No FW, all services running - can't see what's wrong.

Any suggestions?