Skip to content

Configuring Teams Direct Routing

Enfonica enables you to connect Microsoft Teams to the public phone network, allowing you to make and receive phone calls directly in Teams. To support this, Enfonica integrates with Teams Direct Routing.

To configure Teams Direct Routing, you need to be a Global Administrator in Microsoft 365.

Check Microsoft 365 licensing

To use phone capabilities within Teams, each user needs to be have a license that includes Teams, as well as the Teams Phone Standard license. For more information on licensing, please see the Microsoft documentation.

Microsoft Teams add-on licenses

This documentation makes use of the free Microsoft Teams Phone Resource Account license. You can purchase these licenses (for free) in the Microsoft 365 admin center marketplace.

Create a SIP domain

An Enfonica SIP domain serves as the connection point between Enfonica and Teams Direct Routing. To create a SIP domain:

  1. Open the Enfonica Console.
  2. Navigate to Cloud SIP.
  3. Create a new SIP domain. Ensure you select Teams Direct Routing.

You will be redirected to a page to configure your SIP domain. This page will show you the FQDN (Fully Qualified Domain Name) of your SIP domain, which will be in the format <name> Note down your FQDN as it will be used in future steps.

Channel limits

The SIP domain will be provisioned a channel limit of 1 by default. The channel limit determines the maximum simultaneous calls that you can make and receive, and you are billed based on your channel limit. You should increase the channel limit if you require more simultaneous calls.

Provision phone numbers

To support calling in Teams, you need to provision one or more phone numbers for your users to use for making and receiving calls. You should plan how many phone numbers you need for your users and for main business lines.

To provision phones numbers:

  1. Open the Enfonica Console.
  2. Navigate to Phone Numbers.
  3. If you have not configured a regulatory listing with Enfonica, select the Regulatory listings section, click Create and complete the steps. This information is required for compliance purposes when provisioning phone numbers.
  4. Select the New number section, search for a phone number and click on a number to purchase it.
  5. In the phone number settings, under Incoming call handlers, click Add handler, then click Send over SIP. Select Load balancer then select the load balancer associated with your FQDN. The load balancer will be called teams@<Your FQDN>. Click Confirm and then click Save.
  6. Repeat steps 4 and 5 if you require additional phone numbers.

Verify the SIP domain in Microsoft 365

To use an Enfonica SIP domain with Teams Direct Routing, you need to verify it in your Microsoft 365 tenant. To verify the SIP domain:

  1. Open the Microsoft 365 admin center.
  2. Under Settings, click Domains, then click Add domain.
  3. Enter your FQDN as the domain name and proceed to the next step.
  4. Select the verification option Add a TXT record and proceed to the next step.
  5. Copy the value of TXT value to your clipboard. The TXT value should start with MS=.
  6. In the Enfonica Console, navigate to the SIP domain you created earlier. In the Teams Direct Routing section, click Verify, then paste the TXT value into the box to verify your SIP domain.
  7. Go back to the verification page in the Microsoft 365 admin center, and click Verify. The verification should succeed. If it doesn't, wait a few minutes and try again.
  8. You will be asked how you want to connect your domain. Click more options, select Skip and do this later, then click Continue.

When you complete these steps, your SIP domain will be verified with Microsoft 365.

Microsoft 365 propagation delays

It can sometimes take Microsoft 365 several minutes, hours or in rare cases days to recognize changes you make to domains. As such, in future steps, you may experience errors when attempting to configure users or routes with your FQDN. If you have any issues with Microsoft 365 not recognizing your FQDN, we recommend that you wait and try again later.

Create a user with the FQDN in Microsoft 365

For Teams to recognize your FQDN, you must create a user in Microsoft 365 with a primary email address on your FQDN, such as user@<Your FQDN>. To activate the FQDN with Teams, you must then assign this user the free Microsoft Teams Phone Resource Account license.

This is only required during initial setup. When you complete the setup of Teams Direct Routing, you can remove this user.

Connect PowerShell with Teams

To perform the initial provisioning in Teams, you must use PowerShell. If you have not installed the Microsoft Teams PowerShell module previously, complete the installation following the Microsoft documentation.

Install Microsoft Teams PowerShell Module

Open a PowerShell window and sign in to Teams using the following command.


Perform one-time configuration

Dial plan

Create the dial plan for Australia. This includes rules for mapping local and international phone numbers.

The following script will create a dial plan named Enfonica-AU which will be assigned to users making calls from Australia.

$nr1 = New-CsVoiceNormalizationRule -Parent Global -Description "Calls to Australian fixed-line and mobile" -Pattern '^0(\d{9})$' -Translation '+61$1' -Name "Enfonica-AU 0NSN" -IsInternalExtension $false -InMemory
$nr2 = New-CsVoiceNormalizationRule -Parent Global -Description "Calls to Australian 1300/1800 " -Pattern '^(1300|1800)(\d{6})\d*$' -Translation '+61$1$2' -Name "Enfonica-AU Inbound" -IsInternalExtension $false -InMemory
$nr3 = New-CsVoiceNormalizationRule -Parent Global -Description "Calls to Australian 13" -Pattern '^13([1-9]\d{3})\d*$' -Translation '+6113$1' -Name "Enfonica-AU 13 Inbound" -IsInternalExtension $false -InMemory
$nr4 = New-CsVoiceNormalizationRule -Parent Global -Description "Calls to emergency services" -Pattern '^000$' -Translation '+61000' -Name "Enfonica-AU 000" -IsInternalExtension $false -InMemory
$nr5 = New-CsVoiceNormalizationRule -Parent Global -Description "Calls to international destinations with 0011 prefix" -Pattern '^0011(\d+)$' -Translation '+$1' -Name "Enfonica International 0011" -IsInternalExtension $false -InMemory
$nr6 = New-CsVoiceNormalizationRule -Parent Global -Description "Calls to international destinations" -Pattern '^(\d+)$' -Translation '+$1' -Name "Enfonica International" -IsInternalExtension $false -InMemory

New-CsTenantDialPlan -Identity Enfonica-AU -NormalizationRules @{add=$nr1,$nr2,$nr3,$nr4,$nr5,$nr6}

Voice policy

Create the PSTN usage record and voice policy. Users assigned this voice policy will be able to make calls using Enfonica.

The following script will create a voice policy and PSTN usage record both called Enfonica-AU.

Set-CsOnlinePstnUsage -Identity "Global" -Usage @{Add="Enfonica-AU"}
New-CsOnlineVoiceRoutingPolicy "Enfonica-AU" -OnlinePstnUsages "Enfonica-AU" -Description "Enfonica Australia"

Voice route

Create the voice route to create the Teams Direct Routing connection between Teams and Enfonica.

# Update <Your FQDN> to your FQDN in the format <name>
$fqdn = "<Your FQDN>"

New-CsOnlineVoiceRoute -Identity "Enfonica-AU" -OnlinePstnGatewayList $fqdn -NumberPattern ".*" -OnlinePstnUsages "Enfonica-AU"

Configure users

Configure your users to assign a phone number, the voice route and the voice policy.

For each user, run the following script.

# Update the email address and phone number as required
$user = ""
$phone = "+61255501234"

If ((Get-CsOnlineUser $user).TeamsUpgradeEffectiveMode -ne "TeamsOnly") {
  Grant-CsTeamsUpgradePolicy -Identity $user -PolicyName UpgradeToTeams

Set-CsPhoneNumberAssignment -Identity $user -PhoneNumber $phone -PhoneNumberType DirectRouting
Grant-CsOnlineVoiceRoutingPolicy -Identity $user -PolicyName "Enfonica-AU"
Grant-CsTenantDialPlan -Identity $user -PolicyName "Enfonica-AU"

It may take some time for changes to become effective.

Test calling in Teams

When you complete configuring Teams Direct Routing, you should test calling in Teams to ensure the configuration is working as expected.

Test outgoing calls

Open the Teams desktop application and open the Calls section. You should see a dial pad where you can place a call. Use this to place a test call.

If you do not see the dial pad, you may need to wait for Microsoft 365 to update internally. You may also need to restart the Teams desktop application. If you are having trouble getting the dial pad to appear, you can use the troubleshooter provided by Microsoft.

Microsoft Remote Connectivity Analyzer - Teams PSTN Calling Dial Pad

Test incoming calls

With the Teams desktop application open, place a call to the phone number you provisioned for your user. You should receive a call in Teams.