Part 1 - How to integrate Exchange 2010 (or 2007) with Trixbox 2.8

I previously mentioned that integrating OCS 2007 R2 was now possible given that Asterisk 1.6 now supports TCP SIP trunking. I also found myself in a position where I wanted to start testing Exchange 2010 UM without touching my production PBX (which in this case is a Nortel CS1000).

After scouring the blogosphere I found some examples of partial Exchange 2007 UM implementations (some with sipX proxies) and others with subscriber access only.

I decided that I would attempt to undertake the following tasks:

·         A full and directly attached Exchange 2010 integration with Trixbox 2.8 – 100% complete

·         PSTN breakout with an analogue terminal adaptor – 0% complete

·         Finally an OCS 2007 R2 integration with Trixbox 2.8 – 0% complete

In addition I wanted to make a straight forward guide that any Exchange administrator could follow.

Now before I start part one of three (fingers crossed I get to complete the others!) I want to give credit to:

·         Ryan Newington – your blog helped me get on my way to voicemail forwarding

·         Claude Tambu – also a great source of information

So firstly let me go into the goal in more detail, using Hyper-V R2 (built into Windows Server 2008 R2), I will be running Exchange 2010 UM and Trixbox 2.8 – illustrated below.

Installing Trixbox:

Trixbox comes in a variety of flavours, the “CE” is the community edition and it is free with no commercial support (a support plan can be purchased separately at a later date if you wish).  I have written this guide whilst testing against version 2.8.0.1 (stable).

Firstly download the ISO from http://www.trixbox.org/downloads

Next create your virtual machine, whilst Trixbox will run with 256mb of memory I would recommend 512mb. After the VM is created go to settings and remove the network adaptor and replace it with a legacy network adaptor – the default NIC does not function as there are no integration services for CentOS (this is the flavour of Linux used by Trixbox).

Mount the Trixbox ISO previously downloaded and let the install begin...

You should now be presented with the screen illustrated above, press enter to continue.

Next you are asked your keyboard type, then time zone and finally to set a root password (this is the Linux equivalent of “Administrator”). Now sit back, relax and resist the temptation to twitter what you are doing – save that for when it is up and running!

Approximately 30mins later you will be presented with the screen above (for the second time around), this is because during a reboot it has booted again off the mounted ISO. At this point turn off your newly created VM and remove the installation ISO – you can set your media to none. Now re-start the VM and your Trixbox PBX will perform its initial start-up normally.

Congratulations, your Trixbox install has now completed and you will hopefully be presented with the login screen illustrated above.

Your login is “root” with the password you created during the installation.

After login change your IP configuration from DHCP to static by typing “system-config-network”, edit device params, eth0, de-select DHCP and enter a static address – I am using 192.168.10.251. Don’t forget your netmask (mine is 255.255.255.0) and finally default gateway IP (mine is 192.168.10.1). Save, Save&Quit. To run using the new network settings type “shutdown –r now” – this tells your system to shutdown and restart immediately.

No more command line, its web interface from here on in! When you are presented with the login screen your web address should now be displayed correctly - in my case http://192.168.10.251.

Open your browser (I am using IE8 and compatibility view is required); connect to your Trixbox web GUI. To make the required changes switch the admin mode by clicking “switch” on the top right of the web GUI. The default username is “maint” and password “password” – this can of course be changed later.

Before you do anything let’s set Asterisk to allow SIP over TCP, go to PBX and config file editor. This is a method of editing your config files without having to use Linux command line tools such as “nano”. You’ll need to edit the sip_general_custom.conf file located in /etc/asterisk. This file is blank and the following needs to be added:

tcpenable=yes
tcpbindaddr=0.0.0.0

Click update and then go to PBX, PBX Settings, Trunks, Add SIP Trunk. Enter the following details in “Outgoing Settings”:

Trunk Name: Exchange

PEER Details:
host=[IP Address of Exchange 2010 UM Server]
type=friend
insecure=very
transport=tcp
port=5065
context=from-internal

Mine looks like this (so remove any default settings):

Click save and ignore the message telling you that the user context was left blank. Now we will add an associated outbound route. Click “Outbound Routes” and add:

Route Name: Exchange

Intra Company Route: Checked

Dial Patterns:

6666
8800
8888

Trunk Sequence:
SIP/Exchange

My example is below:

Submit your changes and voila, we now have an interconnect between our Trixbox and Exchange.

Setup SIP Extension(s):

I want to now configure two SIP extensions, in my first diagram you can see two X-Lite clients with extension numbers 1001 and 1002. To configure these extensions go to Extensions, Generic SIP Device, Submit. You will now be presented with a whole host of options, the important settings are:

User Extension: [Your telephone extension number – mine is 1001]

Display Name: [Users name – mine is Adam Jacobs]

secret: [a password used by the SIP client]

type: peer (without this Asterisk will not permit Exchange “play on phone”) Update, this field is not available until you add the extension and go back later and edit the details - Thanks to Benson for this one!

Voicemail & Directory:

Status: “Enabled”

Voicemail Password: 1234 (any password can be used, this is unused but necessary even though we are using Exchange)

Click submit and then follow the same procedure when you create additional extensions destined for Exchange UM.

To test your extension you need a SIP client, as previously mentioned I am using a soft SIP phone called X-Lite. Download from http://www.counterpath.net and configure as follows:

Display Name: [Your display name – mine is Adam Jacobs]

User Name: [Your SIP extension number – mine is 1001]

Password: [Your “secret” set earlier]

Authorization User name: [Your SIP extension number – mine is 1001]

Domain: [The IP address of your Trixbox – mine is 192.168.10.251]

The rest can be left as default and if all goes well your client will register successfully. (see my example below)

Configure Exchange 2010 UM:

As this guide as aimed at Exchange administrators my assumption is that you have already got your base install up and running, I will therefore only cover off your Unified Messaging settings.

In the Exchange Management Console (EMC) go to Organization Configuration, Unified Messaging , New UM Dial Plan.

Name: UM Dial Plan

Number of digits in extension numbers: 4 (I have used 4 but change to suit your needs)

URI type: Telephone Extension (this type ensures automatic mailbox recognition for your Trixbox)

VoIP security: Unsecured

Country/Region code: 44 [44 is for UK]

My example below:

After creating this plan you need to change some settings, go to properties, Subscriber access and add extension 8800. Then in the Settings tab change the Audio codec to G711.

Now create a new UM IP Gateway:

Name: Trixbox

IP address: 192.168.10.251 (my Trixbox IP)

Dial plan: UM Dial Plan (this is the plan just created)

Please note upon submitting your UM IP Gateway settings a Default Hunt Group will be automatically created – you do not need to touch this.

Next a UM Mailbox Policy is created:

Name: Trixbox

Associated dial plan: UM Dial Plan (this is the plan just created)

Almost there, let’s create the Auto Attendant.

Name: Trixbox AA

Associated dial plan: UM Dial Plan (this is the plan just created)

Pilot identifiers: 6666 click add, then 8888

Check both, create auto attendant as enabled and create auto attendant as speech-enabled.

Within the EMC go to Server Configuration, Unified Messaging, double click your server and go to the UM Settings tab. Add your Dial Plan “UM Dial Plan” and click ok.

Finally you need to enable one of your mailboxes for Unified Messaging. Go to Recipient Configuration within the EMC and enable Unified Messaging for your intended mailbox. Browse to your Mailbox Policy “Trixbox” and enter the extension number – mine is 1001.

If everything went to plan you should now be able to dial your subscriber access number 8800 from the X-Lite client and get automatically forwarded to your Exchange voicemail box. Likewise if you dial your Auto Attendant on either 6666 or 8888 you should be greeted by “Thank you for calling the Microsoft Exchange Auto Attendant” – if you do then you have followed my guide successfully and you can soon break out the champagne (or tweet your good fortune)!

All you need to do to complete the integration by ensuring Trixbox routes unanswered calls to Exchange and not to its own voicemail system.

Head back into your Trixbox web GUI, PBX, Config File Editor, you need to edit the extensions.conf file located in /etc/asterisk. Specifically the section [macro-exten-vm].

You need to change:

exten => s,n,Macro(vm,${VMBOX},${DIALSTATUS},${IVR_RETVM})

to:

;exten => s,n,Macro(vm,${VMBOX},${DIALSTATUS},${IVR_RETVM})

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

exten => s,n,Dial(SIP/Exchange/8800)

exten => s,n,Hangup

This tells Trixbox to no longer route unanswered calls to its own voicemail but instead send them down the SIP trunk “Exchange” extension “8800” aka the subscriber access number.

So there we have it, Trixbox (or Asterisk 1.6) fully integrated with Exchange 2010. If you have any questions or comments please let me know!

Published 3 Oct 2009 8:49 AM by Adam Jacobs

Comments

# Mike said on 03 October, 2009 09:28 AM

Nice post! Looking forward to giving this a try.

# Benson said on 05 October, 2009 08:59 AM

Thanks Adam!!.. this is just what I was looking for..

I installed trixbox 2.8 and clicked on Packages to check for any new updates. I got an error:

The XML response that was returned from the server is invalid

Received: Cannot write to file (cache/outputYumAvailList.txt)

I also saw a notification on the System status window.

Cronmanager encountered 1 Error:

The following commands failed with the listed error

/var/lib/asterisk/bin/module_admin listonline (255)

Added 8 hours, 9 minutes ago

(cron_manager.EXECFAIL)

Would these errors cause any problems in communicating with the Exchange?

Finally, in the section where you've given the steps to Setup SIP Extension(s), I couldn't find the "type" field inorder to set it to "peer". Is this field listed under Extensions??

-Benson

# Adam Jacobs said on 05 October, 2009 11:30 AM

Hi Benson, thanks for your feedback!

The errors you are experiencing will not have an impact on your Exchange integration - I believe this error is because no update e-mail address is applied. To add one go to PBX, PBX Settings, General Settings (it is located at the bottom of the page and you may need to restart Trixbox for it to kick in!)

The field you are looking for is unavailable until you create the extension. Once created go back and the "type" field becomes available - totally my fault, well spotted!

- Adam

# I'm a PC Blog said on 08 October, 2009 11:27 AM

The Microsoft Exchange Team has just announced that Exchange 2010 has now RTM'ed! I have been running

# Bryant said on 10 October, 2009 01:44 AM

blog.allanglesit.com/.../Hyper-V-Guests-Linux-Integration-Components-on-RHEL-and-CentOS.aspx

How to install Linux IC on HyperV

# Tim said on 11 October, 2009 03:13 PM

Great Blog. Does anyone know how to configure trixbox to forward an incoming call from an additional trunk i.e Sipgate to Exchange AA??

# Benson said on 14 October, 2009 01:44 PM

Hi Adam,

I just finished setting up Exchange 2007 and your guidelines to integrate Trixbox worked superbly!! Thanks a million!!

I used X-Lite and made calls to the Exchange AA to access my email, calendar, contacts etc...

But I couldn't get the voicemail part working. I modified the extensions.conf file just like you mentioned.

;exten => s,n,Macro(vm,${VMBOX},${DIALSTATUS},${IVR_RETVM})

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

exten => s,n,Dial(SIP/Exchange/8800)

exten => s,n,Hangup

But all the VMs were still being stored on Trixbox instead of being routed to Exchange.

Did I miss something here? Please help...

Thanks in advance...

-Benson

# Benson said on 14 October, 2009 02:07 PM

Hi Adam,

About the comments I just posted, it was actually a stupid mistake I made... I didn't reboot my Trixbox after editing the extensions.conf file.

Everything works perfectly now as expected. VM's are being routed to Exchange!

Thanks you so much for posting this. It really made my work a lot easier... :)

-Benson

# Jeroen said on 17 October, 2009 07:11 AM

i get a "registration error: 404 - not found" on the softphone any idea?

# Jeroen said on 17 October, 2009 08:31 AM

I configured everythink like the tutorial, but when i call number 8800 ik keep getting the message "the number you've dailed is not in service" any ideas?

Thanks

# Adam Jacobs said on 17 October, 2009 11:13 AM

Hi Jeroen,

Thanks for your feedback, now let me see if I can help!

RE: registration error 404, this usually occurs when an extension being registered is not found by Trixbox. Are you using the correct username/extension number and have you committed your Trixbox changes/reloaded?

RE: number you have dialled is not is service, this is a Trixbox error that usually occurs when the remote end of the SIP gateway is not answering. Have you been able to dial any Exchange attendants?

Keep trying and remember Network Monitor/Wireshark is your friend!

# Tony said on 21 October, 2009 08:55 PM

is it possible to do this with FreePBX?

# Adam Jacobs said on 22 October, 2009 07:50 AM

Hi Tony,

The PBX component within Trixbox is Asterisk, FreePBX is also based on this open source platform. Providing it has v1.6 for TCP support you should be able to replicate this setup with no issues.

# I'm a PC Blog said on 22 October, 2009 02:04 PM

My recent how-to article on Trixbox with Exchange UM integration has generated quite a large amount of

# Henrik P. Hessel said on 30 October, 2009 03:25 PM

Hi Adam,

the call gets accepted by the exchange server but no Greeting Speech is transfered via the line and Get-UMActiveCalls  doesn't list any calls.

Any idea what's wrong here?

thanks!

Henrik

# Adam Jacobs said on 31 October, 2009 11:59 AM

Hi Henrik,

Is this still an issue, I saw your thread on the TechNet forums? Here http://tinyurl.com/yj9jase

# Fady said on 04 November, 2009 02:43 PM

Hi Adam.

Really thanks a lot a lot for this nice helpful post, in which I can see a lot of good work and thinking, but I'm just like you interested in integrating OCS 2007 with Asterisk as well, please did you get any progress so far in this.

Thanks.

# Adam Jacobs said on 08 November, 2009 02:23 AM

Hi Fady, I have hit a few snag with part 2, the first issue is time! The second was due to voice clarity issues when using a PSTN TA.

I am thinking of reworking this to support Skype for Asterisk. Stay tuned (heopfully we won't be old and grey by the time I get it done!)

# Aaron Wagner said on 11 November, 2009 12:40 PM

This almost worked for me, except I got 1 way audio.....ONLY when the system transferred the call to voicemail.  Dialing the voicemail directly worked just fine.  I finally figured out that something Trixbox does in it's Macro's is different than just dialing "SIP/Exchange/8800" so I replaced the line:

exten => s,n,Dial(SIP/Exchange/8800)

with:

exten => s,n,Macro(dialout-trunk,4,8800,,)

and now it is working perfectly.  The dialout-trunk would ovbiously be different depending on which trunk number your Exchange trunk is assigned by Trixbox, but easy to find in the Global Variables in the extensions_additional.conf file.

# Truyen said on 13 November, 2009 01:08 PM

Hi Adam,

I just got trixbox 2.8.0.1 and I installed the backup tool package. But when I go there, there is no Restore button that I can do a restore from the backup that I got with my 2.6.

Can you just help me out with this.

Thanks

Truyen

# Hariom Jindal said on 07 December, 2009 01:40 AM

Hi Adam,

When i dial 8800, it is telling me "ALL CERCUITS ARE BUSY NOW"

What is that...

Thanks

Hariom Jindal

# Ben said on 27 December, 2009 08:59 AM

I've used your advice for forwarding to the Exchange for Voicemail, but I like to see the missed call notifications and to have the exchange AA as the first point of contact.  I've done this simply by adding the MISC Destination Called 'Exchange AA' and 8888 as the Dial entry.  Works great as Exchange will go to Trixbox for any call forwarding/routing set in exchange.  Now I'm purely using Trixbox for extensions, and Exchange for everything else.

# Domenic said on 10 January, 2010 07:41 PM

I went through the guide (excellent BTW) and everything seems to be working perfectly except for one thing, after a VM is left for a user through the MS interface it is never delivered or available when the user tries to retrieve it, it keeps saying no new messages. I verified that the message is indeed being recorded by the caller (i.e. playback and UI confirmation that it was sent before hanging up). I was expecting to see the message show up in the users mailbox and be available through the phone for playback. I am 100% sure the message is being left through Exchange UM but as I said it seems to mysteriously disappear after apparently being sent / saved.

Anyone else having this issue?

# Mark said on 02 February, 2010 11:20 AM

I get a "Please enter the channel number followed by the pound key" when I dial my UM Auto Attendant extension.    I'm pretty sure I followed the setup to a T.  Any ideas?  Thank you.

# Darkmind said on 11 February, 2010 02:23 PM

Hello,

Thank You for this Manual.

I have a little problem. My Trixbox say "This number is not in Service, please Check your number and try again.

I try all variations of numbers and settings.

have any Ideas ?

Thank You

Best Greetings

# Adam Jacobs said on 13 February, 2010 12:16 PM

Hi there!

The root cause is likely to be related to Exchange not answering the call. Check your Exchange settings and consider running a diagnostic tool such as MS network monitor or ethereal on the Exchange server.

# Cliff Larson said on 19 February, 2010 07:57 PM

I have set up everything you have outlined and all is working internal with VOIP Phones. I have an issue when someone dials from a PSTN connection it just hangs up and say SIP/Exchange - is busy

Has any body been able to go to VoiceMail from the PSTN?

# Cliff Larson said on 20 February, 2010 08:19 PM

I have fixed the pstn issue, the only item left that is not working is MWI.

Can anyone help with this?

Thanks,

Cliff

# Adam Jacobs said on 21 February, 2010 02:41 AM

Hi Cliff,

What was the PSTN issue you were experiencing?

Regarding MWI, I'm not sure that Trixbox (or Asterisk) supports the Exchange SIP messaging used for MWI - anyone else care to offer some assistance on this?

# Arun Shetty said on 26 February, 2010 01:05 AM

Works like a charm! Thanks a ton!

# RS said on 08 March, 2010 01:05 PM

Very cool.  Thank you very much for this.  It makes demonstrating the complete Exchange 2010 package very easy.

Leave a Comment

(required) 
(required) 
(optional)
(required)