Voice routing to support PSTN re-routing

In a previous post I discussed how the policies related to PSTN re-routing and bandwidth policy override worked. In this post I’ll use the same setup and describe how to configure voice routing to support PSTN re-rerouting. I will assume that the calling user is allowed PSTN re-routing by policy and that Alice has been configured with Line URI +4512345678 and Bob with Line URI +4587654321

pstn re-route

PSTN re-routing is the ability of the Lync Server to re-route a Lync call via an external network in case bandwidth is restricted. The network is typically the PSTN, but could also be a private PBX infrastructure.

Lync re-routes the call to the Line URI of the called user. It bypass the normal Reverse Number Lookup (RNL), such that the call is not converted back to a Lync call.

The voice policy of the calling user and the normal voice routing configuration are also used for PSTN re-routing. Outbound Routing (OBR) will look to find a matching route (PSTN Usage and number pattern). In order to make sure PSTN re-routing can happen it is therefore necessary to ensure that voice routes are available for the DID range(s) used for Lync users and that PSTN gateways in all sites are listed in those voice routes.

For the setup above the following voice route would enable PSTN re-routing for users with PSTN usage “DK”:

set-CsPstnUsage –Usage ”DK”
$a=Get-CsService -pstngateway | where {$_.poolfqdn -eq "pstngw1"}
$b=Get-CsService -pstngateway | where {$_.poolfqdn -eq "pstngw2"}
$vr=new-csvoiceroute DK -NumberPattern '(^\+45)'
$vr.PstnGatewayList.add($a.ServiceId)
$vr.PstnGatewayList.add($b.ServiceId)
$vr.PstnUsages.add("DK")
$vr.priority=0
Set-CsVoiceRoute -instance $vr

OBR use the following logic when trying to route the call via PSTN re-routing:

  • If it can’t find a matching route, i.e. the user is not allowed to call this number or there is no matching pattern, the call is routed to the called users voice mail
  • If it finds a matching route it will send the call to one of the returned PSTN gateways
  • If multiple PSTN gateways are returned it will try them one by one until the call is successful or there are no more PSTN gateways
  • If it happens to try a PSTN gateway located in a remote site the call will fail due to bandwidth restrictions and OBR will try the next returned PSTN gateway.

Let’s try to summarize the different outcomes in the scenario where Alice calls Bob, bandwidth is restricted and Alice has been allowed PSTN re-routing:

Voice Policy for Alice Voice Route PSTN Usage Voice Route Pattern Voice Route PSTN Gateway(s) Result
National DK +45 pstngwy1 Alice is not allowed to call +45 numbers and the call is therefore sent to Bob’s voice mail
DK DK +45 pstngw2 Alice is allowed to call +45 numbers, but the voice route only contains a PSTN gateway in a site with restricted bandwidth. The call is therefore sent to Bob’s voice mail
DK DK +45 pstngw1 Alice is allowed to call +45 numbers and a local PSTN gateway is found in the voice route. The call is sent out of pstngw1 and in via pstngw2 to Bob
DK DK +45 pstngw2 pstngw1 Alice is allowed to call +45 numbers and a remote PSTN gateway is tried first as next hop. The calls fails due to bandwidth restrictions and OBR tries the second next hop. This time it is the local PSTN gateway. The call is sent out of pstngw1 and in via pstngw2 to Bob