Troubleshooting Direct Routing

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 10 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Troubleshooting Direct Routing for Microsoft Teams Phone

Introduction: Why Troubleshooting Direct Routing Matters

Direct Routing is the bridge between the Microsoft Teams cloud telephony ecosystem and the public switched telephone network (PSTN). By using a Session Border Controller (SBC), organizations can connect their own telecommunications providers directly to Teams, offering unparalleled flexibility in carrier choice, geographic reach, and cost management. However, because Direct Routing involves multiple moving parts—including your local network, the internet, the SBC, and Microsoft’s cloud environment—the complexity of the setup can lead to intermittent issues that are notoriously difficult to diagnose.

Troubleshooting Direct Routing is not merely about fixing a broken dial tone; it is about understanding the flow of SIP (Session Initiation Protocol) traffic across distributed infrastructure. When a call fails, the problem could reside in a misconfigured firewall, an expired security certificate, a routing discrepancy in the SBC, or a mismatch in codec support. Mastering the art of troubleshooting this service is a critical skill for any communications administrator, as it ensures that your organization maintains the high availability required for business-critical voice communications.

In this lesson, we will dissect the architecture of a Direct Routing call, explore the diagnostic tools at your disposal, and walk through a structured methodology for identifying and resolving the most common issues you will encounter in production environments.


Not read yet

Understanding the Call Flow Architecture

Before diving into logs and commands, you must have a clear mental model of how a call travels through the Direct Routing pipeline. A typical outbound call originates from a Teams client, travels to the Microsoft Phone System, hits the SBC, and finally reaches the carrier network.

  1. Teams Client to Microsoft 365: The user initiates a call via the Teams application. The request is processed by the Microsoft 365 cloud.
  2. Microsoft 365 to SBC: Based on the Voice Routing Policy assigned to the user, Microsoft determines which SBC should handle the call and sends a SIP INVITE to the SBC’s FQDN.
  3. SBC Processing: The SBC receives the SIP request, performs necessary number normalization, and routes the call to the PSTN carrier.
  4. Carrier Response: The carrier confirms the call setup (183 Session Progress, 200 OK) and the media path is established.

If any of these steps fail, the call drops or never completes. Troubleshooting is essentially the process of determining exactly which "handshake" in this chain failed to occur.

Callout: The "Signaling vs. Media" Distinction

It is vital to distinguish between signaling and media issues. Signaling issues involve the setup of the call (the INVITE, 200 OK, BYE messages). If you see a "Call Failed" message immediately, it is almost certainly a signaling issue. If the call connects but you hear no audio or only one-way audio, you are dealing with a media issue, which usually points to firewall ports or NAT (Network Address Translation) misconfigurations.


Not read yet

Essential Diagnostic Tools

You cannot troubleshoot what you cannot see. Fortunately, Microsoft and the SBC vendors provide robust tools for visibility.

1. Microsoft Teams Admin Center (TAC)

The TAC provides a high-level overview of call health. Under the Analytics & reports section, you can view the Direct Routing report. This is your first stop for identifying trends, such as a sudden spike in 4xx or 5xx error codes across your organization.

2. PowerShell for Teams

The MicrosoftTeams PowerShell module is your primary interface for checking configuration. Commands like Get-CSOnlinePSTNGateway allow you to inspect the health of your SBC connection as seen by Microsoft.

3. SBC Logging (The "Source of Truth")

The logs generated by your SBC (e.g., AudioCodes, Ribbon, Oracle) are the most detailed source of information. Because the SBC sits at the edge, it captures both the SIP messages coming from Microsoft and the SIP messages going to the carrier. Learning to read a SIP ladder diagram within your SBC’s management interface is the single most important skill for a Direct Routing engineer.


Not read yet

Step-by-Step Troubleshooting Methodology

When a user reports a problem, do not guess. Follow this structured approach to narrow down the scope of the issue.

Step 1: Verify the User’s Voice Policy

Often, the problem is not with the SBC, but with the assignment of the Voice Routing Policy. If a user is not assigned the correct policy, they will not be able to route calls to a specific SBC.

Run the following command to check the user's current configuration:

Get-CsOnlineUser -Identity "[email protected]" | Select-Object -ExpandProperty OnlineVoiceRoutingPolicy

If this returns null, the user has no policy and cannot place outbound calls. Ensure the policy is assigned and that the corresponding Voice Route exists.

Step 2: Check SBC Health Status

Microsoft continuously monitors the health of the SBC. If the connection is down, Microsoft will not attempt to route calls to it. Check the status with:

Get-CsOnlinePSTNGateway | Select-Object Identity, State, LastModifiedTime

Interpretation:

  • Active: The SBC is connected and ready.
  • Inactive/Unavailable: The SBC is not communicating with the Microsoft SIP proxy. Check your firewall rules or certificate validity.

Note: The Certificate Trap

A common cause for an "Inactive" status is an expired or untrusted certificate. Ensure that your SBC is using a certificate from a trusted Root Certificate Authority (CA) that is included in the Microsoft Teams trusted list. If you use a self-signed certificate or one from an unrecognized CA, the handshake will fail immediately.

Step 3: Analyze SIP Ladder Diagrams

When a call fails, search your SBC logs for the specific Call-ID associated with that failure. Most enterprise SBCs provide a "SIP Ladder" or "Message Sequence" view. Look for the following response codes from Microsoft or the carrier:

  • 401/407 Unauthorized: Usually indicates a certificate mismatch or incorrect authentication settings.
  • 403 Forbidden: Often indicates that the number format is rejected by the carrier, or the SBC is not authorized to send calls from that specific calling number.
  • 404 Not Found: The number is not recognized by the carrier or the SBC routing table.
  • 488 Not Acceptable Here: This is a classic "Codec Mismatch." It means the SBC and the Microsoft cloud cannot agree on a common audio codec (e.g., G.711 vs. G.729).

Step 4: Validate Media Connectivity (The "Silent Call" Problem)

If the signaling works but there is no audio, the issue is almost always a firewall port blockage. Teams requires a specific range of ports to be open for media traffic.

  • Signaling Port: TCP 5061 (TLS).
  • Media Port Range: UDP 50000–59999.

Ensure your edge firewall allows UDP traffic from the Microsoft 365 IP ranges to your SBC’s public IP address. If the firewall is dropping packets, the call will set up, but the media stream will never initialize.


Not read yet

Common Pitfalls and How to Avoid Them

1. Incorrect Number Formatting

Microsoft sends numbers in E.164 format (e.g., +12025550100). If your carrier requires a different format (such as 10-digit local dialing), you must perform a normalization rule on the SBC. Failing to do this results in "404 Not Found" errors from the carrier.

2. Firewall Inspection/ALG

Some firewalls have a "SIP ALG" (Application Layer Gateway) feature. This feature attempts to "help" by inspecting SIP packets and modifying them. Disable SIP ALG immediately. It almost always breaks Direct Routing by mangling the SIP headers, leading to unpredictable call drops or one-way audio.

3. Improper DNS Resolution

The SBC must be able to resolve Microsoft’s FQDNs (e.g., sip.pstnhub.microsoft.com). If your internal DNS is misconfigured or cannot reach the public internet, the SBC will fail to keep the TLS connection alive, leading to intermittent "SBC unavailable" errors.

Callout: Best Practices for SBC Configuration

  1. Always use FQDNs: Never hardcode IP addresses for Microsoft endpoints, as these can change.
  2. Keep Time Synchronized: Ensure your SBC is using NTP. If the time on your SBC drifts significantly from the Microsoft cloud time, TLS handshakes will fail due to clock skew.
  3. Monitor Certificates: Set up alerts for certificate expiration 60 days in advance.
  4. Limit Access: Restrict the firewall to only accept traffic from Microsoft’s published IP ranges.

Not read yet

Detailed Troubleshooting Scenarios

Scenario A: Calls Dropping After 30 Seconds

This is a classic "Timer" issue. When a call is established, the SBC sends a 200 OK, and the Microsoft cloud should send an ACK (Acknowledgment). If the ACK does not reach the SBC, the SBC assumes the call failed and sends a BYE request to the carrier to tear down the connection.

  • Cause: The SBC is not receiving the ACK from Microsoft. This is often caused by a firewall misconfiguration or a routing issue where the ACK is being sent to a different interface than the one that initiated the call.
  • Fix: Check the firewall logs to see if the incoming ACK packets from Microsoft are being dropped. Verify the SBC's routing table to ensure traffic is returning through the correct gateway.

Scenario B: "One-Way Audio" (User can hear, but is not heard)

This scenario indicates that the inbound media stream from the carrier is reaching the Teams client, but the outbound media stream from the Teams client is being blocked or not routed correctly to the carrier.

  • Cause: Symmetric NAT or improper port forwarding.
  • Fix: Ensure that the SBC is configured to handle "Public IP" mapping correctly. If the SBC is behind a NAT, you must configure the SBC to advertise its public-facing IP address in the SIP SDP (Session Description Protocol) messages, rather than its internal private IP.

Scenario C: Intermittent "Call Failed" Errors

If calls work 90% of the time but fail randomly, you are likely dealing with a load-balancing or session limit issue.

  • Cause: The SBC may be hitting its maximum concurrent session limit, or the carrier is rejecting the burst traffic.
  • Fix: Check the SBC performance metrics. If CPU or memory utilization is high, you may need to scale the SBC instance. Also, check the carrier's "trunk capacity" to ensure you are not exceeding the agreed-upon concurrent call limit.

Not read yet

Comparison Table: Troubleshooting Indicators

Symptom Likely Cause Investigation Area
Immediate Call Drop Signaling / Routing SBC SIP Logs
No Audio (Both directions) Firewall / Port Block UDP 50000-59999
One-Way Audio NAT / SDP Misconfiguration SDP "c=" and "m=" lines
488 Not Acceptable Codec Mismatch SBC Media Profile
403 Forbidden Number Format / Policy SBC Normalization Rules
"Inactive" SBC Status TLS / Certificate Certificate Expiry / Trust

Advanced Troubleshooting: Using PowerShell for Deep Dives

While the SBC logs are the primary tool, PowerShell can help verify how Microsoft views your environment. If you suspect that a policy is not being applied, you can use the Test-CsEffectiveTenantDialPlan cmdlet to see how a number is being translated before it even reaches the SBC.

Testing Number Translation

If you have a user who cannot call a specific number, verify if the dial plan is stripping or adding digits unexpectedly:

Test-CsEffectiveTenantDialPlan -Identity "[email protected]" -DialedNumber "+15550109999"

This command will output the exact number format that Microsoft is sending to the SBC. If the output shows the number being stripped of the country code when your carrier requires it, you have found your issue. You must update your Tenant Dial Plan to ensure the number format matches the carrier's expectations.

Monitoring Real-Time Signaling

For advanced administrators, some SBCs (like AudioCodes) offer a web-based "Syslog" or "PCAP" capture that can be exported to Wireshark. If you are stuck, capturing a PCAP of a failed call and opening it in Wireshark is the gold standard of troubleshooting. Filter by sip to see the flow. If you see a 404 or 488 error, the packet details will show exactly which header or attribute is causing the rejection.


Not read yet

Best Practices and Industry Standards

1. Maintain a "Clean" SBC Configuration

Do not clutter your SBC with old routing rules or unused SIP trunks. Every rule is a potential point of failure. Audit your SBC configuration quarterly to remove entries that are no longer in use.

2. Implement Redundancy

A single SBC is a single point of failure. Always deploy SBCs in pairs (High Availability). Ensure that your Microsoft Voice Routing Policy is configured with multiple gateways so that if the primary SBC fails, the secondary takes over automatically.

3. Log Aggregation

If your organization is large, consider sending your SBC logs to a centralized log management system (like an ELK stack or Azure Monitor). Searching through thousands of lines of text logs on a single appliance is inefficient. Centralization allows you to create alerts for specific error codes, such as "500 Internal Server Error," so you can proactively address issues before users report them.

4. Documentation

Maintain a detailed spreadsheet of your dial plans, normalization rules, and SBC public IP addresses. When a carrier performs maintenance, you will need to know exactly which IP addresses are affected. Troubleshooting is 50% technical skill and 50% knowing your own environment configuration.


Not read yet

Common Questions (FAQ)

Q: Why do I see "404 Not Found" when I know the number is correct? A: This usually happens because the SBC is not configured to route the call to the correct SIP Trunk group. Check the SBC’s "IP-to-IP" or "Routing" table to ensure the dial pattern matches the incoming number.

Q: Can I use a firewall to block all traffic except Microsoft? A: Yes, and you should. Microsoft publishes a list of IP ranges for their services. You should configure your edge firewall to allow inbound/outbound traffic on the required ports only from these specific Microsoft IP ranges.

Q: My calls are dropping exactly after 15 minutes. What is this? A: This is almost always a "Session Timer" mismatch. The SBC and Microsoft have a "keep-alive" mechanism. If the timer values are different, the connection will time out. Check your SIP Timer settings on the SBC and ensure they align with the Microsoft-recommended values (usually 1800 seconds).

Q: Does it matter which codec I use? A: Yes. Teams primarily uses G.711 (PCMU/PCMA) and G.729. If your carrier only supports a proprietary or obscure codec, you will need to configure the SBC to perform "transcoding" (converting the audio from one format to another).


Not read yet

Summary and Key Takeaways

Troubleshooting Direct Routing is a methodical process of elimination. By understanding the call flow and utilizing the right diagnostic tools, you can resolve the vast majority of issues without needing to open a support ticket with Microsoft or your carrier.

Key Takeaways:

  1. Isolate the Layer: Always determine if the issue is signaling (SIP) or media (RTP). Signaling issues happen before the call rings; media issues happen after the call connects.
  2. Trust the Logs: The SBC logs are your best friend. Learn to read SIP ladder diagrams, as they provide the definitive record of what happened during the call handshake.
  3. Check the Basics First: Before deep-diving into complex configurations, verify the user's Voice Routing Policy, the SBC's connection state, and certificate validity.
  4. Beware of Gatekeepers: Disable SIP ALG on your firewalls. It is a common, silent killer of Direct Routing traffic that causes unpredictable behavior.
  5. Normalization is Key: Always verify that the number format arriving at the SBC matches what the carrier expects. E.164 is the standard for Microsoft, but your carrier may require local formatting.
  6. Redundancy is Mandatory: Never rely on a single SBC. Use paired configurations and ensure your Voice Routing Policy is configured to failover to a secondary gateway.
  7. Proactive Monitoring: Don't wait for users to complain. Use centralized logging and alerting to catch SBC failures or high error rates before they impact the business.

By following these principles, you will be well-equipped to manage and maintain a high-quality, reliable Direct Routing implementation that supports your organization's communication needs. Remember that consistency in configuration and diligence in monitoring are the hallmarks of a successful Teams Phone administrator.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.