Microsoft Teams Direct Routing
Direct Routing allows you to connect your Microsoft Teams environment to the Public Switched Telephone Network (PSTN). Follow the steps below to configure Direct Routing for your organization.
Prerequisites
Before you begin, ensure you have the following:
- An active Microsoft 365 subscription, the following SKU's are acceptable:
- Office 365 E1/E3/E5/A3/A5 or Microsoft 365 E3/E5/A3/A5
- Microsoft 365 Business Basic/Standard/Premium
- Microsoft Teams license:
- Microsoft Teams Phone Standard
- Business SIP Service with Microsoft Teams enabled
- The unique domain provided by us in the format:
abcdef.teams.mycloudpbx.com.au(provided at activation of your myCloudPBX Team Direct Routing service).
Note
Replace abcdef with your unique domain provided by myCloudPBX
Step-by-Step Guide
Step 1: Prepare Your Environment
-
Add Domain:
- Navigate to the Microsoft Admin Center.
- Log in with your administrator credentials.
- Go to Settings > Domains
- Add your provided domain
abcdef.teams.mycloudpbx.com.au - Select Add a TXT record to the domain's DNS records and Continue
- Note the newly generated
TXT value (MS=msxxxxx)
-
Verify Domain:
- Navigate to the Portal, select your Business SIP service > Congiguration
- Enter the TXT record generated by Microsoft in Step f, click Save
- Navigate back to the Microsoft Admin Center.
- Continue the setup by selecting Verify
- Uncheck Exchange and Exchange Online Protection and click Continue
- Click Done to complete
Step 2: Activate myCloudPBX Teams Domain
To activate, we will need to create a single 'Activation User', this user will be tempory and can be removed once setup is complete.
- From the Admin Center, select Users > Active User > Add a User
-
Enter the following details
First name: Teams Last name: Activation Display name: Teams Activation Username: TeamsActivation Domains: abcdef.teams.mycloudpbx.com.au.au Check Automaically create a password Uncheck Require this user to change their password... Uncheck Send password in email...
-
Assign the User a Microsoft 365 subscription with Microsoft Teams Phone
Step 3: Configure Direct Routing
-
Log in to Microsoft Teams Admin Center:
- Navigate to the Microsoft Teams Admin Center.
- Log in with your administrator credentials.
-
Add the PSTN Usage Record:
- In the Teams Admin Center, go to Voice > Direct Routing.
- Click on Manage PSTN usage records at the top right.

- Click Add, enter your unique Teams URL (eg
abcdef.teams.mycloudpbx.com.au) and click Apply.
-
Create the Voice Route:
The voice route tells Teams which calls to send to our SBC. You can create it in the Teams Admin Center or in PowerShell. Both do exactly the same thing, so use whichever you prefer.
In the Teams Admin Center:
- Go to Voice > Direct Routing and select the Voice routes tab.
- Click Add.
- Enter your unique Teams URL (eg
abcdef.teams.mycloudpbx.com.au) as the Name. - Set Priority to
1. - Under Dialed number regex pattern, enter
.*.so the route matches every number. - Under SBCs enrolled, click Add SBCs and select
abcdef.teams.mycloudpbx.com.au. - Under PSTN usage records, click Add PSTN usage and select the record you created in the previous step.
- Click Save.
Alternative: create the voice route in PowerShell
This does the same job as the eight steps above. Connect to PowerShell and enter the following:
Import-Module MicrosoftTeams Connect-MicrosoftTeamsWhen prompted enter your Microsoft Teams Admin user details, then run:
New-CsOnlineVoiceRoute -Identity abcdef.teams.mycloudpbx.com.au -NumberPattern ".*." -Priority 1 -OnlinePstnUsages abcdef.teams.mycloudpbx.com.au -OnlinePstnGatewayList abcdef.teams.mycloudpbx.com.au-OnlinePstnUsagesis the PSTN usage record and-OnlinePstnGatewayListis the SBC, so this one command covers both of the fields you would otherwise fill in on the form.Tip
Replace abcdef with your unique domain
-
Configure Voice Routing Policies:
- In the Microsoft Teams Admin Center, navigate to Voice > Voice routing policies.
- Click on Add to create a new voice routing policy.
- Enter your unique Teams URL (eg
abcdef.teams.mycloudpbx.com.au) - Under PSTN Usage Records, select the PSTN usage record that applies to your Direct Routing configuration.
- Add the newly created PSTN usage record to the policy.
-
Assign Voice Routing Policies:
- Go to Users > Manage users.
- Select the users you want to assign the voice routing policy to.
- Click on Edit and assign
abcdef.teams.mycloudpbx.com.auto the selected users.
Tip
Teams activation can take up to 24 hours.
You can check the activation status by selecting Analytics & reports > Usage reports > PSTN and SMS (preview) usage
Step 4: Configure Dial Plans
Microsoft Teams uses E.164. We will create a series of normalisation rules to align with the standard telephone number format for end users.
- Go to Voice > Dials Plans
- Click Add
- Name the Dial Plan
[STATE] abcdef.teams.mycloudpbx.com.au.au. We reccommend creating a dial plan for each State/Territory your users are located in, this will allow for localised dialling for their location.
Australia
- Click Add to create the first normalisation rule

- Enter a Name and click Advanced, follow this process to create a new rule for each of the following
| Name | Rule Creation Mode | If Condition | Then Do This |
|---|---|---|---|
AU-National |
Advanced | ^0([2\|3\|7\|8]{1}[0-9]{8})$ |
+61$1 |
AU-Mobile |
Advanced | ^0([4\|5]{1}[0-9]{8})$ |
+61$1 |
AU-13-1300 |
Advanced | ^(13(\d{4}\|00\d{6}))$ |
+61$1 |
AU-1800 |
Advanced | ^(1800\d{6})$ |
+61$1 |
AU-0011 |
Advanced | ^0011(\d+)$ |
+61$1 |
AU-000 |
Advanced | ^(000)$ |
$1 |
Create local dial plans for users in a specific state/territory and allocate as required
| Name | Rule Creation Mode | If condition | Then do this |
|---|---|---|---|
AU-Local-02 |
Advanced | ^([2-9]\d{7})$ |
+612$1 |
AU-Local-03 |
Advanced | ^([2-9]\d{7})$ |
+613$1 |
AU-Local-07 |
Advanced | ^([2-9]\d{7})$ |
+617$1 |
AU-Local-08 |
Advanced | ^([2-9]\d{7})$ |
+618$1 |
- Click Save
- Assign the Policy to users by selecting Users > Manage Users and Select the User, click Policies
- Select Voice Routing Policy > Edit
- Choose abcdef.teams.mycloudpbx.com.au.au from the Drop Down List
New Zealand
- Click Add to create the first normalisation rule
- Create a new rule for each of the following
| Name | Rule Creation Mode | If condition | Then do this |
|---|---|---|---|
NZ-National |
Advanced | ^0([2\|3\|4\|6\|7\|9]{1}[0-9]{7})$ |
+64$1 |
NZ-0800 |
Advanced | ^(0800\d{6,7})$ |
+64$1 |
NZ-0508 |
Advanced | ^(0508\d{6,7})$ |
+64$1 |
NZ-0900 |
Advanced | ^(0900\d{6,7})$ |
+64$1 |
NZ-Mobile |
Advanced | ^0(2\d{7,9})$ |
+64$1 |
- Create local dial plan for users in a specific state/territory
| Name | Rule Creation Mode | If condition | Then do this |
|---|---|---|---|
NZ-Local-02 |
Advanced | ^([2-9]\d{6})$ |
+64$1 |
NZ-Local-03 |
Advanced | ^([2-9]\d{6})$ |
+64$1 |
NZ-Local-04 |
Advanced | ^([2-9]\d{6})$ |
+64$1 |
NZ-Local-06 |
Advanced | ^([2-9]\d{6})$ |
+64$1 |
- Click Save
- Assign the Policy to users by selecting Users > Manage Users and Select the User, click Policies
- Select Voice Routing Policy > Edit
- Choose abcdef.teams.mycloudpbx.com.au.au from the Drop Down List
Step 5: Emergency Call Routing
- Go to Voice > Emergency Policies
- Click Call Routing Policies > Add
- Click Add > Add
Australia
- Enter
abcdef.teams.mycloudpbx.com.au.aufor the name of the Call routing policy - Enter
000for the dial string - Select abcdef.teams.mycloudpbx.com.au.au from the drop down PSTN usage record
- Click Save
- Select Users > Manage Users and Select the User, click Policies
- Select Emergency Call Routing > Edit
- Choose abcdef.teams.mycloudpbx.com.au.au from the Drop Down List
New Zealand
- Enter
abcdef.teams.mycloudpbx.com.au.aufor the name of the Call routing policy - Enter
111for the dial string - Select abcdef.teams.mycloudpbx.com.au.au from the drop down PSTN usage record
- Click Save
- Select Users > Manage Users and Select the User, click Policies
- Select Emergency Call Routing > Edit
- Choose abcdef.teams.mycloudpbx.com.au.au from the Drop Down List
Step 6: Test the Configuration
- Make a Test Call:
- Use a Microsoft Teams client to make a test call to an external number.
- Verify that the call routes correctly through the Direct Routing configuration.
Troubleshooting
If you encounter issues, consider the following troubleshooting steps:
-
Verify DNS Settings: Ensure the DNS settings for your custom domain are correctly configured.
-
Confrim Direct Routing SBC is enrolled: From Voice > Direct Routing select your teams domain and ensure the SBC has been derived from teams.mycloudpbx.com.au.au.
-
Delete the existing incomplete voice route and re-create
- From inside the Teams Admin CenterVoice > Direct Routing > Voice routes
- Select the existing voice route and click Delete
Connect to PowerShell to complete the following:
> Import-Module MicrosoftTeams
> Connect-MicrosoftTeams
> New-CsOnlineVoiceRoute -Identity abcdef.teams.mycloudpbx.com.au -NumberPattern ".*." -Priority 1 -OnlinePstnUsages abcdef.teams.mycloudpbx.com.au -OnlinePstnGatewayList abcdef.teams.mycloudpbx.com.au
Replace abcdef.teams.mycloudpbx.com.au with your Teams domain