Location Based Routing (LBR) was introduced in the Lync2013 Feb 2013 CU making it possible to restrict the routing of calls between VoIP endpoints and PSTN endpoints based on the location of the parties in the call. Location-Based Routing is part of the Lync Server 2013 Enterprise Voice infrastructure and when enabled, allows Lync to enforce call authorization rules on whether calls can be routed to PBX or PSTN endpoints based on the Lync caller’s geographic location. This helps to enforce PSTN Toll-Bypass in countries where regulations prohibit it. Even with least cost routing enabled, the location based routing policies will take precedence. This article walks briefly through the setup and configuration of LBR and tests it against the Polycom VVX family of Lync IP Phones.
As mentioned we are using Asterisk v11.14 to emulate a PSTN gateway. Asterisk can be downloaded here and in this lab I'm running the 64-bit version of AsteriskNOW 6.12 on Windows Server 2012 Hyper-V. The steps to configure an Asterisk server and create the SIP Trunk to Lync was covered in this article back in Sep 2012 and therefore won't be repeated here. Although the article was written for AsteriskNOW2.0, much of the same concepts still apply in the new version with only minor changes to get a basic SIP trunk working with the necessary inbound/outbound routes. We also won't be covering in detail the steps to configure Enterprise Voice in Lync as there are already much guidance available publicly.
Instead, in this section we focus on the LBR configuration itself. As a starting point, we first create the Trunk using Topology Builder:
On the Asterisk side, we configure the SIP Trunk to use TCP 5060 next hop to the Lync FE. This can be seen on the diagram on the right. Note the parameters need to be entered in the PEER Details box as shown and the USER Details should be left blank.
In the inbound Routes we configure Asterisk to ring the extension 3001 so that the X-Lite phone registered to this extension will ring when Lync clients make a call through this trunk
First we need to create a new VoiceRoutingPolicy that specifies the PstnUsage that uses the gateway. In this lab the cmdlet to do this is
New-CsVoiceRoutingPolicy -Identity "AXALBR" -PstnUsages "Local"
Then we enable the Global voice policy to PreventPSTNTollBypass using the cmdlet:
Set-CSVoicePolicy -Identity "Global" -PreventPSTNTollBypass $true
Next we proceed to enable LBR on the network site and trunk in AXATower which has the subnet 10.222.208/24 using the cmdlet:
Set-CsNetworkSite -Identity "SG AXA Tower" -EnableLocationBasedRouting $true -VoiceRoutingPolicy "AXALBR"
The Trunk Configuration also needs to be modified to enable LBR for the Network Site using the cmdlet:
Set-CsTrunkConfiguration -Identity Global -EnableLocationRestriction $true -NetworkSiteID "SG AXA Tower"
Finally we enable LBR for the global routing configuration:
Set-CsRoutingConfiguration -EnableLocationBasedRouting $true
This sequence of cmdlets are shown below:
For this test, we have two Polycom VVX phones signed in with the same Lync account as Edina. The VVX410 is on the same subnet as the PSTNGatway as shown below. As expected calls to the X-Lite softphone at x3001 goes through successfully: