How to setup Microsoft Direct Routing with Sipharmony

How to setup Microsoft Direct Routing with Sipharmony

Setting up Microsoft Direct Routing with Sipharmony is not that bad. 
We're not going to lie to you though, it's no walk in the park either.

But with Sipharmony support, we can help you along the way and provide free support anywhere you might get stuck!


  1. Active Microsoft Teams
  2. Active users must have either an E3 with a Phone System License Addon or an E5 plan.
    1. E5 plan includes a phone system license.
  3. Admin access to your Microsoft Azure Domain
  4. Admin access to your Microsoft Teams Account
  5. The new custom domain name provided by Sipharmony

Getting Started

Once you have successfully signed up for Microsoft Direct Routing for Teams with Sipharmony, we will provide you with a domain name. You will need to register this custom domain via your Azure Active Directory Portal.
The following steps are a summary of documentation from Microsoft: found here

Add new Domain to Azure AD

With the domain name provided by Sipharmony, you can now add this to your Azure AD Directory.
  1. Sign into the Azure Portal as a Global administrator account for the directory you are using.

  2. Search for and select “Azure Active Directory” from any page. Then select Custom Domain Names -> Add Custom Domain

  1. In Custom domain name, add the new domain name provided by your Sipharmony onboarding agent.

  1. After you have entered the now unverified domain, you will need to save the information to create a TXT record. This is needed so the Subdomain can be properly configured Sipharmony.

    1. The information you will need to pass back to Sipharmony will look like this:

Please copy the MS=ms######## and give that to your Sipharmony onboarding representative!

Once we update your teams trunk with the new TXT record, you can check on the status, by finding the new custom domain name in the list of your domains:

You will see a “Verify Domain” section where you will click the “Verify” button.
FYI: This may take up to 24 hours to complete propagation on Microsoft's side!

Assigning a User to a New Domain

This user will need an E3 with a Phone System license add-on or an E5 (which includes the phone system license) or the equivalent in your plan. If you're not sure if the add-on is needed, you can find out more information about your plan here:  

  1. You can create a new user by going to the “Azure Active Directory” menu item and then Users.

    1. Then find “+ New User

  2. Select “Create User” and fill out the rest of the form, ensuring that the domain selected is the one that you have just verified. (

  3. Once this new user is created, you will be able to find the user in the list of users for your account under the Users menu option on the menu. 

  4. You will want to now click on the new user that was created for your new domain to view that new user.

  5. Next, click on “Licenses” which is located under the “Manage” section of the User menu.

  6. We will now want to apply the license to this user so voice calls can start. 

    1. To do this

      1. Click on “+ Assignments” and search for “Microsoft 365 Phone System"

      2. Apply the license to the User

        1. If an E5 user then the license is included but it will be an add-on if not an E5 user.

        2. This may take some time to propagate.

Changes to your Microsoft Azure can take some time to propagate. Please allow up to 24 hours. This is not a limitation of Sipharmony, but how Microsoft Azure works.

Configure Voice Policy

To configure Microsoft Teams’ Voice Routing is done by running the following script in Powershell as an administrator filling out the “$tenant_domain” with the domain name chosen when setting up the Microsoft Teams Trunk which should match the domain name that was verified and now has a single user with a Phone system license on it:

$tenant_domain = ""
$Route = "Route_SANSAY1"
$PSTNUsage = "Usage_SANSAY1"
$VoicePolicy = "VP_SANSAY1"
$NumPattern = ".*"
#Create PSTN Usage
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add=$PSTNUsage}
#Create Voice Route
New-CsOnlineVoiceRoute -Identity $Route -NumberPattern $NumPattern -OnlinePstnGatewayList $tenant_domain -Priority 0 -OnlinePstnUsages $PSTNusage
#Create Voice Policy
New-CsOnlineVoiceRoutingPolicy $VoicePolicy
Set-CsOnlineVoiceRoutingPolicy $VoicePolicy -OnlinePstnUsages $PSTNusage

Configure Users with Voice Policy

 For a user to be able to make/receive phone calls with MS Teams, they must have an E5 account or Phone System License add-on. Skip to step 5 if they already have these

  1.  Log into the Azure Active Directory admin console

  2. Select the “Users” option in the left menu

  3. Click on the user you are configuring, then click on “Licenses” under the “Manage” section of the submenu

  4. Click +Assignments and search for Microsoft 365 Phone System and add it to the customer (This will be included for E5 accounts and does cost additional for E3 accounts)

  5.  In PowerShell, run the following script to add voice service and a DID to the customer:

$USER = "user@domain.tld"
$DID = "+1234567890"
$VoicePolicy = "VP_SANSAY1"
Set-CsUser -Identity $USER -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI tel:$DID
Grant-CsOnlineVoiceRoutingPolicy -Identity $USER -PolicyName $VoicePolicy

It can take some time after adding voice policies, but the user should be able to browse to “Calls” in Microsoft Teams and have a Dial pad along with a message saying “Your Number: +1 (234) 567-8901”


Once all the above steps are successfully completed, your Microsoft Teams will be have VoIP capabilities! 

If you run into any problems at all, just reach out to us and we will be than happy to assist you.
    • Related Articles

    • Microsoft Teams Direct Routing with Sipharmony

      As companies look to revamp their digital technologies to support globally distributed workforces, they’re increasingly choosing unified communications platforms like Microsoft Teams. Many organizations are even choosing Microsoft Teams for business ...
    • How to log into sipharmony

      This guide is for business only accounts. For residential, go here. Logging into sipharmony is easy! We partnered with Vodia for our apps. Vodia is the leading software for softphone apps and have a strong reputation with app reliability, ...
    • Auto Attendant (IVR) Features

      Auto Attendants can be fun! There are restrictions to how many IVRs you can ask us to create. We've made them 6 layers before! Behavior IVR Behavior Features: Extension Input When extension matches After 1 digit input After 2 digit input After 3 ...
    • IVR Nodes

      If you are interested in creating a IVR Node for your phone system, reach out to us at An IVR node can be configured for complex tasks so that callers can for example enter account numbers and pay bills through an external ...
    • Call Queue Features

      Behavior Primary Agents List of agents that are assigned to the call queue. Extensions That Cad Add themselves Extensions can dial a star code that will add or remove them from a call queue Behavior Features Number of logged in agents required to ...