Simple custom Dial Plan (number normalization) for Skype for Business Online.
Below is a quick “one off” and break from my Skype for Business Meetings series.
I created a unique dial plan for a customer the other day and learned so much during the process that once I got it, I had to document it to make it easier for everyone. I know there are other blogs out there that cover this as well, but if you are like me, I just want to get to the meat of it and go from there. For those of you that would like more context, please do check out my friend Kevin’s blog.
What follows is the most basic set of commands to create a normalization rule in Skype for Business Online (SFBO) and assign it to a new Dial Plan. In this case, we are taking a 7-digit number with a 349 prefix (so 349-xxxx) and normalizing it to an E.164 formatted number (+1-613-222-xxxx). Of course, this could be modified for 3, 4, 5 digit easily enough.
NOTE: THESE ARE NOT THE CUSTOMER'S NUMBERS - SIMPLY EXAMPLES - PLEASE DO NOT CALL THEM.
The follow are the commands, in the order you should issue them, to create your new Dial Plan for SFBO.
This will allow both IP Phone users (on SFBO) and the SFBO clients to dial 349-XXXX and have it resolve to +1613222XXXX.
You will need to do all of this in the Skype for Business Online (SFBO) PowerShell. If you have not accessed this area before, this link has a great set of instructions: https://www.oxfordsbsguy.com/2015/11/14/how-to-connect-to-and-manage-connect-to-office365-using-powershell/
Once you get logged in with admin credentials for O365, you can then copy and paste these cmdlets into PowerShell.
NOTE: It took a good 15 minutes before the verification command and client picked up the changes. So be patient.
Below are the commands. I will explain what each command does.
The command below creates a Dial Plan within your tenant called 349dial
New-CsTenantDialPlan -Identity 349dial -Description "349-7 Digit Dialing" -SimpleName "349Dial" Link to this cmdlet
The command below creates a variable ($nr2) with the actual number normalizations within it. It will convert any 7-digit number that starts with 349 and convert it to +1613222XXXX
$nr2 = New-CsVoiceNormalizationRule -Identity Global/NR2 -Description "349dial" -Pattern '^349(\d{4})$' -Translation '+1613222$1' -InMemory Link to this cmdlet
Let look closer at the normalization rule:
Note: Below is the link to the common “regular expressions” language.
/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference
PATTERN: ^349(\d{4})$
^ - start accepting the digit string
349 – place outside the () it will match anything that starts with 349 (but is only part of the equation)
(\d{4})$ - accept the next 4 digits and stored those digits as the variable $. This completes our 7-digit number. If say we wanted to accept a 10-digit number where the area code was 349, the we could change the {4} to {7} and so on.
The entire pattern match only 7-digit numbers starting with 349 and only stores the last 4 digits in the variable - $
The command below adds the number normalization rule that is stored in the variable “$nr2” to the new Dial Plan.
set-CsTenantDialPlan -Identity 349dial -NormalizationRules @{add=$nr2} Link to this cmdlet
The command below lists all Dial Plans in your tenant – verify that you see the “349Dial” Dial Plan and that is has the normalization in it.
Get-csTenantDialPlan Link to this cmdlet
It will look something like this:
PS C:\WINDOWS\system32> Get-CsTenantDialPlan
Identity : Global
Description :
NormalizationRules : {}
ExternalAccessPrefix :
SimpleName : DefaultTenantDialPlan
OptimizeDeviceDialing : False
Identity : Tag:349dial
Description : 349-7 Digit Dialing
NormalizationRules : {Description=Testcallnorm4;Pattern=^349(\d{4})$;Translation=+1613222$1;Name=NR2;IsInternalExten
sion=False}
ExternalAccessPrefix :
SimpleName : 349dial
OptimizeDeviceDialing : False
Notice the difference between the Global Dial Plan and the 349dial Dial Plan – the latter has a normalization rule in it. Yours should look like that.
Now you can add that Dial Plan to a test user.
Grant-CsTenantDialPlan -Identity adelev@ucdemo2017.onmicrosoft.com -PolicyName 349dial Link to this cmdlet
You will need to use one of your own user’s SIP URIs at this point.
Next, we need to verify that the user has the Dial Plan applied.
get-csonlineuser -Identity adelev@ucdemo2017.onmicrosoft.com Link to this cmdlet
again, change the user.
You will see this in their profile:
TenantDialPlan : 349dial
After 15 minutes or so run this command to see if it has propagated.
get-cseffectivetenantdialplan -identity adelev@ucdemo2017.onmicrosoft.com | test-cseffectivetenantdialplan -dialednumber 3499815 Link to this cmdlet
change the user - you should get back something very close to this.
RunspaceId : e0598ac1-2d50-43f7-828c-fe59314f194c
TranslatedNumber : +16132229815
MatchingRule : Description=349dial;Pattern=^349(\d{4})$;Translation=+1613222$1;Name=NR2;IsInternalExtension=False
If you get this:
RunspaceId : e0598ac1-2d50-43f7-828c-fe59314f194c
TranslatedNumber :
MatchingRule :
Then it has not yet made it thru the system.
Finally, the “real” test – is to type 3499815 into the SFB client window and see +16132229815 below as a normalized number in the SFB client.
NOTE: Because of the propagation delay, the verification cmdlet and the client update may not occur at the same time.
If you dial it on the IP Phone, you may not see the normalization until you make the call. This as the behavior on the AudoCodes phone I was using in my testing.
I hope this will help you out and there is no reason it shouldn’t work, but if it doesn’t please reach out to me.
Good luck
Scott