Skip to content

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:

  1. 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
  2. Microsoft Teams license:
    • Microsoft Teams Phone Standard
  3. Business SIP Service with Microsoft Teams enabled
  4. 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

  1. Add Domain:

    1. Navigate to the Microsoft Admin Center.
    2. Log in with your administrator credentials.
    3. Go to Settings > Domains
    4. Add your provided domain abcdef.teams.mycloudpbx.com.au
    5. Select Add a TXT record to the domain's DNS records and Continue
    6. Note the newly generated TXT value (MS=msxxxxx)
  2. Verify Domain:

    1. Navigate to the Portal, select your Business SIP service > Congiguration
    2. Enter the TXT record generated by Microsoft in Step f, click Save
    3. Navigate back to the Microsoft Admin Center.
    4. Continue the setup by selecting Verify
    5. Uncheck Exchange and Exchange Online Protection and click Continue
    6. 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.

  1. From the Admin Center, select Users > Active User > Add a User
  2. 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...
    

    User Activation

  3. Assign the User a Microsoft 365 subscription with Microsoft Teams Phone

Step 3: Configure Direct Routing

  1. Log in to Microsoft Teams Admin Center:

    1. Navigate to the Microsoft Teams Admin Center.
    2. Log in with your administrator credentials.
  2. Set Up PSTN Gateway:

    1. In the Teams Admin Center, go to Voice > Direct Routing.
    2. Click on Manage PSTN usage records User Activation
    3. Click Add and enter your unique Teams URL (eg abcdef.teams.mycloudpbx.com.au) and Apply

    4. Connect to PowerShell and enter the following:

    Import-Module MicrosoftTeams

    Connect-MicrosoftTeams

    When prompted enter your Microsoft Teams Admin user details.

    New-CsOnlineVoiceRoute -Identity abcdef.teams.mycloudpbx.com.au -NumberPattern ".*." -Priority 1 -OnlinePstnUsages abcdef.teams.mycloudpbx.com.au -OnlinePstnGatewayList abcdef.teams.mycloudpbx.com.au

Tip

Replace abcdef with your unique domain

  1. Configure Voice Routing Policies:

    1. In the Microsoft Teams Admin Center, navigate to Voice > Voice routing policies.
    2. Click on Add to create a new voice routing policy.
    3. Enter your unique Teams URL (eg abcdef.teams.mycloudpbx.com.au)
    4. Under PSTN Usage Records, select the PSTN usage record that applies to your Direct Routing configuration.
    5. Add the newly created PSTN usage record to the policy.
  2. Assign Voice Routing Policies:

    1. Go to Users > Manage users.
    2. Select the users you want to assign the voice routing policy to.
    3. Click on Edit and assign abcdef.teams.mycloudpbx.com.au to 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.

  1. Go to Voice > Dials Plans
  2. Click Add
  3. 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 Dial Plan
  • 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

  1. Go to Voice > Emergency Policies
  2. Click Call Routing Policies > Add
  3. Click Add > Add

Australia

  1. Enter abcdef.teams.mycloudpbx.com.au.au for the name of the Call routing policy
  2. Enter 000 for the dial string
  3. Select abcdef.teams.mycloudpbx.com.au.au from the drop down PSTN usage record
  4. Click Save
  5. Select Users > Manage Users and Select the User, click Policies
  6. Select Emergency Call Routing > Edit
  7. Choose abcdef.teams.mycloudpbx.com.au.au from the Drop Down List

New Zealand

  1. Enter abcdef.teams.mycloudpbx.com.au.au for the name of the Call routing policy
  2. Enter 111 for the dial string
  3. Select abcdef.teams.mycloudpbx.com.au.au from the drop down PSTN usage record
  4. Click Save
  5. Select Users > Manage Users and Select the User, click Policies
  6. Select Emergency Call Routing > Edit
  7. Choose abcdef.teams.mycloudpbx.com.au.au from the Drop Down List

Step 6: Test the Configuration

  1. Make a Test Call:
    1. Use a Microsoft Teams client to make a test call to an external number.
    2. 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