Architecture

Microsoft Teams Direct Routing

Direct Routing is Microsoft's BYOC mechanism for Teams Phone — it lets you bring your own SIP carrier instead of buying Microsoft's bundled Calling Plans. You connect Teams to your carrier through a certified Session Border Controller (SBC) that speaks SIP-TLS to Microsoft on one side and to your carrier on the other. In practice, the SBC is the single most-finicky piece of any Teams deployment.

Why Direct Routing exists

Microsoft sells two ways to put PSTN on Teams:

For anyone outside Microsoft's Calling Plan footprint, anyone with existing carrier contracts, or anyone who wants real STIR/SHAKEN attestation control, Direct Routing is the only option.

The architecture

End-to-end, an inbound call to a Teams Phone user looks like:

Caller (PSTN) → Carrier (DIDHub) → SBC → Microsoft Teams (sip.pstnhub.microsoft.com)
                                       ↑
                                       SIP-TLS only, port 5061, mTLS
                                       Strict SIP header validation
                                       FQDN must match SBC certificate

SBC-as-a-Service vs on-prem SBC

On-prem SBC (Ribbon, AudioCodes, Oracle)SBC-as-a-Service (DIDHub managed)
CapEx$5K-$50K hardware$0
Setup time2-6 weeks (procurement + cert + tuning)~5 minutes
Public IP / FQDNYou buy IP, you manage DNSWe assign <your-name>.teams.didhub.io
TLS certYou buy + renew yearlyWe auto-renew (Let's Encrypt + carrier-grade)
Microsoft cert validationYour problemWe test against MS hubs daily
SIP header tuningYou diagnose 488sPre-tuned, regression-tested
CapacityBox-limited (~250-1000 concurrent)Elastic, per-tenant
Multi-regionBuy a box per region3 PoPs out of the box

SBC-as-a-Service is overwhelmingly the right choice unless you have specific compliance needs (data residency in your own DC, PCI scope reduction, etc.) that force on-prem.

Why your SBC needs a unique customer FQDN

Microsoft requires a unique fully-qualified domain name per tenant per SBC. The FQDN must:

This is why DIDHub assigns each customer their own subdomain like acme-corp.teams.didhub.io rather than a shared sbc.didhub.io. With a shared FQDN you couldn't onboard more than one tenant. Customers who own a domain can also bring their own (e.g. sbc.acme-corp.com) and we will issue the cert — but the default per-tenant subdomain is faster and works just as well.

# In Microsoft Teams admin PowerShell
New-CsOnlinePSTNGateway -Fqdn "acme-corp.teams.didhub.io" \
  -SipSignalingPort 5061 \
  -Enabled $true \
  -MediaBypass $false \
  -ForwardCallHistory $true \
  -ForwardPai $true

Microsoft Teams hubs (regional ingress)

Microsoft does not expose a single SIP destination. Direct Routing traffic is anycast to three regional hubs — whichever responds fastest. Your SBC must accept SIP-TLS from all three:

HubFQDNRegion served
Primary (NOAM)sip.pstnhub.microsoft.comGlobal anycast (resolves to nearest)
Secondarysip2.pstnhub.microsoft.comEMEA
Tertiarysip3.pstnhub.microsoft.comAPAC

The three FQDNs share a small set of public IP ranges (52.x and 13.x). Microsoft publishes the IP/port reference; firewall rules must allow all three on TCP/5061. Do not pin your SBC to a single hub — calls will fail when Microsoft fails over.

SIP OPTIONS probing (the 'is-the-SBC-alive' check)

Microsoft sends SIP OPTIONS to your SBC every ~60 seconds from each of the three hubs. If your SBC fails to respond with 200 OK for ~3 minutes, Microsoft marks the gateway Inactive in Get-CsOnlinePSTNGateway output and stops routing calls to it.

If OPTIONS requests aren't answered (firewall drop, TLS handshake fail, SBC busy), Microsoft logs SBCNotResponding and customers see one-way call failures with no obvious cause. Always log inbound OPTIONS and confirm 200 OK.

TLS — Microsoft is strict

Microsoft validates the SBC's TLS certificate aggressively. Common rejection reasons:

DIDHub managed-SBC certs are issued from a public CA, auto-renew at 60 days, and are validated against the Microsoft cipher suite list daily.

SIP headers Microsoft is picky about

This is where most on-prem SBC deployments lose weeks. Microsoft enforces strict SIP semantics on every INVITE in and out:

Header / behaviorWhat Microsoft requires
Contact: on inbound INVITEMust contain the SBC FQDN, not its IP. Contact: <sip:[email protected]:5061;transport=tls>
From: domainMust be a verified domain in the tenant or the SBC FQDN. Mismatch → 403 Forbidden.
To:Request-URI and To header must reference E.164 with leading +. tel: URIs accepted.
P-Asserted-IdentityRequired for caller-ID. Must be E.164. Without it, the call shows "Unknown".
Diversion / History-InfoIf the call is forwarded, must include the original number. Used by Teams for "redirected from" UI.
Privacy: idFor anonymous calls, must use this. Don't blank P-Asserted-Identity.
Max-ForwardsMust be at least 70 inbound. Microsoft has been known to reject 60.
Re-INVITE handlingMicrosoft sends re-INVITEs for hold/transfer. SBC must process them and not 488.
SDP a=labelMicrosoft includes labels on each m-line. Don't strip them — some Microsoft components key off them.
Codec listSILK, G.722, G.711 (PCMU/PCMA). Opus is increasingly accepted but not universal.
SRTP keyingSDES with AES_CM_128_HMAC_SHA1_80. DTLS-SRTP not supported on Direct Routing media.

Media bypass — the optional optimization

By default, RTP flows through the SBC. With Media Bypass, the Teams client sends RTP directly to the SBC, skipping Microsoft's media path. Lower latency, less Microsoft bandwidth.

DIDHub managed SBC supports media bypass on request. Default is no-bypass (simpler troubleshooting). For high-volume tenants this typically improves p99 audio latency by 40-80ms.

Common failure modes

Validation commands

# Show all PSTN gateways
Get-CsOnlinePSTNGateway

# Show real-time SBC health from Microsoft's side
Get-CsOnlineSBCsHealth

# Show effective voice routing policy on a user
Get-CsOnlineUser -Identity "[email protected]" | fl OnlineVoiceRoutingPolicy

# Test routing for a number without placing a real call
Test-CsOnlineE911Service -PhoneNumber "+15551234567"

References

Related terms

Ready to get a number?

Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.