Series: Exchange 2013 and Lync 2013 Integration with AsteriskNOW PBX Pt. 3

In Part 1 and Part 2 of this series we configured AsteriskNOW PBX and connected it to our Lync 2013 environment. Now to complete our configuration we will integrate Lync 2013 with Exchange 2013 for Unified Messaging. I am going to assume you already have Exchange 2013 installed, configured, and the latest patches installed. If you need help with the installation and configuration please refer to the online documentation Let’s get started.

First things first we need to make sure we have the correct certificate installed on the Exchange UM Server and that it’s assigned to the UM Services. Being that I have an Internal CA I just requested a certificate that used the servers FQDN (see below) but you could also use a wildcard or public certificate. For more instructions on creating the cert check here Once you install the cert on the Exchange server we need to assign the cert to the UM Services. First you want to get the thumbprint of the cert you just imported into Exchange. This is easily accomplished by running (Get-ExchangeCertificate | fl Issuer,Subject,Thumbprint). Easiest way to find the cert you imported is the Issuer will be the DN of you Internal CA. Now copy the thumbprint and run (Enable-ExchangeCertificate -Thumbprint <thumbprint #> -Services 'UM, UMCallRouter'). These steps were performed in the screenshot below.

Now let’s configure our Exchange UM Server settings (UM Dial Plan, SA, AA, etc…). We are going to utilize EAC to configure our UM Servers but you could also use EMS. Open EAC (https://exchangeserver/ecp) with a user that has appropriate privileges in Exchange and select the Unified Messaging tab on the Left hand option menu. Under UM dial plans click the + to add a new Dial Plan.

  • Give the Dial plan a name (Ex2013)
  • Set the Extension length that you are using (I’m using 4 digits)
  • The dial plan type should equal “SIP URI” (this will always be used when connecting to Lync)
  • VoIP security mode should be “Secured”
  • Select your Audio language (If additional languages are required you must install the appropriate Exchange UM language packs)
  • Type in your Country code, and click save to create the dial plan (screenshot below).

Now we need to configure some settings in the dial plan. Double click the newly created dial plan and click “Configure”.

  • Click on Outlook Voice Access and set a number (+12673645101) for both E.164 and Outlook Voice Access
  • Under Dialing rules click the + under In-country/region dialing rules, give the dialing run a name (Ex2013DR), type * in both the “Number pattern to transform” and Dialed number boxes, and click ok to save
  • Dialing authorization needs to have both “Calls in the same UM dial plan” and “Allows calls to any extension” options selected. Click the + under “Authorized in-country/region dialing rule groups:”, select the group we created in the last step (Ex2013DR), click Add and then ok.
  • Click Save to commit all of these changes

Under UM Mailbox Policies you can leave the automatically created policy with all the default settings. Usually in a production deployment you would change a lot of these settings to fit the organization. Now click the + under UM Auto Attendants to create a new AA. Give the AA a name, select both “Enable this AA” and “Allow the AA to respond to voice commands”, give the AA a number in E.164 format and click the + to add it, lastly click Save to commit the changes. Again we will leave the default AA settings but you would most likely change these for production also. Now click Close to complete the UM Dial Plan configuration.

Our next step will be to assign our Dial Plan to the UM servers. In EAC, click servers, double click our UM Server, and click on Unified Messaging. Click the + under associated dial plans and add the dial plan we created above (Ex2013) to both the UM Call Router and UM Service settings. As you can see I have my UM startup mode configured as DUAL and this is due to connecting Exchange to both Lync (TLS) and AsteriskNOW (TCP). If you are only connecting Exchange to Lync you can leave this set to TLS. After assigning the dial plans click save.

We need to enable some mailboxes for Unified Messaging. Again from the EAC click Recipients, and under mailboxes click on a user, on the right hand side under “Phone and Voice features” click Enable. Click Browse, Select the UM mailbox policy that was created earlier (name should be dial plan name followed by mailbox policy) and click next (see below). Give the user an Extension (number of digits will match what you configured in the dial plan), Select the radio button to Type a pin and give the user a pin (minimum length will be what’s configured in the mailbox policy default=6). Uncheck “Require user to reset pin” and click finish. Do this for as many users as you would like to enable for UM. To verify the users UM settings click on view details under “Phone and Voice features” and it should look similar to below. Also if you look under the email addresses for the user you should see EUM entry’s for the user’s extension.

Last thing that needs to get completed on the Exchange side is to run the Exchange UC Configuration Script (ExchUCUtil.ps1). Running this script will do the following:

    • Grants Lync Server permission to read Exchange UM Active Directory components, specifically, the SIP URI dial plan that was created in the previous task. For details about how to configure permissions in Active Directory, see How to Use ADSI Edit to Apply Permissions.
    • Creates a UM IP gateway for each Lync Server pool or for each server running Lync Server Standard Edition that hosts users who will be enabled for Enterprise Voice. For details, see Create a UM IP Gateway.
    • Create an Exchange UM hunt group for each UM IP gateway. The hunt group pilot identifier will be the name of the dial plan associated with the corresponding UM IP gateway. The hunt group must specify the UM SIP dial plan used with the UM IP gateway.

After this runs successfully allow a little time for AD replication. You can see below how the script is run. Since I already ran this I get the “no settings have been changed” message.

On the Lync side we need to run the OcsUmUtil.exe script. This will create the contact objects for the Subscriber Access and Auto Attendant objects. From a Lync Server change to the C:\Program Files\Common Files\Microsoft Lync Server 2013\Support directory and run .\OcsUmUtil.exe. This will pop open the Exchange UM Integration Utility GUI (see below). Click on the Exchange Dial Plan and select “Add”. First we will add the Subscriber Access, click ok and then click add again to add the Auto-Attendant. See the configuration below as to which settings should be selected. Once you have completed both components the red exclamation should disappear stating your configuration is complete.

I ran into one issue when I was going through this configuration that I need to point out. With Exchange 2013 we have what’s called Managed Availability which has the power to disable different components of the Exchange Server. I found that I couldn’t get to voicemail and after troubleshooting with OCSLogger and Snooper from the Lync side I saw the Lync server couldn’t connect to Exchange on the required ports. So I ran the command (Get-ServerComponentState -Identity fabcm1) to check the status of the UM Component and found the state set to Inactive. Once I set this to Active (Set-ServerComponentState -Identity fabcm1 -Component UMCallRouter -State Active -Requester HealthAPI) everything started working.

Now you should be able to call into the Auto Attendant, Subscriber Access, and a user’s extension and get the Exchange UM prompts. I hope this article series has been informative. Stay tuned for future series like this. 

Comments (7)

  1. Richard Schwendiman says:

    @Junaid – I have not tested that scenario.
    @Mufleh – as long as you match the dial patterns for AA you should be fine.

  2. Adnan Hussain says:

    Its a great Article what i needed infact.

    Thanks rischwen 🙂

  3. Mufleh says:

    Thanks so much, it is really amazing article.. i have question, i think we stil need to configure Asterisk with Auto attendant Number pointed to Exchange UM ..right?  if we are assuming external users will hit IP PBX first..

  4. Junaid Mansoor says:

    What other modifications do we need if we use this arrangement with Hybrid Lync? I.e. with Office 365?

  5. Bryan says:

    Thanks for the pro-tips! I got SA working, however, AA just rings and rings, it gets a little staticy actually too as it’s ringing. A quick look at the event logs and I got a few errors:

    Error Event ID 46046
    A call to a PSTN number failed due to non availability of gateways.

    Error Event ID 44009
    Attempts to route to servers in an Exchange UM Dialplan failed
    No server in the dialplan [LyncDialPlan.lab.local] accepted the call with id [ff6de336-b931-4ee5-9a5e-1a4419a91765].
    Cause: Dialplan is not configured properly.
    Check the configuration of the dialplan on Exchange UM Servers.

    Any ideas? My UM integration must be partially working because SA works just fine. AA just doesn’t want to pick up….

  6. Bryan says:

    Logs from the Exchange UM server:

    The Microsoft Exchange Unified Messaging Call Router service rejected the call for the following reason: 15601;source="LABEXVM1.lab.local";reason="The Unified Messaging server cannot find a valid UM hunt group associated with the UM IP gateway. Pilot number:
    AA.LyncDialPlan. UMIPGateway: lablync1.lab.local." Microsoft.Exchange.UM.UMCore.CallRejectedException: The Unified Messaging server can’t find a valid UM hunt group for "SES AA.LyncDialPlan" associated with UM IP gateway "lablync1.lab.local".
    at Microsoft.Exchange.UM.UMCore.DialplanResolver.InitializeDialPlan(CafeRoutingContext context)
    at Microsoft.Exchange.UM.UMCore.DialplanResolver.InitializeContext(CafeRoutingContext context)
    at Microsoft.Exchange.UM.UMCore.DialplanResolver.HandleCall(CafeRoutingContext context)
    at Microsoft.Exchange.UM.UMCore.RouterCallHandler.InternalHandle(ICallHandler[] handlers, CafeRoutingContext context)
    at Microsoft.Exchange.UM.UcmaPlatform.UcmaCallRouterPlatform.TryHandleIncomingCall(CallReceivedEventArgs`1 args, Exception& error, Boolean& isDiagnosticCall)
    at Microsoft.Exchange.UM.UcmaPlatform.UcmaUtils.<>c__DisplayClassf.b__d()

  7. Bryan says:

    I figured it out. My auto attendant name had a space in it.