Asterisk 1.6.0 + Exchange 2007 SP1 Unified Messaging


Last week I discussed how to connect Asterisk with OCS Mediation Server over TCP.  I figured since we can connect Asterisk to OCS, why not to Exchange UM.  I will go over the configuration changes I made to Asterisk for this, but will not go into detail – since most of it was covered last week.


 


** Just wanted to add a side note.  This configuration is not supported, but again I like to play – so here you go. **


 


Asterisk Configuration Changes



 


SIP.CONF


 


[general]


context = default


bindport = 5060


bindaddr = 0.0.0.0


tcpbindaddr = 0.0.0.0


tcpenable = yes


promiscredir = yes  ** This is new line added **


 


promiscredir -> If set to yes, allows 302 or REDIR to non-local SIP Address


 


[SIP_VM]


type = peer


host = 10.100.16.20


qualify = yes


transport = tcp


 


[50012]


type = friend


callerid = Exchange User <50012>


secret = 50012


host = dynamic


canreinvite = no


dtmfmode = rfc2833


mailbox = 50012


disallow = all


allow = ulaw


transport = udp


 


You have seen most of this configuration before.  We created a new Trunk/Peer that will connect to the Exchange UM Server.  I also created a new Extension since I setup my Exchange DialPlan to support 5-Digit extensions.


 


Now we have to make some changes to the Asterisk Dialplan.  There are two different configurations.


 


1.  If you are going to call into Exchange UM.


 


;Exch VM


exten => 79999,1,Answer


exten => 79999,n,Dial(SIP/SIP_VM/${EXTEN})


exten => 79999,n,Busy


This just gets added to the outbound context in your dialplan.


 


2.  Here we will create a simple Macro to dial the extension then redirect to Exchange UM if no one answers.


 


; User Extension Macro


[macro-stdexten]


exten => s,1,Answer


exten => s,n,Set(MBEXT=${ARG1})


exten => s,n,Dial(SIP/${ARG1},20)


exten => s,n,SipAddHeader(Diversion:<tel:${MBEXT}>)


exten => s,n,Dial(SIP/SIP_VM/${EXCHUM})


exten => s,n,Busy


 


exten => _5XXXX,1,Macro(stdexten,${EXTEN})


 


So your extension.conf file will now look like this:


 


[general]


static=yes


writeprotect=no


 


[globals]


EXCHUM = 79999


 


[default]


exten => _5XXXX,1,Macro(stdexten,${EXTEN})


 


include => outbound


 


[macro-stdexten]


exten => s,1,Answer


exten => s,n,Set(MBEXT=${ARG1})


exten => s,n,Dial(SIP/${ARG1},20)


exten => s,n,SipAddHeader(Diversion:<tel:${MBEXT}>)


exten => s,n,Dial(SIP/SIP_VM/${EXCHUM})


exten => s,n,Busy


 


[outbound]


exten => _NXXNXXXXXX,1,Set(EXT=+${EXTEN})


exten => _NXXNXXXXXX,n,Dial(SIP/SIP_TRUNK/${EXT})


exten => _NXXNXXXXXX,n,Busy


 


;Exch VM


exten => 79999,1,Answer


exten => 79999,n,Dial(SIP/SIP_VM/${EXTEN})


exten => 79999,n,Busy


 


Now this is done we will move onto the Exchange UM configurations.


 


The first step is to create a UM Dial Plan.  Open up Exchange Management Console -> Under Organization Configuration -> Unified Message.  Select New UM Dial Plan.  There will be a wizard that walks you thru the configuration.  The important pieces are: 


  


    URI Type: Telephone Extension


    VoIP Security: Unsecured


 



 



Once you have the Dial Plan configured -> edit the dial plan and create a Subscriber Access Number.


 



 


This is the number that is dialed from Asterisk to reach your VM Box.


 


Next we need to configure a UM IP Gateway.  This is done by using the New UM IP Gateway wizard.


 



 


You can leave the default UM Mailbox Policy that was created when you created the Dial Plan.  The only thing left is it to associate the Dial Plan with your UM Server.


 


Under Server Configuration -> Unified Message -> Properties.


 


Add your new Dial Plan to the UM Settings.


 



 


Last is to apply the Dial Plan to a User Mailbox. You can use the Wizard to enable the User for Unified Messaging.


 


Now you are ready to test making a call from your SIP Client to Exchange UM.


 


When you make a call from Asterisk and if it fails with the following error, you will need to patch asterisk and recompile.


 



 


 


The formatting of the SIP call is incorrect.  It is showing SIP/::::TCP@79999@10.100.16.20:5065.


 


To download the patch http://bugs.digium.com/view.php?id=13523


 


Download the second patch ‘13523v2.patch’ and apply the patch.  To apply the patch you can follow these instructions.


 


    Change to install directory (/usr/src/pbx/asterisk-1.6.0)


    Download patch


    patch –p0 < 13523v2.patch


    You will get a success once this patch is installed


    /etc/init.d/asterisk stop


    make clean


    make


    make install


    /etc/init.d/asterisk start


 


Now when you make the same call you should see the following output:


 



 


You can see the difference in how the SIP call is formatted.


 


Well that’s it.  Have fun – enjoy playing. 

Comments (4)

  1. Geoff Clark MSFT says:

    Yes that would be the preferred method if using OCS.  But if you just wanted to use Exchange with existing Asterisk deployment, then this shows you how to configure the environment.

  2. Anonymous says:

    Why wouldn’t you just integrate Asterisk 1.6.0 into an OCS 2007 R2 environment then have Exchange UM integrate with OCS?

  3. Tim says:

    I can make a call to Subscriber Access Number successfully. but I can't make a call UM auto attendant, number is 79998. of course, I change the dial pattern.

    can you tell me how to configure dialpattern to make a call to UM auto attendant?

    thanks.

  4. Geoff Clark MSFT says:

    Tim – do you have any spaces in the Auto Attendant name?  If so – recreate the AA with no spaces.

    Geoff