Configuring Microsoft Teams Direct Routing

Configuring Teams Direct Routing

Intro

Microsoft Team's Direct Routing feature allows you to make and receive phone calls using a normal SIP trunk, provided that you use a Microsoft certified SBC (Session Border Controller) between the two.
Our Microsoft Certified SBC sits between a normal GoVoIP SIP trunk and Microsoft Team's cloud servers.

Overview of how the systems are connected and callflow.

For those familiar with the 3CX SBC, this Session Border Controller is a completely different thing.
To get a quote or kick off the sign up process, please contact sales@ufone.co.nz
If you are stuck during the setup process, contact support@ufone.co.nz

Requirements

All users that you wish to make/receive phone calls need to have an either an Office 365 E1/E3 License + Microsoft Teams Phone Standard License or an Office 365 E5 license.
You can begin the setup without licensing all users, but they must be licensed before go-live. At least 1 licensed temp user is to complete the setup.
Full admin access to the Microsoft 365 tenant
Windows Powershell

Stage 1: Add Domain

First, we need to add the new domain through the Microsoft 365 Admin Center
UFONE will supply you the domain to add through the order ticket, for example ucall.sbc1.ufone.co.nz
  1. Under Settings -> Domains click Add Domain
  2. For domain verification select more options and then Add a TXT record to the domain's DNS records
  3. In the order ticket, provide us the information that is generated on the next page for us to add to our DNS records.
  4. Once we have confirmed that we have added the TXT record on our end, wait a few minutes and only then click Verify.
  5. On the next page, select I'll add the DNS records myself and select Next.
  6. On the Choose your online services page, clear all options and select Next.
  7. Select Finish on the Update DNS settings page.
Your Domains screen should look something like this once complete.

Stage 2: Activate Domain

Before the domain can be used, it first needs to be activated by creating a temp user that is licensed with either E1/E3 + Microsoft Teams Phone Standard or an E5 license.
This user needs to have the new domain selected as their primary domain in order to activate it. (Alias will not work)
The license can either be new or you can "borrow" the license from another user and return the license once the whole setup process is complete.




Once the user has been added and licensed, you will need to wait up to 24 hours for the activation to complete on the Microsoft side. Hopefully much quicker than that.
There's no way to check whether it's complete (that I'm aware of) other than to attempt Stage 3.
The temp user can be deleted once all stages are complete.

Stage 3: Configuring Direct Routing

The next steps currently require powershell usage, there is no way to do this from the Teams Admin Center.
First, install the MicrosoftTeams module for powershell, giving you access to the commands we'll need.
  1. Install-Module -Name MicrosoftTeams -Force -AllowClobber
Import the MicrosoftTeams module and check that it's loaded correctly
  1. Import-Module MicrosoftTeams
  2. Get-Module -Name MicrosoftTeams


Sign into your MicrosoftTeams instance using your administrative user, authentication will complete through your browser.
  1. Connect-MicrosoftTeams


Create PSTN Usage
  1. Set-CsOnlinePSTNUsage -Identity Global -Usage @{add="UFONE"}
Create the Voice Route, remember to replace the domain at the end with the one you created earlier.
  1. New-CsOnlineVoiceRoute -Identity UFONE -NumberPattern ".*" -OnlinePstnUsages UFONE -OnlinePstnGatewayList yourtenanthere.sbc1.ufone.co.nz
If the above fails because it cannot find the PSTN gateway, check that you have entered it correctly. You may also just need to wait for the activation from Stage 2 to complete.


Next, we assign the "UFONE" PSTN Usage to the "Global (Org-wide default)" Voice Routing Policy from the Microsoft Teams Admin Center
Or you can add the PSTN Usage to a different Voice Routing Policy 



You can also view your configured Voice Route under Direct Routing -> Voice Routes.
Note that you do not need anything on the SBCs tab. Total SBCs will be 0, this is normal. This configuration is managed on our end.




Stage 4: Configuring Users

In order to assign a phone number and make/receive phone calls, the user need to be licensed with either E1/E3 + Microsoft Teams Phone Standard or an E5 license.
Under Users -> Manager Users click on the name of the user.
You can then assign a phone number and extension number by editing General Information.
Enter the phone number in full E164 format with leading +, for example +6435996067
If you need additional numbers, contact us to have new phone numbers assigned to your account




The user should now have a dial pad available in their Teams app.
If the dial pad is not showing, you may need to fully exit the Teams app through the taskbar notification area to force it to reconfigure. You can also try the web based version which may update more speedily. If still no luck, you may just have to wait for Microsoft to update their side.



Stage 5: (Optional) Create Auto Attendants and Call Queues

To receive calls other than direct dials, you'll need an auto attendant or call queue.
First create a resource account through Voice -> Resource Accounts
Then purchase (it should be free) Microsoft Teams Phone Resource Account licenses from Microsoft 365 Admin Center
Assign the licenses to the resource accounts like you would a normal user.
To assign a phone number to the resource account, run the following powershell command. Remember to replace with your own Identity (username/email) and Phone Number here.
  1. Set-CsPhoneNumberAssignment -Identity autoattendant@ucall.co.nz -PhoneNumber +6435996068 -PhoneNumberType DirectRouting
Once you have run the command for these Resource Accounts, you may need to wait a while for the Phone Number to show up in the Teams Admin Center


The appropriate resource account can then be selected when adding auto attendants or call queues, just make sure you have the correct resource account type for each.



Stage 6: Go Live

As part of your configuration, staff at UFONE will configure a callflow and Teams SBC SIP device on our GoVoIP platform, calls sent to this SIP device will pass calls onto your Teams system.
If you have a GoVoIP login, you can buy new numbers, reassign spare numbers from other callflows/devices or have your numbers ported in and then assign them to the Teams SBC callflow. It works exactly the same way as a normal SIP trunk from this perspective.
If you don't have a GoVoIP login, just ask us to assign the numbers you want to be sent to Teams and we'll make sure they're ready for your go live date.
Phone numbers need to be configured on both GoVoIP and on the Teams end. The SBC does not require configuration for new numbers.
Users should be able test outbound calls before the phone numbers are moved across to Teams, you just won't be able to receive inbound calls from the outside world yet. If you need to test ahead of time, you can purchase new numbers from us to test with.
Example of what a callflow on GoVoIP might look like.