Thursday, 15 April 2010

Exchange Server 2010 Faxes: How I receive faxes in my Lab environment

It's sure been a while since we've written anything new here. We must say we've been kept busy on other projects.

Today, we thought we'd take a look at Exchange Server 2010. Surely enough, a lot of experts have said it all with this product; however, we thought we'd look into a subject everyone wants but not many have spoken about it: Faxing within Exchange Server 2010.

We must mention that Exchange Server 2010 is not a fax gateway, nor can it send any faxes. One has numerous solutions available to do that: from the good old fax machine by the printer room to some of today's network faxes....

Although its predecessor (Exchange Server 2007) was able to receive faxes directly from the Media gateway, Exchange Server 2010 cannot receives faxes as per but "understands" the fax tone and then pass on the call to an external partner to do the "dirty work"

In the articles that follow, we will show you how we can receive faxes within our Lab environment using Exchange Server 2010 and have the fax message delivered directly to the "intended user" by Exchange Server.

Thanks again for tuning in and have a wonderful one!

Claude Tambu.

Friday, 5 September 2008

Part 3: Integrating Asterisk with Exchange Server 2007 in a Unified Messaging Scenario

At this point, you should be seeing some SIP traffic between both servers. I’d also strongly recommend the use of network trace tool like WireShark.

Now, let's go back to Asterisk.

1. Simple configuration to reach Auto-attendant and Subscriber Access

First, we’re going to add in the Asterisk dial plan a context (we’re going to rather alter the “internal” context we create earlier to allow our test extensions to talk to each other)to reach the Exchange Auto-Attendant and Subscriber Access

Go to /etc/asterisk and open extensions.conf
Under the [internal] context, we’re adding the following at the bottom of what’s already there

exten => 8888,1,Dial(SIP/EXUM/8888)
exten => 9999,1,Dial(SIP/EXUM/9999)
exten => 8800,1,Dial(SIP/EXUM/8800)

Now save the changes and reload asterisk. To reload, log onto the Asterisk console and just type reload then press Enter

We can give it try. From either softphone, you’ve set up earlier, dial 8888 or 9999 to hear Exchange Server UM responds: “Welcome to the Microsoft Exchange Auto-Attendant” or when you dial 8800, you should something like “Welcome, you are connected to Microsoft Exchange. To access your mailbox, please enter your extension...”
These greetings can also be customized... check out one of the article by Microsoft included below,

If you can hear that, go have a beer or dance like no one’s watching, etc. Just make sure you not to pat yourself too much... we still got some work to do 

Should you wish to set up access from and to the Public Switch Telephone Network (PSTN), follow the same process as above.

2. Setup Exchange UM as the VoiceMail system for Asterisk’s local extensions

We’re now going to alter our prior dial plan between extensions to tell Asterisk what to do, in case the user/extension dialled doesn’t respond after x amount of time.

At this point our [internal] context in /etc/asterisk/extensions.conf should look like this
exten => 4455,1,Dial(SIP/4455)
exten => 4466,1,Dial(SIP/4466)

exten => 8888,1,Dial(SIP/EXUM/8888)
exten => 9999,1,Dial(SIP/EXUM/9999)
exten => 8800,1,Dial(SIP/EXUM/8800)

We’re going to be telling Asterisk to redirect the call to Exchange Subscriber Access (extension 8800) should the dialled party not be available. For Exchange Server to open the correct mailbox, we need to issue some diversion information.

A typos has been introduced. Correction ported on September 17, 2008
on the internal context below

4455,n,Dial(SIP/EXUM/2222 should actually read exten => 4455,n,Dial(SIP/EXUM/8800

Thanks to Pat for finding this one>

exten => 4455,1,Dial(SIP/4455,30)
exten => 4455,n,SIPAddHeader(Diversion: < tel:4455 >\;reason=noanswer\;screen=no\;privacy=off)
exten => 4455,n,Dial(SIP/EXUM/8800)
exten => 4455,n,Hangup

exten => 4466,1,Dial(SIP/4466,30)
exten => 4466,n,SIPAddHeader(Diversion: <tel:4466 >\;reason=noanswer\;screen=no\;privacy=off)
exten => 4466,n,Dial(SIP/EXUM/8800)
exten => 4466,n,Hangup

exten => 8888,1,Dial(SIP/EXUM/8888)
exten => 9999,1,Dial(SIP/EXUM/9999)
exten => 8800,1,Dial(SIP/EXUM/8800)

The called extension will ring 6 times before Asterisk forwards the call to Exchange to VoiceMail. The diversion line will replace ${EXTEN} with the correct extension (one could also specify the actually extension number but I think using variables makes it easier to implement and less likely to make mistakes)

3. Ensure Exchange UM can dial out via asterisk

Because we’ve previously set up the Exchange UM extension (i.e. [EXUM]) in Asterisk to use the [internal] context, we should be able to dial out any number the local extensions can. For example, you may call the auto-attendant and request to speak to “yourself”. Exchange should then call the phone extension via Asterisk and if no one picks up it returns to itself for voicemail.

Technical Resources:

Unified Messaging Cmdlets

Custom prompts for Exchange Server 2007 Unified Messaging

Asterisk HOW-TO tutorials and VoIP documents in general

Network tools

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

Part 2: Exchange Server 2007 UM: Get started

A. Installing Exchange Server 2007

We’re assuming you’ve installed Exchange as recommended by Microsoft; frankly it’s mainly a “point and shoot” but just ensure to install the UM role.

If you’re just enjoying manipulating command lines, here’s one for you to install Exchange Server 2007 with the following roles: Client Access, Mailbox, Hub Transport and Unified Messaging

From your Windows system, open a command prompt and browse to the Exchange install source. In our case, that’s the D: Drive. Then type the following commands:

SETUP /roles:CA,H,M,U /mode:install

This would take some times before it completes, so make sure you grab a cup of coffee or go for a walk or something.

B. Configuring The Microsoft Exchange 2007 Unified Messaging

Here we’re going to spend some time setting up Exchange Unified Messaging; at least only the basic options. One can build from this foundation to suit their needs.
We’ll just keep on ignoring the GUI, so we’ll do the following tasks in the Exchange Management Shell the folks at MS gladly made available; however, you can still use the Exchange Management Console to set up all these options.

First, let’s create a Dial Plan [much like we did with the extensions.conf above but the Microsoft way ]

1. Create new dial plan

We’re going to set up our test Dial plan (TestDialPlan) along with number of extensions (4 digits) allowed as well as the Subscriber Access Number (8800)

new-UMDialPlan –Name TestDialPlan –NumberOfDigitsInExtension 4 -AccessTelephoneNumbers 8800 -VOIPSecurity Unsecured

2. Create a new SIP Gateway

Here, we’re adding Asterisk as our SIP gateway and associate it with the dial plan we’ve just created. You may choose to use an IP address in lieu of a FQDN name.

New-UMIPGateway –Name Asterisk –Address "siptcp.americas.local" –UMDialPlan TestDialPlan

3. Create a new Auto-Attendant

we’re now creating an new auto-attendant called TestAA, linked to our TestDialPlan and can be accessed by phone via two numbers: 8888 & 9999. This Auto-Attendant is speech-enabled so we can dictate commands by voice rather than using a phone keypad to make menu selections. We’ve also chosen to enable to actual Auto-Attendant; by default, it’s disabled.

New-UMAutoAttendant -Name TestAA -UMDialPlan TestDialPlan -PilotIdentifierList 8888,9999 -SpeechEnabled $true -Status Enabled

4. Associate Dial plan to Exchange Server

Up until this point, our dial plan and all the configurations around are basically doing nothing and will stay that until we effectively link a Unified Messaging Server to make use of it.
It’s also important to note if you have other Dialplans other configured with this server, running the following will remove them and only set those [dialplan] you specify here
Set-UMServer –Identity EXBE -DialPlans TestDialPlan

example with previous DialPlan on the server

Set-UMServer –Identity EXBE -DialPlans TestDialPlan, AnotherDialPlan, KewlDialPlan

5. Enable Unified Messaging Services on a user

Now, we’re ready to UM-enable a user. In our case, this is Claude; whose email address is We’re going to assign Claude extension 4455 and PIN for 123654. While we’re here, let’s create another user named James with extension 4466.

Enable-UMMailbox -Identity -UMMailboxPolicy "TestDialPlan Default Policy" –Extensions 4455 -Pin 123654 -PinExpired $false

NB – you can review the Microsoft TechNet Center for additional options one can specify for these commands.

Friday, 11 April 2008

Can Asterisk really "talk" to Exchage Server 2007 UM without anything in between?

A number of people would wonder if Asterisk is supported as a gateway for the Microsoft Exchange Server 2007 with the Unified Messaging role.

Well, as far as Exchange Server goes, Asterisk/Exchange UM is not a supported configuration but that doesn't mean "it cannot work". Microsoft does have a different view of what the term supported means; and if you want to learn more, you can find a list of what's been confirmed to interop with Exchange Server 2007 on the following link:
Telephony Advisor for Exchange Server 2007

Folks such as Ryan Newington Accessing Exchange 2007 Unified Messaging have demonstrated great techniques on making these 2 products connect and "talk to each other" using a proxy server in between.
Ryan has used SipX in his tutorial and I must say it's a successfull implementation provided you follow his instructions steps by steps and obviously have some knowledge on SIP and RTP, etc.

But some may ask why is it so difficult to configure Asterisk and Exchange UM together? Well, the answer is simple and complexe..... but we prefer the simple portion of it. The answer is as simple as "they just speak in different languages"; thus "the need for a interpretor"

Asterisk talks SIP using UDP while Exchange (and most of commercial-grade SIP servers) speaks SIP but over TCP.

However, since Asterisk version 1.4, talks have been rising to make it talk SIP over TCP as well; after all, when Mark Spencer came up with the idea of Asterisk back in the late 90', I believe, he thought of his creation finding no such boundary but integrate smoothly with already existent technology, network, etc.

An intern at Digium started to "teach" Asterisk the "SIP via TCP language" and I can say, they've done a great job as Asterisk 1.6 (currently still beta) can talk TCP.

That's good news, specially for those who loved Ryan's work (and others) but couldn't buy the idea of having an extra box sit in between.

We've done some work on it and can configure it work except a couple of issues here and there. [now fully works as we were able to clear all the issues we could think of]

Next time, we'll be showing you steps by steps how to set up a successful configuration of Asterisk with Exchange Server 2007 UM.

Until then, y'all have a great week end!

Claude Tambu