DIDfarm
  • Numbers
  • Trunks
  • Messaging
  • Connect
  • Pricing
  • Coverage
  • Help
🇬🇧 EN 🇳🇱 NL 🇩🇪 DE 🇫🇷 FR 🇪🇸 ES 🇧🇷 PT 🇸🇦 AR 🇨🇳 ZH 🇯🇵 JA 🇮🇳 HI
Sign in Get a Number
← Help Center
On this page
Overview How Direct Routing Works Prerequisites Step-by-step Setup Cost Comparison Best Practices FAQ

Microsoft Teams Direct Routing

SIP Trunking · 10 min read Teams Direct Routing SIP
Get PSTN calling in Microsoft Teams without Microsoft Calling Plans. Use your own DIDfarm numbers with Direct Routing to keep full control over costs, number selection, and porting — across 70+ countries.

Overview

Microsoft Teams Direct Routing lets you connect a certified Session Border Controller (SBC) to Teams Phone, routing calls over your own SIP trunk instead of buying Microsoft Calling Plans. DIDfarm provides the numbers, the SIP trunk, and the PSTN connectivity — you bring the SBC and the Teams tenant.

This approach gives you access to local numbers in 70+ countries at wholesale rates, the freedom to keep numbers when switching platforms, and full control over call routing and failover.

How Direct Routing Works

The call flow is straightforward. When someone dials one of your DIDfarm numbers, the call arrives at the DIDfarm SIP infrastructure, which forwards it to your SBC. The SBC translates the SIP session into a Teams-compatible media stream and delivers it to the assigned Teams user.

Outbound calls follow the reverse path: a Teams user dials a PSTN number, the SBC routes the call to DIDfarm over SIP, and DIDfarm connects it to the public telephone network.

Call Flow
Inbound:  PSTN → DIDfarm SIP → Your SBC → Microsoft Teams
Outbound: Microsoft Teams → Your SBC → DIDfarm SIP → PSTN
Note: Direct Routing requires a Teams Phone license (formerly Phone System). The standard Microsoft 365 Business or Enterprise license does not include voice capabilities on its own.

Prerequisites

Before you begin, make sure you have the following in place:

  • DIDfarm account with at least one active SIP trunk and numbers assigned
  • Microsoft 365 tenant with Teams Phone (Phone System) licenses for each voice user
  • Certified SBC — hardware (AudioCodes, Ribbon) or virtual (Oracle, Anynode). See Microsoft's SBC list
  • Public IP and TLS certificate for your SBC (Microsoft requires TLS 1.2 with a trusted CA certificate)
  • DNS record pointing your SBC FQDN to its public IP
  • Teams admin access (Global Admin or Teams Administrator role)

Step-by-step Setup

1 Create a SIP Trunk in DIDfarm

Log in to your DIDfarm portal and navigate to My Numbers → SIP Trunks. Create a new trunk with digest authentication. Note the SIP server address, username, and password — you will need these for your SBC configuration.

Assign the numbers you want to use in Teams to this trunk under DID Routing.

DIDfarm SIP Credentials
SIP Server:   sip.didfarm.com
Port:         5060 (UDP/TCP) or 5061 (TLS)
Auth ID:      your-trunk-username
Password:     (shown once at creation)
Codec:        G.711 (PCMU/PCMA), G.729

2 Configure Your SBC

On the SBC, create two SIP trunk connections:

  1. Teams-facing trunk — connects to Microsoft Teams SIP proxies (sip.pstnhub.microsoft.com on port 5061 TLS). Configure TLS with your public certificate.
  2. DIDfarm-facing trunk — connects to sip.didfarm.com using the credentials from step 1. Register if using digest auth.

Set up routing rules so inbound calls from DIDfarm are forwarded to Teams, and outbound calls from Teams are forwarded to DIDfarm.

Important: Microsoft requires TLS 1.2 on the Teams-facing side. Make sure your SBC certificate is signed by a trusted CA (not self-signed) and the SBC FQDN matches the certificate CN or SAN.

3 Add the SBC in Teams Admin Center

In the Teams Admin Center, go to Voice → Direct Routing and add your SBC:

Teams PowerShell
New-CsOnlinePSTNGateway -Fqdn sbc.yourcompany.com `
  -SipSignalingPort 5061 `
  -MaxConcurrentSessions 10 `
  -Enabled $true

# Create a voice routing policy
New-CsOnlineVoiceRoutingPolicy -Identity "DIDfarm-Policy" `
  -OnlinePstnUsages "DIDfarm-Usage"

# Create a PSTN usage and route
Set-CsOnlinePstnUsage -Usage "DIDfarm-Usage"
New-CsOnlineVoiceRoute -Identity "DIDfarm-Route" `
  -NumberPattern ".*" `
  -OnlinePstnGatewayList sbc.yourcompany.com `
  -OnlinePstnUsages "DIDfarm-Usage"

4 Assign Numbers to Teams Users

Assign phone numbers to individual Teams users using PowerShell. The number must be in E.164 format (e.g. +31201234567).

Teams PowerShell
# Assign number and routing policy to a user
Set-CsPhoneNumberAssignment -Identity user@yourcompany.com `
  -PhoneNumber "+31201234567" `
  -PhoneNumberType DirectRouting

Grant-CsOnlineVoiceRoutingPolicy -Identity user@yourcompany.com `
  -PolicyName "DIDfarm-Policy"

5 Test Calls

Once configuration is complete, test both directions:

  1. Inbound: Call your DIDfarm number from a mobile phone. The assigned Teams user should ring.
  2. Outbound: From the Teams client, dial an external number. Verify the caller ID shows your DIDfarm number.
Tip: Use the Teams call quality dashboard (CQD) and your SBC logs to troubleshoot any audio or routing issues. Common problems include codec mismatches, TLS certificate errors, and incorrect number format.

Cost Comparison vs. Calling Plans

Microsoft Calling Plans bundle numbers and minutes into a per-user monthly fee. Direct Routing with DIDfarm separates the infrastructure cost from the calling cost, which is often significantly cheaper — especially for international or multi-country deployments.

Feature Microsoft Calling Plans DIDfarm Direct Routing
Number availability Limited countries 70+ countries
Number porting Locked to Microsoft Keep your numbers anywhere
Per-user cost From ~$8/user/month + minutes From ~$1/number/month + usage
Multi-country Separate plan per country One account, all countries
SBC required No Yes (hardware or virtual)
Call routing control Basic Full (failover, LCR, time-based)

Best Practices

  • Use TLS on both sides — encrypt the Teams-facing trunk (required) and the DIDfarm-facing trunk (recommended) for end-to-end SIP security.
  • Set concurrent call limits — match the MaxConcurrentSessions on your SBC gateway to your DIDfarm trunk channel count to avoid oversubscription.
  • Monitor with CQD — the Teams Call Quality Dashboard shows MOS scores, jitter, and packet loss. Correlate with DIDfarm CDR data for full visibility.
  • Use E.164 everywhere — normalize all numbers to E.164 format on the SBC to avoid routing mismatches between Teams and DIDfarm.
  • Plan for failover — configure a secondary SBC or a fallback route in your voice routing policy so calls land even during maintenance.
  • Keep firmware current — SBC vendors release patches for Teams interop issues regularly. Stay on a Microsoft-certified firmware version.

Frequently Asked Questions

Do I need a Microsoft Calling Plan if I use Direct Routing?

No. Direct Routing replaces the Calling Plan. You still need a Teams Phone (Phone System) license per voice-enabled user, but you do not need a Calling Plan when using your own SIP trunk.

Which SBCs work with DIDfarm?

Any SBC that is certified for Microsoft Teams Direct Routing will work. Popular choices include AudioCodes Mediant series, Ribbon SBC Edge/Core, Oracle Enterprise SBC, and Anynode (software SBC). Virtual SBCs running in Azure or AWS are also supported.

Can I use existing DIDfarm numbers with Teams?

Yes. Assign your existing DIDfarm numbers to a SIP trunk, configure the SBC, and assign the numbers to Teams users. No porting is required.

What codecs does DIDfarm support?

DIDfarm supports G.711 (PCMU and PCMA) and G.729. Teams typically uses SILK or G.722, so the SBC handles transcoding between the two endpoints.

Can I mix Direct Routing users and Calling Plan users?

Yes. Teams supports both in the same tenant. Assign a voice routing policy only to users who should use Direct Routing. Users without the policy will fall through to their Calling Plan if one is assigned.

Ready to connect Teams?

Create a SIP trunk and assign your numbers in minutes.

Go to SIP Trunks →
© 2026 DIDfarm · didfarm.com
About Blog Partners Coverage API Docs Status Privacy Terms Cookies Help

We use essential cookies to make DIDfarm work. With your consent, we also use analytics cookies to improve our service. Cookie Policy