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
[internal]
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.
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>
[internal]
exten => 4455,1,Dial(SIP/4455,30)
exten => 4455,n,SIPAddHeader(Diversion: < tel:4455 >
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 >
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
http://technet.microsoft.com/en-us/library/aa997665(EXCHG.80).aspx
Custom prompts for Exchange Server 2007 Unified Messaging
http://technet.microsoft.com/en-us/library/aa998818(EXCHG.80).aspx
http://technet.microsoft.com/en-us/library/bb676470(EXCHG.80).aspx
Asterisk HOW-TO tutorials and VoIP documents in general
http://www.asteriskguru.com/tutorials
http://www.voip-info.org
Network tools
http://www.wireshark.org