Add Voice Route and Online Voice Routing Policy

The Service Provider SBC is added as a PSTN SBC to the Service Provider M365 Teams tenant. This enables Live Platform customers to connect calls to their Service Provider Carrier or to their own Carrier (BYOC), traversing the Service Provider SBC, via the Hosted Direct Routing model using the Derived trunk feature.

Details on certificate and registering base domain: Certificates
The derived PSTN Trunk is added to customer tenant, during onboarding by UMP M365 scripts, via power shell. You cannot add a derived trunk via Web Interface. Derived PSTN Trunk

Hosted Essentials customers can only connect calls (configure SIP Connections) using the Derived PSTN trunk. Hosted Essentials Plus and Hosted Pro customers can alternatively use the Derived PSTN trunk or configure their own SBC devices for their SIP Connections. In this case, Automatic DNS provisioning can be used to add the DNS records for the additional SBC devices (see Setting up Fully Automatic DNS Provisioning).

In this procedure, you must do the following in Microsoft PowerShell (these actions cannot be performed in the Live Platform Service Portal for the customer tenant):

Create PSTN Usage (Globally defined)
Define Voice Route in the customer tenant
Do the following:
1. Open the Microsoft Teams admin center for the customer tenant and then in the Navigation pane, select VoiceDirect Routing.
2. Select the Voice routes tab and note the default LocalRoute for the tenant.

3. In the Navigation pane, select Voice routing policies. Note the default Global (Org-wide default) policy.

4. Open PowerShell and connect to MicrosoftTeams module:
Copy
Connect-MicrosoftTeams
5. Connect to your customer tenant account with Azure MFA authentication.

Once successfully connected, the PowerShell prompt is ready and the details of your tenant are displayed.

6. Define a globally scoped PSTN Usage in the customer tenant or region:
Copy
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="pu-unrestricted"}
7. Define a voice route in the customer tenant (create one per SBC FQDN or as provided by your Service provider). For a Single SBC region type:
Copy
New-CsOnlineVoiceRoute -Identity "vr-unrestricted" -NumberPattern "^(.*)$" -OnlinePstnGatewayList M365x89839532.customers.audiocodes.be -Priority 1 -OnlinePstnUsages "pu-unrestricted"
8. Open the Microsoft Teams admin center for the tenant and in the Navigation pane, select Direct Routing. Note that the new route has been added:

9. Create a new VoiceRoutingPolicy and associate it to the PSTN Usage that you created above:
Copy
New-CsOnlineVoiceRoutingPolicy "vrp-unrestricted" -OnlinePstnUsages "pu-unrestricted"

10. To test voice routing, please prepare a test user accounts. These accounts will be used to test making and receiving Teams phone calls via the Live Platform. Run the following commands for each test account:
Copy
Set-CsPhoneNumberAssignment -identity LeeG@M365x89839532.OnMicrosoft.com -PhoneNumber +61398675599 -PhoneNumberType DirectRouting
Copy
Grant-CsOnlineVoiceRoutingPolicy -Identity LeeG@M365x89839532.OnMicrosoft.com -PolicyName "vrp-unrestricted"
11. To view the attributes of any user, issue the command:
Copy
Get-CsOnlineUser -Identity LeeG@M365x89839532.OnMicrosoft.com | fl *Voice*,*dial*,*line*

The following is retrieved:

Copy
EnterpriseVoiceEnabled               : True
OnPremEnterpriseVoiceEnabled         : False
OnlineVoiceRoutingPolicy             : vrp-unrestricted
OnlineVoicemailPolicy                : 
TeamsVoiceApplicationsPolicy         : 
DialPlan                             : 
OnlineDialOutPolicy                  : 
TeamsMediaLoggingPolicy              : 
TenantDialPlan                       : 
CallingLineIdentity                  : 
LineUri                              : tel:+61398675599
OnPremLineUri                        : 
OnlineAudioConferencingRoutingPolicy : 
OnlineDialOutPolicy                  : 
OnlineVoiceRoutingPolicy             : vrp-unrestricted
OnlineVoicemailPolicy                : 
12. In the Microsoft Teams admin center Navigation pane, select Phone numbers to view the assigned numbers for the tenant. Notice that the phone number that you assigned to Lee Gu '+61398675590' is displayed.

13. Open the properties for the user and then click the Policies tab to view that the newly applied policies; in the search field, type 'online' to retrieve these policies.

14. In the Navigation pane, select Voice routing policies.

15. Click the View users button adjacent to the entry for the new Routing policy that you just added. Note the new phone number that you just added is assigned to the policy.

16. Run the following command to disconnect your tenant:
Copy
Disconnect-MicrosoftTeams