Why Direct Routing Instead of Microsoft Calling Plans?

Microsoft offers two ways to enable PSTN calling in Teams: their own Calling Plans (bundled minutes per user per month) and Direct Routing (bring your own carrier). Direct Routing is almost always cheaper for international businesses because:

  • No bundled minute markup — Microsoft charges a fixed monthly fee per user regardless of usage
  • International rates — Direct Routing lets you use a carrier like DIDfarm with true per-minute pricing per country
  • Number portability — you keep control of your DID numbers and can move them between providers
  • Country coverage — Microsoft Calling Plans are not available in every country; Direct Routing works anywhere Teams runs

With Direct Routing + DIDfarm, a typical 50-user deployment saves 40-60% versus Calling Plans. See our cost comparison article for detailed numbers.

What You Will Need

  1. A Microsoft 365 tenant with Teams Phone licenses assigned to each user you want to enable
  2. A Session Border Controller (SBC) certified for Teams Direct Routing — options include AudioCodes Mediant, Ribbon SBC SWe Lite, or Oracle Acme Packet
  3. A public FQDN and valid TLS certificate for your SBC (e.g. sbc.yourcompany.com)
  4. A DIDfarm account with a SIP trunk and at least one DID number — sign up for free
  5. Global administrator rights on the Microsoft 365 tenant

Step 1: Provision Your SBC

Install or deploy your SBC on a public-facing server. Most cloud SBCs (AudioCodes on Azure Marketplace, Ribbon on AWS) can be deployed in 15 minutes. Make sure:

  • It has a public IP
  • A valid TLS certificate is installed (Let's Encrypt works fine)
  • TCP 5061 (SIP TLS) and UDP 49152-65535 (RTP) are open inbound

Step 2: Create a DIDfarm SIP Trunk

In your DIDfarm portal, open the SIP Trunks tab and click Create Trunk. Name it teams-direct-routing and save the generated credentials. You will use them in the next step.

Assign your Teams DID numbers to this trunk in the My Numbers tab. For bulk assignment, use the API endpoint described in the API docs.

Step 3: Configure the SBC

Point your SBC at DIDfarm:

  • SIP Server / Registrar: sip.didfarm.com
  • Port: 5060 (UDP) or 5061 (TLS)
  • Username / Password: from your DIDfarm trunk
  • Codecs: enable G.711 ulaw/alaw and G.729

On the Microsoft-facing side, configure the SBC to listen on TCP 5061 with your public FQDN. The exact steps vary by SBC vendor — AudioCodes and Ribbon both have step-by-step guides.

Step 4: Connect the SBC to Microsoft Teams

Open PowerShell and connect to your tenant:

Connect-MicrosoftTeams
New-CsOnlinePSTNGateway `
  -Fqdn sbc.yourcompany.com `
  -SipSignalingPort 5061 `
  -MaxConcurrentSessions 100 `
  -Enabled $true

This tells Teams to route calls through your SBC. Next, create a PSTN usage and a voice route:

Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="International"}
New-CsOnlineVoiceRoute -Identity "DIDfarm" `
  -NumberPattern ".*" `
  -OnlinePstnGatewayList sbc.yourcompany.com `
  -OnlinePstnUsages "International"

Step 5: Assign Numbers to Users

Still in PowerShell, assign a DID to a user:

Set-CsPhoneNumberAssignment `
  -Identity user@yourcompany.com `
  -PhoneNumber +31201234567 `
  -PhoneNumberType DirectRouting

Replace the phone number with a DID you own on DIDfarm. The user can now make and receive PSTN calls from Teams immediately.

Step 6: Test a Call

Have the user make a test call to their mobile phone. You should hear a clean audio path. If not, check:

  • SBC logs for any SIP errors
  • TLS certificate is valid and the FQDN matches
  • DIDfarm trunk is registered (shown in portal)
  • User has a Teams Phone license assigned

Common Issues

  • Call drops after 10 seconds: RTP traffic is blocked — open UDP 49152-65535 on your firewall to/from Microsoft's media IPs.
  • Outbound calls get 403 Forbidden: The DIDfarm P-Asserted-Identity header is missing or incorrect. Configure your SBC to add P-Asserted-Identity: <sip:+31201234567@sip.didfarm.com> on outbound calls.
  • Inbound calls go to voicemail immediately: The DID is not assigned to the Teams user, or EnterpriseVoiceEnabled is set to false.

Next Steps