:::: MENU ::::

Configuring Lync PSTN Calling Thru Avaya IPOffice

Project Scope
Preparing for Deployment – Research and Education and Pricing
Deployment of Standard Server & Director Role
Deployment of Edge and Reverse Proxy
Deployment of Lync Voice Capabilities
Configuring Lync PSTN Calling thru Avaya IPOffice
Configure Lync 4 Digit Extension Dialing without DIDs
Configure Asterisk as a SIP Proxy for Avaya IPO and and Lync
Deployment of Lync Client to users
Testing Configuration of Backup Registrar

 **Update 1/01/2013 – Note that Calls placed on hold or muted would drop when trunked from the IPO to Lync.  Our resolution was to use Lync & the IPO with an AsteriskNOW install proxying the SIP trunks.  The IPO connects to the asterisk and the asterisk connects to the Lync Mediation server.  See Configure Asterisk as a SIP Proxy for Avaya IPO and and Lync how to use the Asterisk as a proxy.***

**Update 2/14/2013 – We are selling our old Avaya phones here, we have a IPO 412 and several modules also for sale leave a comment for more information***

This post is a continuation of a series of posts about Lync Deployment.   This can be used as a resource to configure an Avaya IPOffice (IPO) 412 (software version 5.0) as a Gateway for a Lync deployment calling the PSTN, but your mileage may vary.  Calls are routed over a SIP Trunk (Session Initiation Protocol) configured between the IPO and the Lync Front End server.

An ISDN/PRI trunk provides inbound and outbound voice call access to the PSTN. Avaya IP
Office sends and receives SIP Invites to and from Lync Standard Server, Lync converts call signaling between standard SIP and Microsoft signaling protocol (MTLS).

The flow for an outbound call from an Enterprise Voice Lync User routes as the following: When an user dials a number,Lync normalizes the dialed number. If there is a match,
Lync checks that the number called is assigned to another Lync user. If so, Lync sends the call to the called user’s Lyc client. If not, Lync looks up a call routing table for a match of the
E.164-formatted called number. If there is a match, Lync routes the call to the Gateway for that route, which in this configuration is the IPO and then the IPO routes the call to the PSTN.

For inbound calls from the PSTN, Avaya IP Office receives the incoming call. Based on the
called party number,IPO looks up the corresponding Short Code (if the called number is a Lync Extension) and routes the call to the Lync server via SIP.

For this configuration an inbound call hits an IPO Inbound call route, matches the last 4 digits to a 4 digit short code which routes to an ARS table which matches the short code digits translates to E.164 format and routes the call over a SIP trunk to the Lync frontend server.

Configuration was modified from an OCSR2 & IPO document found here:

Updated 2/5/2012

When configuring Lync and IPO directly as noted in the white paper above, hold may not function and disconnect the call.  Additionally calls originating from the the PRI on the IPO or an IPO homed extension when transferred to a lync extension cannot be placed on hold or transferred to any other extension (lync or avaya).  The work around used to resolve this issue is SIP proxy as noted here: http://jasonmlee.com/archives/447

Configuring Avaya IPOffice

  1. Verify Avaya SIP Trunk license. Login to the IPO Manager application.   In the tree view navigate to Licensing and confirm that you have an active SIP Trunk Channel License.  If a valid license is not configured in the IPO calls will not route over the SIP Trunk.  You can purchase IPO 412 license keys from http://dpctelcom.com/


  • Create the SIP line for Lync Server. Select Line in the left panel. Right click
    and select New SIP Line. Enter the SIP Domain Name of local Domain in the ITSP
    Domain Name field. Enter the Lync Server IP Address in the ITSP IP
    Address field. Select Remote Party ID in the Send Caller ID field.
    Network Configuration is as follows:
    Layer 4 Protocol is TCP,
    Send Port is the Receive port on your Lync Server in Topology Builder Default is 5060
    Listen Port is the Send port in your Lync server Topology Builder Default is 5060
    Network Topology Info set to NONESipLine
  • Configure SIP URI for known caller ID. Go to the URI Tab and and click add.  Create a primary SIP URI. Enter a unique number for the Incoming Group (Line Group 100) and Outgoing Group (Line Group 100) fields. Enter * for the Local URI, Contact and Display Name fields. Use defaults for all other field. Press the OK button.SIPURI1
  • Configure SIP URI for Unknown Caller ID. The documentation indicates a need for a SIP URI for calls received from the PSTN with withheld caller ID. However this appears not to be 100% necessary nor applicable, but was configured in our installation. Select the SIP URI tab and click on Add again. Enter another a unique number for the Incoming Group (Line Group 101) and Outgoing Group (Line Group 101) fields. Enter 000000000 for the Local URI, Contact and Display Name fields. Calls received with hidden caller ID from the PSTN will be shown as coming from this number on the Lync client. Use defaults for all other field. Press the OK button.SIPURI2
  • Create an Incoming call route for outbound calls from Lync incoming to the IPO over the SIP trunk. (This call can be both IPO extensions or out to the PSTN)  Select Incoming Call Routes in the Left Tree and right click and choose NEW.  Set the Incoming Group ID to the value you set in step 3 as your Incoming Group ID for the SIP URI (Line Group 100).IncomingRoute

    In the Destinations Tab enter . in the Destination Field and select OK


  • Configure a Alternate Route Selection table (ARS) for calls going from PSTN or IPO Extensions to Lync.  The ARS is used to route the call to the SIP Trunk formatted in E.164 format for Lync to receive the calls correctly . Select ARS in the left panel. Right-click and select New. Enter a unique identifier for the route in the Route Name field (e.g. SIP-Lync) and use defaults for all other field on the ARS tab.ARS

    Click on Add button and add short code.  Enter a code matching the 4 digits of the Lync Extension you are wanting to call.
    Deployment of Lync Extensions with DIDs: In a deployment with DIDs of (123)555-65xx with 4 digit extensions in the 6500-6599 range and a Lync server ip address of and the unique Line Group ID of the SIP trunk is 100 the following short code could be used. (note use of the xx and N variables to allow for creating just one short code for 100 DIDs or Extensions)
    For Deployments without DIDs see step 11 below.


  • Create a short code to route 4 digit extension calls from IPO to to Lync.
    This short code allows for 4 digit dialing from the IPO to Lync extensions as well as will allow for inbound call routes to be configured for DIDs that are homed on Lync.
    Select Short Code in the left panel. Right-click and select New. Enter the first 2 digits of the extension range you are wanting to route to Lync followed by xx (example 65xx).  Select Dial for the Feature. Select the SIP-Lync ARS created previously from the Line Group Id drop down list. Enter “65N” for the Telephone Number field. Use default values for all other
    fields. Press the OK button.ShortCode2
  • Create a short code to route Lync calls to the PSTN.  This short code will be matched for any number if a Lync user calls the PSTN and the IPO has no extension match, the call will be routed to the PSTN, without the rule, the IPO doesn’t know what to do with digits dialed that aren’t extensions on the IPO.
    Select Short Code in the left panel. Right-click and select New. Enter “?” in the Code field. Select Dial for the Feature. Select the ISDN/PRI line Outgoing Group Id from the Line Group Id drop down list. Enter “.” for the Telephone Number field. Use default values for all other fields. Press the OK button.OutboundShortCode
  • Create a Short Code for each Lync 4 Digit Extension.  For the IPO to be able to route calls or allow Avaya Extensions to dial 4 digits to call a Lync user, each Lync Extension needs to have a IPO Short Code.  In Hybrid environment, you have to let IPO know that this 4 digit extension is not homed on the IPO but rather on Lync for each user.  Variables can’t be used in a hybrid environment because some extensions live on IPO and some on Lync.
    This example is for a Lync user extension 6500
    Select Short Code in the left panel. Right-click and select New. Enter “6500” in the Code field. Select Dial for the Feature. Enter “6500” for the telephone number and Select the SIP-Lync from the Line Group Id drop down list.  Use default values for all other fields. Press the OK button.Extn6500
  •   Create incoming call route for Lync DIDs
    For an example DID (123) 555-6500 extension 6500
    Select Incoming Call Route in the left panel. Right-click and select New.  Select the PSTN’s incoming Group ID in the Line Group ID drop down box.  Enter “6500” in the Incoming Number to match the ICR last for digits.6500ICR

    On the Destinations Tab enter “6500” to point to the short code created in step 7 above and the call will route via the ARS table to the SIP trunk to Lync formatted as +11235556500@


  •   Configure routing for For Lync Extensions without DIDs (as documented here). An ARS entry will have to be created for each Extension since the IPO cannot use variables in the E.164 formatting of the outbound call and Lync requires the call to come in in the +11235556500;ext=4175 format.
    This example extensions 4150-4175 don’t have DIDs but were valid Lync extensions, in order for IPO extensions to call extensions 4150-4175 a short code would be required for 41xx Pointing to the the SIP-Lync ARS Table. (Assuming no other extensions in the 4100 range are homed on the IPO).NoDIDShortCode

    Then entries for each extension would need to be added to the ARS table.
    Code: 4150, Feature: Dial
    Telephone Number: +1235556500”ext=4150@” (the “”s are required to tell IPO that nothing contained in this part of the string is a variable.  Each subsequent extension would need a ARS entry.


  •   Configure Lync Call routing to use the IPO as a Gateway.  This assumes you have enabled users for enterprise voice which is a fairly well documented process: http://technet.microsoft.com/en-us/library/gg413011.aspx
    After users are enabled, go to the Topology builder and browse the Standard Server.   Check the box for Enterprise VoiceEnableEnterpriseVoice

    Edit the properties and go to the Mediation Server.  Enable Collocated Mediation Server. Define your Listening Ports and click new gateway enter the IP address of the IPO and the Port that it is listening for SIP traffic on.



    Publish the Topology.

  •   Configure Dial Plan and Trunk.  Open Lync Control Panel and go to Voice Routing then Trunk configuration open the newly added Gateway and change the Encryption support level to Optional, Uncheck Media Bypass, Uncheck Centralized Media Processing and Uncheck Enable Refer Support.TrunkConfiguration
  •   Add a translation rule to call 4 digit extensions on the IPO.  This allows a normalized call from the Lync server to pass just 4 digits to the IPO so it correctly routes to the extension on the IPO.
    Starting Digits: +12355565
    Length:  Exactly 12
    Digits to remove: 8
    This rule tells the Lync server to simply pass 65xx to the IPO.IPOTranslationRule
  •   Create a Call Route. Select New Route and name it and add a description.  Leave the Pattern to match the default “*” which matches all calls.VoiceRoute-1

    Scrolling down select Add for Associated Gateways and select the PSTN Gateway.  Do not yet associate a PSTN Usage.  But confirm the Gateway is added.


  •   Create a Site Voice Policy  Choose new and select the site you want to add a voice policy for.  Add a Description and enable all appropriate features.  Then New.VoicePolicy

    Associate the route just created in step 15 by hitting select

    Associate PSTN Route

    choose the route.

    Select PSTN Route

    Go back to Routes and edit the AVAYA PSTN route and scroll to the bottom and Associate the PSTN Usage created.


    Commit all Changes.



After these steps you should be able to make calls via the IPO as a Lync Gateway.


  • Reply Mustafa |

    Hello Jason
    Thank you for taking the time to prepare such a nice stp by step guide.
    I followed your tutorial maybe 10 times already however it is not working for me I cant make calls from lync to ipo extensions vice versa.
    When I check the monitor for ipo all the sip uri are showing unknow@domain.com
    can you tell me where the mistakes could be .
    thank you in advance

  • Reply Mustafa |

    okay i figured what the problem was
    on the tcp port i had it 5060 from avaya side however on the mediation server it was 5067 so they couldn’t talk :)

    i can make calls from lync to outside and ipo extensions however i cant make calls to lync from ipo extensions in the monitor it is giving this error SIP/2.0 488 Invalid incoming Gateway SDP: Gateway ParseSdpOffer Error: No DTMF support on Gateway side.
    Thanks again

  • Reply David |


    Great article, only one I have found where I have been able to get inbound and outbound calling working with Avaya IPO and Lync.

    I have one issue however and that is that I am unable to dial IPO extensions from Lync. We have 3 digit extensions and no matter how many combinations of normalization I cannot get this working. Any idea?

    Many Thanks

  • Reply Laramie |

    I followed this article as closely as I could in regards to my installation specifics, but I’m not able to make calls between Lync and IP Office, or to the PSTN. I believe I have everything configured, but when I run the Test-CSPstnOutboundCall cmdlet, I get a “Gateway did not respond in a timely manner”. What are the best troubleshooting steps to take?

    I’ve been pounding my head against this for a few days now, and I can’t find any problems with the config.

    • Reply jasonlee |

      have you configured the routing table in the IPO? If you haven’t had any VOIP extensions on the IPO before, you may not have the needed routes built.
      also, does the IPO system status show any errors for the trunk goint to Lync? If you can’t pass any traffic between the two it sounds more like a SIP configuration issue on the Avaya than Lync… unless you have a port miss-match on your Gateway config in the Topology.
      If you could post some additional details of your config i’ll compare it to what we have in production and try to provide you some help.

  • Reply selahattin |

    Hi Jason,

    I have a question with related Avaya IP500 V2.First of all,My company have non-DIDs numbers.So my extension range : 100 – 199 (3 digits).
    My question is: How can I config a Alternate Route Selection table (ARS) and step 11 ?I’m using Lync Server 2010 CU4 update.

    • Reply jasonlee |

      @selahattin your ARS would be built on a 3 digit short code 1xx and telephone number of 1N the N simply is a variable that allows for digits following 1 to be included

      • Reply Rehmat |

        Hi KevinI got my xmpp gateway to fnalily work but I am running into couple of issues. When I first start the xmpp server I can federate with gmail user. However after a short bit I get this error on the machine with lync client. 504 Server time-outms-diagnostics: 1047;reason= Failed to complete TLS negotiation with a federated peer server ;WinsockFailureCode= 10054(WSAECONNRESET) ;WinsockFailureDescription= The peer forced closure of the connection ;Peer= lync-xmpp.domain.com ;Port= 5061 ;source= sip.domain.com ;OriginalPresenceState= 0 ;CurrentPresenceState= 0 ;MeInsideUser= No ;ConversationInitiatedBy= 1 ;SourceNetwork= 3 ;RemotePartyCanDoIM= Yes Any reason why this would happen. Thank you, Mayank

  • Reply Tyson Navarre |

    Been working on getting this functioning with an IPO 500 system at my office and having some luck but still cannot make outgoing calls. Our internal extension structure is not mirrored by our DIDs so our system is a little different.

    Watching the SysMonitor, I can see the IP Office box attempting some sort of SIP connection but its hard to tell if its even getting a reply of the Lync Server. Any ideas how best to start troubleshooting along the line?

  • Reply Andrew |

    This article certainly helped and wish Avaya would come out with an updated white paper to fit Lync and not OCS2007.

    We are looking to doing a coexisting environment until we can get everyone switched over to Lync 100%. My problem is getting calls to dial outbound and hit our PRI. I did exactly what you stated in step 8 and still not having success. We did upgrade our phone system to Release 8 and not sure if there is something different that needs to be configured. Have you tried this on Release 8?

    THanks for your help,


    • Reply jasonlee |

      @AndrewGardner Release 8 are you speaking of the IPO release?
      If you are looking at a longer term cohabitation of Lync & IPO i recommend you read this post too: http://jasonmlee.com/archives/447
      We found direct Lync to IPO would cause drop calls when on hold or transferred.

      FWIW, we just de-commissioned our IPO about 6 weeks ago and are now 100% lync. The transition period was about 8 months that we were in a hybrid.

    • Reply jasonlee |

      @Verelst, i am glad my post could help you get your IPO working as your Lync Gateway! Thanks for sharing your success.

  • Reply Jim |

    Hi Jason,

    Very, very useful article thank you.

    I’ve got outbound dialling working, and inbound to lync dial in conferencing, if we receive calls into the dial-in number without callerid (from outside hong kong) they ring and ring. If we dial in from a local number (with callerid) the call is passed to lync and we can join our lync conference.

    On the call monitor for our PRI line i see, waiting for line:

    5/30/12 6:04:40 PM-293ms Call Ref = 306, Originator State = Waiting For Line, Type = Trunk, Destination Type = ARS Form

    On the call monitor for our SIP trunk i see:

    5/30/12 6:13:50 PM-273ms Call Ref = 312, Originator State = Dialling, Type = Trunk, Destination Type = ARS Form
    5/30/12 6:13:50 PM-273ms Call Ref = 312, Short Code Matched = System, 9398

    but it just keeps ringing!

    The only difference i see is there is no caller id on the outside calls? Could this be related? I’m sorry – i’m amazed i’ve got this far, but i have very little experience with pbx’s and this has been a steep curve. Any advice appreciated.

    I have configured a second sip URI with the 000000000 settings but i am on R8 IPO v500 and dont have the registration option.

    Grateful for any guidance or queries!


    • Reply jasonlee |

      @ JimBullock, i am sorry that that hasn’t been my experience… by setting up the two SIP URIs in the IPO both calls with and without callerID passed the calls.

      are you doing direct sip to Lync or proxying it via an asterisk install? You could also monitor the call on the asterisk between the IPO & Lync if you use this configuration http://jasonmlee.com/archives/447

  • Reply Jason |

    Hi, Fantastic article it really helped me get the connectivity setup between my IP500 and Lync, i cannot though seem to get incoming cals direct to a lync user, calls between IPO and Lync work fine both ways. Any Ideas ?

    • Reply jasonlee |

      @Jason Harris, do you have a defined Incoming call route defined for the Lync Extension?

      • Reply Jason |

        Hi Jason,

        I do have a defined incoming call route to the lync extension, when i call i get a strange voicemail message is this likely Lync vm by any chance

  • Reply Jim |

    Hi Jason, I looked into this and seems that it’s related to the odd CID we receive from the carrier. I am in the process of obtaining a twinning license trial as our vendor is under the impression we’ll be able to obfuscate the cid with this and pass the call to the conference number… I’ll let you know how i get on. Looked at doing this with asterisk but i was too bull-in-a-china-shop about it and need to give the dial-plans more attention, if twinning fails i’ll revisit that path. Appreciate the response and i’ll let you know how i get on. thank you.

    • Reply Jason Lee |

      @Jim, i don’t know that twinning will solve your problem… but i’ll be intersted to hear how it goes. There are some other options too in the ARS table that you can configured. Let me know how it goes with your twinning and we’ll see what we can figure out.
      The asterisk proxy was silly easy… i hadn’t ever done anything in asterisk and had the box on a VM going in about 2 hrs.

      • Reply Jim |

        Hey Jason,

        to get around this i created another extension and ICR, then set it on permanent forward to the conference number. Then I changed the display number and left the tel: uri as the original conference number in the conference config on lync (as it would still bounce to lync from the same uri).

        After doing this DID calls routed just fine, the IPO didn’t send the cid onwards – bit of a bodge, but simpler than another machine i suppose. Am going to look at asterisk before we start needing to do call parking.

        Much appreciated, our IPO in Singapore just forwarded the call straight off back to Lync so no issue there .

        Many thanks!


        • Reply Jason Lee |

          Glad to hear its working… not sure i helped you much.. but glad to hear you are moving forward. If you have any questions about getting the proxy working just hit me up.

  • Reply Jason |

    Hi Jason,

    I can now get external calls routed to the Lync user, my question now is that when the Lync user calls out i would like the caller id on the receiving side to see the Lync users DID. Is this possible

    • Reply Jason Lee |

      Ahh… yes the caller ID on outbound calls.. hmmm.. I don’t think i ever got that working It was only the caller id of our main number since that is how our outbound call route was configured on the IPO.

      We have turned off our IPO and are 100% lync… so i can’t go back and test it again.

      The external calls coming into the IPO to lync simply build a Inbound Call route that points to a 4 digit short code which points to the ARS table making it a E.164 format and that will forward to lync. As long as lync has a normalization rule that filters the calls it will match to an extension.

  • Reply Kris Garbet |

    Hey Jason,
    Thanks for your post on IPO and Lync. I am attemptineg the same thing, but with a newer version of IPO and Lync (IP Office 8.0 and Lync 2013)

    We are currently downgrading the switch to 7.23 to get your instructions to match up with our config, but not sure if this will help. I’m wondering if you have a running IPO config that you could share with me so I can see the settings and go from there.


    • Reply Jason Lee |

      Kris sorry for the long delay in responding.

      I have an IPO running out of production, but i think its running version 4 software. I don’t even have a pc with the software installed at the moment since we are now 100% lync for voice.

      Let me check and see if the Virtual Machine still exists that had the Avaya software installed.

  • Reply w1ll1amz |

    Hi Jason,
    What a great post – thank you very much. We have an Avaya IP406 v4.2 but do not have SIP or OneX ability at the moment. I’m trying to work out what we need to do by way of system software upgrade and licenses we need to purchase to enable direct SIP capability with Lync (or if it’s even possible with our IP406?). Are you able to advise, I’d really appreciate it?
    Thanks in advance.

  • Reply Mudasir |

    Hi Jason,
    I would like you to thank you on the above steps for configuration done with Avaya IPO and Lync.
    i tried the same what you have mentioned above ,although it worked fine with me except one issue.. which i belive haven’t been discussed yet. I’m able to call internal extension, all outbound call and incoming on DID number but whenever i make outbound calls it doesnt shows the correct DID number instead showing main board number… would you please help me out if you have done it ….

  • Reply Mike |

    Hi Jason,

    Thanks for the useful blog! Quick question, we have set-up our Lync and Avaya IPO in a similar way however we are currently only able to dial out internal numbers and +1 numbers, other numbers don’t call out even though I use the full international code. From the IPO monitor we can see the call is passed over so I don’t think it’s the dial plan/rules in Lync. Have you had anything similar?

  • Reply Top 10 Best VPN Services |

    I think that everything composed was very logical. But, think about this, suppose you added a little information? I
    am not saying your content isn’t solid., but suppose you added a post title
    that grabbed folk’s attention? I mean Configuring Lync PSTN Calling Thru
    Avaya IPOffice | JasonMLee.com is kinda plain. You could peek at Yahoo’s front page and
    see how they create post titles to get viewers to
    click. You might try adding a video or a
    related picture or two to grab people interested about what you’ve got to say.
    Just my opinion, it might bring your posts a little livelier.

So, what do you think ?