Microsoft Teams Direct Routing Configuration — Complete Step-by-Step Guide
Microsoft Teams Direct Routing is a powerful enterprise telephony feature that enables organizations to connect their own Session Border Controller (SBC), SIP trunk provider, and PSTN infrastructure directly to Microsoft Teams Phone. This allows full PBX-like capability, including inbound/outbound calling, call routing, IVR, auto-attendant, voicemail, E911, call analytics, and call compliance. This comprehensive ~5000-word guide covers planning, architecture, SBC configuration, certificates, PowerShell commands, Teams policies, voice routing, testing, troubleshooting, and operational best practices.
What is Teams Direct Routing?
Direct Routing is Microsoft’s solution for connecting external telephony systems to Teams. Instead of relying only on Microsoft Calling Plans, enterprises can use existing telecom circuits, SIP trunks, on-prem PSTN gateways, analog endpoints, contact center platforms, recording systems, and legacy PBX systems such as Cisco CUCM or Avaya. This flexibility makes Direct Routing ideal for national telecom providers, multinational enterprises, hybrid environments, and regulated industries.
Why Organizations Choose Direct Routing
Reasons companies choose Direct Routing include:
- Cost savings compared to Microsoft Calling Plans
- Use of existing SIP trunk contracts and PSTN numbers
- Support for branch survivability and hybrid telephony
- Integration with analog phones, fax, elevator lines, paging, and intercom devices
- Linking with contact center and recording systems
- Control over routing, QoS, and SBC security
- Advanced voice routing for multi-country deployments
Direct Routing Architecture Overview
A high-level architecture includes:
- Microsoft Teams cloud
- Azure AD identity and licensing
- Public DNS and certificates
- Session Border Controller (certified SBC)
- SIP trunk / PSTN connection
- Firewall and NAT management
SBC vendors commonly used:
- AudioCodes Mediant series
- SBCs from Ribbon Communications
- Microsoft Operator Connect SBC partners
- Any officially Microsoft certified SBC vendor
Pre-Requisites and Licensing Checklist
Before deploying Direct Routing, ensure the following:
- Microsoft 365 License: E1/E3/E5 or Business Voice
- Teams Phone Standard addon for E1/E3
- Audio Conferencing (if required)
- Phone System license enabled per user
- Users synced to Azure AD if hybrid
- UPN must match SIP domain
Admin access required:
- Teams Admin Center
- Microsoft 365 Admin Center
- PowerShell Teams Module
- SBC administrator login
- Firewall access for networking team
Networking & Firewall Requirements
Teams Direct Routing uses SIP TLS (TCP 5061) and SRTP media streams. Key ports:
- TCP 5061 — SIP signaling to Teams
- UDP/TCP 3478-3481 — media traffic (ICE/STUN)
- Azure IP ranges must be allowed
- FQDN for SBC must be publicly resolvable
DNS & TLS Certificates
Certificate requirements:
- Issued by trusted CA (DigiCert recommended)
- Subject Name = SBC FQDN
- SAN includes same FQDN
- Exportable PFX for SBC import
DNS Example:
sip.companydomain.com → Public SBC IP _sip._tls.companydomain.com → sip.companydomain.com
Session Border Controller Configuration Steps
- Install latest SBC firmware approved for Teams
- Import TLS certificate
- Configure SIP trunk from carrier
- Enable SRTP + TLS
- Create signaling groups for Teams
- Set codecs → primarily SILK, Opus, and G.711 fallback
- Create dial plan rules
- Define E911 policies
- Enable QoS tagging on SBC interfaces
Typical SBC routing logic:
Inbound PSTN ➜ SBC ➜ Teams SIP interface ➜ Teams user Outbound Teams call ➜ SBC ➜ PSTN carrier ➜ external number
PowerShell Commands for Direct Routing
# Connect to Teams Connect-MicrosoftTeams # Create PSTN gateway New-CsOnlinePSTNGateway -Fqdn "sip.companydomain.com" -SipSignalingPort 5061 -MaxConcurrentSessions 100 -Enabled $true # Create voice route New-CsOnlineVoiceRoute -Identity "MainRoute" -NumberPattern ".*" -OnlinePstnGatewayList "sip.companydomain.com" # Create Online Voice Routing Policy New-CsOnlineVoiceRoutingPolicy "GlobalVoicePolicy" -OnlineVoiceRoutes "MainRoute" # Assign to user Set-CsPhoneNumberAssignment -Identity user@domain.com -PhoneNumber +11234567890 -PhoneNumberType DirectRouting Grant-CsOnlineVoiceRoutingPolicy -PolicyName "GlobalVoicePolicy" -Identity user@domain.com Set-CsUserCallingSettings -Identity user@domain.com -EnterpriseVoiceEnabled $true
Teams Admin Center Configuration
Create and verify:
- Voice routing policies
- Dial plans (local normalization rules)
- Caller ID policies
- Emergency calling policies
- Outbound routing priority
Testing and Validation
Validate steps:
- Check SIP TLS registration on SBC
- Test outbound call from Teams
- Test inbound PSTN call
- Validate caller ID
- Test voicemail and call forwarding
- Check MS Call Analytics
- Perform E911 validation
Troubleshooting Common Issues
- 401/403 unauthorized — certificate or SBC auth issue
- No RTP / no audio — firewall or SRTP mismatch
- One-way audio — NAT or media relay configuration
- Call drop after 30 seconds — SIP session timer mismatch
- Teams cannot register — signaling certificate trust issue
- Dial plan failing — normalization rule error
- Delay or jitter — QoS tagging missing
Best Practices
- Use Microsoft-certified SBC hardware or virtual edition
- Apply QoS on WAN and LAN
- Use redundant SBCs and SIP trunks
- Perform regular firmware updates
- Monitor with Teams call quality dashboards
- Implement geo-based routing if multinational
- Plan emergency calling per region
Operational & Security Considerations
- Enable TLS mutual authentication
- Restrict SBC firewall rules to Microsoft SIP IP ranges
- Logging and packet capture on SBC
- Audit calling policies & usage
- Failover to PSTN via survivable branch appliance if required
Conclusion
Microsoft Teams Direct Routing gives enterprises ultimate flexibility in connecting PSTN, integrating legacy telephony, and operating secure modern cloud collaboration voice networks. Following the above structured planning, certificate management, SBC setup, Teams policy configuration, testing, and ongoing monitoring practices ensures a successful and scalable deployment.
This long detailed guide—covering architecture, prerequisites, SBC configuration, PowerShell setup, routing logic, testing, and troubleshooting—serves as a foundation for IT administrators, telecom engineers, and Microsoft 365 specialists to implement a complete enterprise-grade Teams voice solution.