Lync Server 2010 lets you manipulate destination phone numbers before calls are routed to the gateway. The configuration and routing are described in the following sections.
Understanding the Configuration of Route Translations
Configuring translation rules is part of the trunk configuration. Configuring translation rules enables youto manipulate the numbers based on the trunk that is used to egress the call.
The translation rules of a trunk are regular expressions that have a match pattern. Translation rules also have a corresponding translation pattern that is applied if the phone number matches the match pattern. The scope of this configuration can be applied globally, at site level, or at a service (PSTN gateway) level.
The following example illustrates a service-level assignment of translation rules for the identity “service: pstngateway:172.29.107.194”. The rule applies for phone numbers with a prefix “+1” that is translated to “002” prefix. For example +14255550100 is translated to 0024255550100.
First, the OutboundTranslationRule is created and stored in variable $r3. Then the rule pattern and translation are defined as follows:
$r3 =New-CSOutboundTranslationRule -Identity: service:pstngateway:172.29.107.194/gw1_rule
$r3.Pattern = '^\+1(\d*)$'
$r3.Translation = '002$1'
The associated trunk configuration for this particular gateway, pstngateway:172.29.107.194, is stored in the variable $tk3:
$tk3 =Get-CSTrunkConfiguration -Identity service: pstngateway:172.29.107.194
Next, the new OubtboundTranslationRule, $r3, is added to the trunk configuration, $tk3:
Set-CsTrunkConfiguration -Instance $tk3
Understanding the Internals of Route Translations
When the Outbound Routing component is processing a call destined to the PSTN, the following logic is applied to realize the route translation feature:
· Based on the calling user’s voice policy and the destination number, the Outbound Routing component determines which voice route and associated gateway to select for the call.
· The Outbound Routing component uses the destination gateway service ID to look up the translation rules that are associated with the destination voice route. If one or more outbound translation rules are defined at the same scope as the gateway, in the same site as the gateway or globally, the Outbound Routing component attempts to match the pattern and update the destination number.
· The RequestURI is then modified based on the retrieved translations rules, and the translated number is populated in the RequestURI field prior to routing to the Mediation Server.