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!
Prerequisites
- Active Microsoft Teams
- Active users must have either an E3 with a Phone System License Addon or an E5 plan.
- E5 plan includes a phone system license.
- Admin access to your Microsoft Azure Domain
- Admin access to your Microsoft Teams Account
- 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.
Sign into the Azure Portal as a Global administrator account for the directory you are using.
Search for and select “Azure Active Directory” from any page. Then select Custom Domain Names -> Add Custom Domain
In Custom domain name, add the new domain name provided by your Sipharmony onboarding agent.
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.
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:
You can create a new user by going to the “Azure Active Directory” menu item and then Users.
Then find “+ New User”
Select “Create User” and fill out the rest of the form, ensuring that the domain selected is the one that you have just verified. (XXXXX.teams.sangoma.com)
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.
You will want to now click on the new user that was created for your new domain to view that new user.
Next, click on “Licenses” which is located under the “Manage” section of the User menu.
We will now want to apply the license to this user so voice calls can start.
To do this
Click on “+ Assignments” and search for “Microsoft 365 Phone System"
Apply the license to the User
If an E5 user then the license is included but it will be an add-on if not an E5 user.
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.
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:
#CREATE TRUNKS AND VOICE POLICY #Variables $tenant_domain = "XXXXX.teams.sangoma.com" $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 |
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
Log into the Azure Active Directory admin console
Select the “Users” option in the left menu
Click on the user you are configuring, then click on “Licenses” under the “Manage” section of the submenu
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)
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”
Conclusion
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.