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
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...
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: Americas.com
Sever 1: EXBE @ 192.168.5.10
Exchange 2007 Server SP1 (Roles installed: Hub, CAS, Mailbox and UM)
Windows Server 2003 R2 SP2 (DC, DNS)
Server 2: SIPTCP @ 192.168.5.40
CentOS 5 with latest updates
Asterisk 1.6 rc4
2. Download and install Asterisk 1.6
Find the latest download link here http://www.asterisk.org/downloads 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*
No fancy commands for him
tar zxvf libpri*
c) Asterisk itself [in our install, the latest version is 1.6 rc4]
tar zxvf asterisk*
Asterisk is now installed. You can confirm by running the following command
To start asterisk, just type asterisk and to access the Asterisk CLI, just type in
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 0.0.0.0 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