How to configure Unified Messaging with Asterisk SIP Gateway (Part 2)

If you would like to read the first part in this article series please go to How to configure Unified Messaging with Asterisk SIP Gateway – Part 1: Preparations for Unified Messaging on Exchange Server 2010.

Introduction

In the first part of this article series we discussed what needs to be configured on Exchange Server 2010 to be ready for Unified Communications. In part two we are now going to have a look at how to setup Asterisk Trixbox to work as an SIP gateway. You will see it is a Linux distribution (on CentOS) but it has a GUI so even when you are not really enthusiastic on Linux because of its command line based configuration and you won’t need a deep knowledge in Linux to make things work properly.

Basics

Trixbox CE (formerly known as [email protected]) is the cost-free edition of CentOS Asterisk. The name needed to change because the Company Digium requested the rights on the word “Asterisk”.

Note:
You can download the ISO file here.

Trixbox is prepared to run on virtual machines like VSphere ESX or Hyper-V and fully functional. In this article we are going to discuss a Trixbox installation on VSphere ESXi4 on a virtual machine configured below:

Virtual CPU:                        2 virtual

RAM:                                     1024 MB

Virtual Hard Disk:              10 GB

Based on the number of users working on Trixbox you probably need to enlarge RAM to make things work more smoothly.

Installation Procedure

Now let’s have a look on how to install Trixbox.


Figure 1:  Startup Screen of Trixbox


Figure 2:  Define the Keyboard Layout


Figure 3:  Configure the Timezone


Figure 4:  Set the Root Password


Figure 5: The installation Procedure


Figure 6:  Trixbox startup Screen

After the installation has finished successfully you can now logon to Trixbox from any browser to configure it to work as an SIP gateway.


Figure 7:  User Mode of Trixbox

To change to administration mode, you simply need to click on “Switch” on the upper right corner and logon as:

Username:         maint

Password:           password


Figure 8:  Trixbox Administration Mode

Configuration of Trixbox to Support Exchange Unified Messaging

Before configuring anything else, we need to enable SIP over TCP on Asterisk. This can be done by editing the file called SIP_GENERAL_CUSTOM.CONF located in etc/asterisk. You can edit this file using any Linux text file editior.

You will need to add the following to settings to this file:

tcpenable=yes

tcpbindaddr=0.0.0.0

Now we need to create a new Trunk to your existing Exchange Server box using the following Menu-Settings: PBX, PBX Settings, Trunks, Add SIP Trunk and use the following outgoing settings:

Trunk Name:      Exchange2010

Peer Details:

Host=<Exchange Server IP Address>

type=friend

insecure=very

transport=tcp

port=5065

context=from-internal

These settings allow insecure TCP based communications from your Exchange Server 2010 machine.

In addition we will need to add the corresponding outbound routes as follows:

Route Name:                                     Exchange2010-Route

Intra Company Route:                   Checked

Dial Patterns:

3333

4444

5555

This allows internal communications for the dial patterns (in Exchange called “pilot identifiers” in the Unified Messaging Dial Plan).

If you then would like to test your configuration I would prefer using X-Lite and configure two users with SIP enabled and different telephone extensions.

That’s it, your Trixbox machine is now successfully configured to support Exchange Server 2010 Unified Messaging.

Configuration of Exchange Server 2010 Unified Messaging Role

Now we need to have a look at what needs to be configured in Exchange UM role to interact successfully with Trixbox.

At first we need to configure a UM Dial Plan with the following details:

Name:                                                                                  MyUMDialPlan

Numer of digits in extension numbers:                  4 (but depends upon your configuration)

URI Type:                                                                            Telephone Extension

VoIP Security:                                                                    Unsecured

Country/Region Code:                                                   49 (for Germany)


Figure 9:  Creating a new Dial Plan for Unified Messaging

Now we need to configure a new UM IP Gateway with these settings:

Name:                   Trixbox

IP address:          <IP Address of your Trixbox>

Dial Plan:              MyUmDialPlan

When you submit these settings, a Default Hunt Group will be created automatically within Exchange Server 2010.

Afterwards we will need to create a new UM Mailbox Policy:

Name:                                                   Trixbox Mailbox Policy

Associated dial plan:                       MyUMDialPlan

For basic configurations we will finally need to define an Auto Attendant as follows:

Name:                                                  MyAutoAttendant

Associated Dial Plan:                       MyUMDialPlan

Pilot Identifiers:                                3333       5555

Now we have finished the basic configuration for allowing Exchange Server 2010 Unified Messaging to communicate with the Trixbox Asterisk Solution.

Enabling Unified Messaging for the Exchange User(s)

Finally we now need to enable our user mailboxes for Unified Messaging. This can be done directly in the Recipient Configuration of your Exchange Server Management Console. If you right click the user mailbox you can enable Unified Messaging for it by enabling the extension number.

This will now give the user the ability to dial the subscriber address of 4444 from the SIP Phone and will automatically be rerouted to his / her Exchange voice mailbox. If you dial 3333 or 5555 you should be greeted by “Thank you for calling the Microsoft Exchange Auto Attendant”.

Final Trixbox configurations

As the very final step we will now need to tell Trixbox to no longer route unanswered calls to its own voicemail but instead send them to the Exchange SIP trunk “Exchange2010” extension 4444 also known as the subscriber access number.

You will need to change the following in the file called EXTENSIONS.CONFIG located in /etc/asterisk:

<Original Text>

exten => s, n, Macro{vm,${VMBOX}, ${DIALSTATUS}, ${IVR-RETVM}}

needs to be changed to:

;exten => s, n, Macro{vm,${VMBOX}, ${DIALSTATUS}, ${IVR-RETVM}}

exten => s, n, SIPAddHeader{Diversion: <tel:${EXTTOCALL}>\;reson=no-answer\;screen=no\;privacy=off}

exten => s, n, Dial {SIP/Exchange2010/4444}

exten => s, n, Hangup

Conclusion

As you have seen above, the Linux and Asterisk based solution Trixbox is a quite easy virtual appliance that allows you to enable Unified Messaging in a very simple way. As soon as you have enabled internal communications between Exchange and Trixbox, you can create external SIP trunks to SIP providers (SIPGate, etc.)  to allow communications from external, too.

If you still have further questions, please do not hesitate to contact me.

If you would like to read the first part in this article series please go to How to configure Unified Messaging with Asterisk SIP Gateway – Part 1: Preparations for Unified Messaging on Exchange Server 2010.

1 thought on “How to configure Unified Messaging with Asterisk SIP Gateway (Part 2)”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top