Lync Dial Plans and Normalization Rules

For Enterprise Voice, Lync requires a Dial Plan to be defined. The Dial Plan will have a number of normalization rules that convert the number typed in by the user (or selected by them from an Office application) and convert it to E.164 format. Normalization rules use .Net regular expressions. The objective is to match what the user has typed in and apply a translation to convert it to E.164. The dial plan is configured under Voice Routing in the Lync Control Panel. The dial plan can be scoped at the Site, Pool or User level.

Regex Basics

There are a small number of Regex elements used in Lync Normalization rules are these are described here.

element Meaning Example Explanation of example 
Match at beginning of string ^123 Match the digits 123 at the beginning of the string 
() Captures the matched subexpression (456) Capture what is between the parentheses into a numbered variable, starting at 1 which can be accessed as $n, eg $1
Specifies zero or more matches\d(*)
Specifies one or more matches\d(+)
Specifies zero or one matches\d(+)
{n}Specifies exactly n matches\d{4}Match 4 digits
{n,}Specifies at least n matches\d{3,} Match at least 3 digits (with no limit to number of digits matched 
{n,m}Specifies at least n, but no more than m, matches.\d{3,6} Match at least 3 digits but no more than 6 digits 
\d Matches any decimal digit ^\d Match any decimal digit (at the beginning of a string)
|Matches any one of the terms separated by the | (vertical bar) character 134 | 135 Match either the string 134 or the string 135 
$The match must occur at the end of the string^(123)$Match exactly digits 123 (and not 1234)



Regex is used for translations following matches. In the case of Lync, this allows the addition of a leading + symbol and the insertion of digits, either from the matched string (S1) or fixed digits.

Lync provides a normalization rule builder that guides you through the process of defining regular expressions that will cater for most circumstances. The generated regular expression can be hand modified to handle more complex situations.

The normalization rule builder has four steps, steps 1 and 2 match the pattern and steps 3 and 4 perform the translation.

  • Starting digits: (Optional) Indicate the leading digits of dialed numbers you want the pattern to match. For example, type 234 if you want the pattern to match dialed numbers beginning with 234. This will result in a match pattern of ^(234)
  • Length: Indicate the number of digits in the matching pattern and select whether you want the pattern to match this length exactly \d{4}, match dialed numbers that are at least this length (\d{3}\d+), or match dialed numbers of any length (\d*).
  • Digits to remove: (Optional) Indicate the number of starting digits to be removed from dialed numbers you want the pattern to match. This will change how digits are captured into variables.
  • Digits to add: (Optional) Indicate digits to be added to dialed numbers you want the pattern to match.
If the pattern to match or the translation rule does not meet your exact requirements, manual editing is allowed.

The normalisation rules are checked in order from top down, the first match is the only translation performed.

Example Normalization Rules

NameStarting DigitsLengthDigits to removeDigits to addPattern to matchTranslation rule
4 Digit Extension3Exactly 40+35320911^(3\d{3})$+35320911$1
International Numbers00At least 22+^00(\d*)$+$1
National Numbers0At least 11+353^0(\d*)$+353$1
Emergency NumberNANANANA^(999$|112$)+$1
(Note: these rules are specific to Ireland, Comreg Numbering Plan specifies 020 91X XXXX for 'Drama' use, similar to 555 area code in US)


Dial Plan Testing

In the Lync Control Panel, we can test individual normalization rules or we can create a series of tests that can be saved and run to ensure our normalization and routing functions correctly.

NameDialed number to testExpected translation
Local extension3001+353209113001
International Number0018095556789+18095556789
National Number0209113002+353209113001
Emergency Number112+112
Emergency Number999+999



No comments:

Post a Comment