Direct Routing with Microsoft Teams allows businesses to connect external phone lines to Microsoft Teams and use Teams as an office phone system instead of a legacy PBX system. This means you can maintain your existing SIP trunks and PSTN connectivity -- retaining control over your numbers and realizing cost savings over the MS Teams Calling Plans.
This article will guide you on how to use Telnyx as a PSTN provider for Microsoft Teams Direct Routing. Once set up is complete, Telnyx customers will be able to use numbers purchased from Telnyx to send and receive calls via the PSTN from the same Teams account.
Instructions for configuring Telnyx with Microsoft Teams Direct Routing
Note: This integration is carried out via the Telnyx MS Teams SBC, which interconnects Microsoft Teams with the Telnyx telephony platform. Telnyx SBC uses the base domain mstsbc.telnyx.tech, and Telnyx customers will be able to interconnect using a subdomain of mstsbc.telnyx.tech and a token for authentication.
In this activity you will:
You'll need a Telnyx account with a purchased number. Learn how to set up your account here.
Assign a Microsoft Teams E5 license to each user who will be making and receiving calls to the PSTN
Make sure you can sign in to the Microsoft 365 admin center as a Global Administrator.
To validate the role you have, please sign in to the Microsoft 365 admin center (https://portal.office.com) and go to Users → Active Users. Click your user and under Account → Roles click Manage roles. Verify that you have a Global Administrator role applied to your account.
Procure a Microsoft license. You can find different license options in the table below. You'll need one of these base plans and an add-on if necessary:
ADD ON REQUIRED FOR DIRECT ROUTING
Microsoft Business Basic / Standard / Premium
Microsoft 365 Business Voice without Calling Plan
Microsoft Office 365 Enterprise E1 / E3 / F3 / A1 / A3
Microsoft Office 365 Enterprise E5
No add on required
1. Add a SIP connection in Telnyx
Once you have set up your Telnyx account, you will have to set up a new connection for the Telnyx SBC on the SIP Connections Page.
Click on the green Add SIP Connection button and choose a name for your connection. You should see a pop-up window appear which will allow you to choose a SIP Connection Type. For this connection we must choose MS Teams SBC.
You will want to take note of the auto-generated subdomain that appears as it will be needed at different stages of the set up. Click Save & Finish Editing.
2. Assign a number to the Telnyx SBC Connection
You are now required to assign a Number to the MS Teams connection you just created.
If you have not done so already as part of your pre-requisite activities, you'll need to purchase a number from Telnyx.
Once you have a number, navigate to the Numbers page of your Telnyx Mission Control Portal and assign your MS Teams connection to the desired DID as shown below.
3. Add your SIP Connection to your Outbound Voice Profile
Now, you will assign the SIP Connection to the Outbound Voice Profile we created in the introduction of this guide.
Navigate to the SIP Connections tab in your sidebar.
Click the small pencil icon to the right of your SIP connection.
Click on the Outbound tab at the top of the pop up, and you should see an Outbound Voice Profile drop-down which will allow you to assign a profile to your connection.
Once selected, click Save All Changes.
Note: If you're using either the DOD, GCC or GOV MS Teams environment you will need to notify the Telnyx support team (email@example.com) so that we can make necessary adjustments on the Telnyx MS Teams SBC.
4. Add a subdomain to the customer tenant in Microsoft
Now that your Mission Control Portal is set up and ready to go, you’ll need to add a subdomain in the Microsoft admin portal before setting up Direct Routing in Microsoft Teams.
In order to do this, you'll need to make sure you have a Microsoft License and are signed into your Microsoft 365 Admin Center as a global administrator, as outlined in your pre-requisite activities. Once you have the correct licensure and account privileges, you can continue here.
Perform a search for Domains within the Microsoft 365 admin center search bar at the top of your screen.
Click the Add Domain option at the top left and add the auto generated subdomain that corresponds to the SIP Connection we created in Section 1.
Click Use This Domain and verify the domain on the following page. Select the Add a TXT record instead option.
Click Next and take note of the TXT value displayed.
Navigate back to your MS Teams SBC SIP Connection settings in your Telnyx Mission Control Portal.
Navigate to the Domain Validation header in the top right corner of the window and paste the TXT Value from MS Teams into the TXT Value text box.
Note: The TXT Name and TLL fields should match the fields shown in the MS 365 admin center, hence why they cannot be edited.
Click Save All Changes.
Once you have saved your changes, navigate back to Microsoft 365 admin center and click on the Verify button at the bottom.
On the next page, select More Options.
Select Skip and do this later and click Next.
After this you will be prompted that setup has been complete.
5. Activate the subdomain
After you have registered a domain name, you’ll need to activate it by adding at least one user and assigning the domain that matches the subdomain that was automatically generated when the SIP Connection was created in Section 1.
From Microsoft 365 Admin Center, navigate to Users → Active Users → Add a user.
Next, fill in the User details:
Domain: Select the Telnyx subdomain (i.e. yyyy.mstsbc.telnyx.tech)
Assign E5 license under "Product Licenses".
Note that you can remove the E5 license from this user once you're able to add this domain to Direct Routing.
6. Add the Telnyx SBC in Direct Routing
Next, we'll need to set up the Telnyx SBC subdomain in the Microsoft Teams admin center. To do this, you’ll have to have a Microsoft Teams E5 license assigned to each user who will be making and receiving calls to the PSTN. Keep in mind that the changes on the MS Teams admin portal may take up to 24 hours to take effect.
In the left tab of the Microsoft Teams admin center, navigate to Voice → Direct Routing.
Click the SBCs tab.
Click Add and enter the subdomain that was automatically generated in your SIP Connection from Section 4.
Provide the following information:
Upon successful settings changes, your connection should resemble the example below:
7. Create voice routes
Now you’ll need to create a pass-through voice route.
In the left-hand navigation of you 365 admin portal, navigate to Voice → Direct Routing.
When on the Directing Routing page, select the Voice routes tab.
Click Add, and enter a name and description for your voice route.
Set the priority and specify the dialed number pattern as per Telnyx's number plan.
For US numbers:
prepend:1; match pattern: NXXNXXXXXX
prepend: blank; match pattern: 1NXXNXXXXXX
For International numbers:
prepend: Country Dialing prefix; match pattern: NXXNXXXXXX
prepend: blank; match pattern: (Country Dialing prefix)NXXNXXXXXX
8. Enroll the SBC
In this section, we will enroll the SBC with the voice route.
From the Direct Routing page, navigate to SBCs enrolled.
Click Add SBCs.
Select the SBCs you want to enroll.
9. Add the PTSN usage records
In this section, you will add Public Switched Telephone Network (PSTN) usage records, which specify a class of call (such as internal, local, or long distance) that can be made by a user or group of users in an organization.
From your Microsoft 365 admin portal, use the left-hand navigation to navigate to Voice → Direct Routing and find the PSTN usage records section.
Click Add PSTN usage.
Select the PSTN records you want to add.
Note: This example includes “^(.*)$”, which allows you to dial any destination. We recommend using a different pattern if you want to include restrictions.
From the left-hand navigation, under Voice, click Voice Routing Policies.
In the PSTN usage records section, click Add PSTN usage.
10. Configure voice routing policies
From the left-hand navigation of the 365 admin portal, under Voice, click Voice Routing Policies.
Type TELNYX as the name and add a description.
11. Assign Dialplan and Voice routing policies
From the left-hand navigation of the 365 admin portal, click Users.
Click the Policies tab.
Select Edit and assign the following:
12. Assign Telnyx DID to on-premises PSTN connectivity
Finally, to provision a user with an on-premises phone number using powershell run the following cmdlet:
Set-CsPhoneNumberAssigment -Identity "<User name>" -PhoneNumber "<+E164 phone number>" -PhoneNumberType DirectRouting
To activate a user with enterprise voice using power shell, run the following cmdlet:
Ps> Set-CsUser -Identity "<User name>" -EnterpriseVoiceEnabled $true
13. Make some test calls with Microsoft Teams
Your setup for Microsoft Teams Direct Routing should now be complete. The last step is to make both inbound & outbound test calls from Microsoft Teams to verify the service has been set up correctly.
Call a PSTN number from the Microsoft Teams client. You'll want to confirm that the call connects through Telnyx and that there is two-way audio.
Call a Telnyx DID that is assigned to both your new Microsoft Teams SIP Connection and one of your Microsoft Teams users from the PSTN (i.e. a cell phone). Confirm that the call is received in Microsoft Teams and that two-way audio is functioning correctly.
Check the CDRs from the Reporting section of your Telnyx Mission Control Portal to validate that both calls went through correctly.
If you encounter any issues during these tests, please contact us at firstname.lastname@example.org with a note of the number dialled and the date/time. We'll do our best to help you resolve the issue.
This concludes your set up of Microsoft Teams Direct Routing with Telnyx.
Review our getting started with guide to make sure your Telnyx Mission Control Portal account is setup correctly!
Additionally, check out: