Norwegian dialplan and normalization rules for Lync

Hi,
To save some time I made a small but useful scripts for creating the needed dialplan and normalization rules for calls to the Norwegian tele-operators.





The script is here:




<#
Create Norwegian DialPlan for Lync with Norwegian Normalization rules
The scrips first Creates a DialPlan with the desired name.
Then it adds the Norwegian common dialing rules for calling PSTN calls.
Finally it removes the annoying "Keep All" rule that is added by default.
Created by Kjetil Lindløkken
http://drlync.blogspot.no/
#>
Import-Module Lync
$LogFile=".\DialPlanLog.txt"
$DialPlanName = $( Read-Host "Enter The Desired DialPlan Name, Please")
Start-Transcript -Path $LogFile -Append
New-CsDialPlan -Identity $DialPlanName -Verbose
New-CsVoiceNormalizationRule -Parent $DialPlanName -Name "NorwegianEmergency" -Description "Call Norwegian 3-Didgit 11X-Numbers" -Pattern '^(11\d{1})$' -Translation '+47$1' -Verbose


New-CsVoiceNormalizationRule -Parent $DialPlanName -Name "Norwegian 3 Digits Numbers" -Description "Call Norwegian 3-Didgit Service-Numbers" -Pattern '^(1\d{2})$' -Translation '+47$1' -Verbose
New-CsVoiceNormalizationRule -Parent $DialPlanName -Name "Norwegian 4 Digits Numbers" -Description "Call Norwegian 4-Didgit Service-Numbers" -Pattern '^(\d{4})$' -Translation '+47$1' -Verbose
New-CsVoiceNormalizationRule -Parent $DialPlanName -Name "Norwegian 5 Digits Numbers" -Description "Call Norwegian 5-Didgit Service-Numbers" -Pattern '^(\d{5})$' -Translation '+47$1' -Verbose
New-CsVoiceNormalizationRule -Parent $DialPlanName -Name "Norwegian 8 Didgit Numbers" -Description "Call Norwegian 8-Didgit Numbers" -Pattern '^(\d{8})$' -Translation '+47$1' -Verbose
New-CsVoiceNormalizationRule -Parent $DialPlanName -Name "International calls with 00 prefix" -Description "International calls starting with 00" -Pattern '^00(\d{5}\d+)$' -Translation '+$1' -Verbose
New-CsVoiceNormalizationRule -Parent $DialPlanName -Name "Inetrnational calls with + as prefix" -Description "International calls starting with +" -Pattern '^(\+\d{6}\d+)$' -Translation '$1' -Verbose
Remove-CsVoiceNormalizationRule -Identity "$DialPlanName/Keep All" -Verbose
Write-Output ("Finished at: " + (Get-Date -format  yyyy-MM-dd-HH:mm:ss) + "A logfile has been created as " + $LogFile);
Stop-Transcript

Comments

  1. Updated the script today with a few more rules for 3 anf four digit nnorwegian service numbers.

    ReplyDelete

Post a Comment

Popular Posts