Exchange 2010 UM with FreePBX 2.11 and Asterisk 11
This article assumes that you have an Exchange UM server already configured. The directions cover the use of a module I created for FreePBX 2.11 and assume FreePBX is in device and user mode. The module removes the need to override macro-vm, which allows you to use Exchange UM for some users and FreePBX voicemail for others.
NOTE: Support for the MWI (message waiting indicator) and play on phone requires patching and compiling Asterisk from source. The patches were created against Certified Asterisk 11.2-cert2.
Start by enabling Asterisk SIP tcp support, SIP redirections, and disabling diversion headers. When a call is made to Exchange on port 5060 it will issue a redirect to port 5065 or 5067. With Asterisk 1.8 SIP diversion headers were added. Exchange only expects a diversion header when leaving a voicemail. It can’t handle the unconditional diversion header when the redirect occurs. Asterisk Jira issue 16862 adds support to disable the diversion header, which made it into Asterisk 11.
; Exchange UM settings
If you need the play on phone functionality you have two options:
- Make sure your device ids do not match your extension ids. Exchange creates the call from the extension to the extension. If the device exists Asterisk will send back 403 unauthorized to Exchange.
- Enable Asterisk domain support and apply the invite domain check patch. This patch limits matching on invites to domains in the Asterisk system. When Exchange creates the invite the domain will be of the Exchange box, which will avoid the 403 unauthorized issue.asterisk-11.2-cert-invite-domain-check.patch
; Domains to accept REGISTER to and INVITE from
Asterisk only has support for unsolicited MWI for a single mailbox. Asterisk Jira issue 17362 adds support to Asterisk 1.8 for unsolicited MWI for multiples mailboxes in a defined context. I have updated this patch for Asterisk 11.
Now that Asterisk is configured we can move on to FreePBX.
Admin -> Modules
Select Upload modules and specify the file below.
See Exchange UM 184.108.40.206 Integration for FreePBX 2.11 for the latest version.
Connectivity -> Trunks
Create SIP trunk to connect to the Exchange UM server. Make sure to change the IP to that of your Exchange server. Only add the unsolicited_mailbox line if you applied the unsolicited MWI patch.
Settings -> Exchange UM Settings
Specify the number of digits in your extensions. This should match the Exchange dial plan number of digits setting. If you have extensions that are longer they will be truncated to this length starting from the right hand side. Make sure to select the trunk you created in the previous step.
Admin -> Feature Codes
Configure the Exchange UM feature codes that will be used to access Exchange. The direct dial prefix is used from the Voicemail feature code section.
Applications -> Users
Select if the user will be using Exchange UM or the FreePBX voicemail. Even when selecting Exchange UM you must also selected Enabled for the Voicemail section. This is required due to how the module hooks into the macro-vm dialplan.
Applications -> Devices
If you are using MWI you must change the device mailbox to extension@exchvm or the context you specified when creating the trunk.