Just to recap, dial plan is essentially a collection of digit manipulation (aka normalization) rules that translate dialled numbers into an alternate format (typically E.164) for purposes of call authorization and call routing. Each normalization rule defines a specific number matching pattern and translates the dialled digits based on a regular expression rule. Different dial plans can be assigned different users so that calls can be authorized and routed correctly. In Skype for Business on-premise, a dial plan is used in conjunction with Voice Routes and PSTN Usages in order to determine what calls a user is allowed to make and how to route that call out to the PSTN. Voice routes associate a set of dialled digit matching patterns to set of PSTN Usages and PSTN Trunks. PSTN Trunks define a specific PSTN gateway with a Mediation Server pool. However, prior to the general availability of Tenant Dial Plans in Skype for Business Online, CloudPBX users were limited to the default country dial plan that was assigned automatically based on the users' location. This default country dial plan was fixed and any necessary number manipulation had to be performed by the PSTN Gateway or IP-PBX that is connected to a CloudConnector (CCE) instance or by an on-premise Skype for Business pool in a hybrid configuration. Below is an example of the default country dial plan for a CCE users based on a Singapore SG tenant:
Tenant dial plans can be further broken into two scopes - tenant scope or user scope. If a tenant defines and assigns a user scoped dial plan, then that user will be provisioned with an effective dial plan of the user’s service country dial plan and the assigned user dial plan. If a tenant defines a tenant scoped dial plan, then that user will be provisioned with an effective dial plan of the user’s service country dial plan and the tenant dial plan. If both a tenant scoped dial plan and user scoped dial plan is defined, the user scoped dial plan takes precedence. To understand more about tenant dial plans and scopes, refer to https://support.office.com/en-us/article/What-are-PSTN-Calling-dial-plans-2f0cfb59-1ca1-4e31-84ce-09d0b1a7ce1b?ui=en-US&rs=en-US&ad=US
Before proceeding to create and assign tenant dial plans in our tenant, its worthwhile to look at the existing lab environment and how the Polycom VVX phones configured. Our lab environment is a hybrid setup with on-premise PSTN connectivity via a existing Skype for Business FE Pool configured with split-domain with a Office365 E5 tenant. The walkthrough for setting up this environment was already covered in the previous blog post http://www.ucprimer.com/tech-blog/deploying-polycom-phones-for-cloud-pbx-with-on-premise-pstn-connectivity-part-1. The Polycom VVX phone is already signed into an account homed with Skype for Business Online. With regards to dial plans, this environment is configured to use on-premise dial plan by way of setting the parameter using the cmdlet set-cstenanthybridconfiguration -UseOnPremDialPlan $true as shown below
- Match any 4 digit number starting with 3 and add prefix +656445: ^(3\d{3})$ ---> +656445$1
- Match any 4 digit number and add prefix +656389: ^(\d{4})$ ----> +656389$1
- reg.1.applyServerDigitMapLocally = 1
So now we can proceed to create the Tenant Dial Plan using remote Powershell into our tenant. First we create a new tenant dial plan:
- New-CsTenantDialPlan -Identity UCPTenantDP
- $nr7 = New-CsVoiceNormalizationRule -Parent Global -name SG7Digit -Description "SG 7digit TenantDP" -Pattern '^(\d{7})$' -Translation '+656$1' -IsInternalExtension $false -InMemory
- Set-CsTenantDialPlan -Identity UCPTenantDP -NormalizationRules @{Add=$nr7}
- get-CsTenantDialPlan -identity UCPTenantDP
- Grant-CsTenantDialPlan -Identity [email protected] -PolicyNAme UCPTenantDP
- Get-CsEffectiveTenantDialPlan -Identity [email protected]
- set-CsTenantHybridConfiguration -UseOnPremDialPlan $false
Now that the tenant dial plan has been created, we restart the VVX phones so that in-band provisioning can occur and the phone will get the latest normalization rules from the server. This can be seen in the phone status screen on the web browser admin interface as shown below with the 7Digit normalization rule that we created along with the rules from the default service country dial plan: