1/3
Teams calls dropping after ~5 mins on SWG (M5400) – WebSocket & session timeout issue? 100

Sudichai Lv1  Posted 2026-Sep-30 20:38

Last edited by Sudichai 2026-Sep-30 20:40.

Hey everyone,

Testing an SWG M5400 (v13.0.120) in explicit proxy mode to replace our old proxy. All M365 services worked fine on the old setup, but we're hitting issues here:

-Teams calls consistently drop around the 5-minute mark.

-Outlook has intermittent sync/connection hiccups.

-connectivity.office.com flags issues on Media Connection, TCP Connection, and WebSocket.


What we've done so far:

-Added Microsoft IPs/URLs to the allowlist per MS documentation.

-Added SSL Decryption exclusions for all M365 traffic (policy is otherwise Decrypt All).

-Confirmed upstream FortiGate isn't blocking anything.

The ~5-minute drop makes me suspect an aggressive TCP keep-alive or idle timeout (300s) on the SWG, or something messing with long-lived WebSocket sessions.

Has anyone run into this on 13.0.x? Any specific timeout tweaks or settings needed for Teams/WebSockets on this box?

Thanks in advance!

Muhammad Abid has solved this question and earned 20 coins.

Posting a reply earns you 2 coins. An accepted reply earns you 20 coins, 100 coins of bounty and another 10 coins for replying within 10 minutes. (Expired) What is Coin?

Enter your mobile phone number and company name for better service. Go

Yes — your 300-second suspicion is very plausible, but there is one important distinction: Teams media traffic and Teams signaling/WebSocket traffic should not be treated the same way through an explicit proxy.

Microsoft specifically notes that Teams uses long-lived bidirectional WebSocket connections, and recommends allowing WebSockets; if WebSockets fail, Teams falls back to HTTP long polling, which can increase latency and bandwidth.

Also, Microsoft documents that proxy/firewall TCP idle timeouts in the 100–300 second range can cause problems for long-lived Microsoft 365 connections, including Outlook.

What I would check on your M5400

1. Check the 300-second timeout first

On the SWG, look for the settings related to:

TCP connection timeout
TCP idle timeout
HTTP/HTTPS connection timeout
Persistent connection / Keep-Alive timeout
WebSocket timeout
Upstream server connection timeout

If you find 300 seconds, temporarily increase it substantially, e.g. 1800 seconds or 3600 seconds, for testing.

Don't change everything at once. Change the suspected idle/persistent connection timeout and test a Teams call for 10–15 minutes.

2. Make sure WebSocket is actually permitted

Your SSL-decryption exclusion is good, but SSL bypass alone doesn't guarantee that the SWG is handling WebSocket correctly.

The path should effectively be:

Client → Explicit Proxy → Microsoft 365

with WebSocket upgrade requests allowed.

Look specifically in the SWG logs for:

HTTP/1.1 101 Switching Protocols

A successful WebSocket connection normally gets the 101 Switching Protocols response.

If you see:

101

initially and then approximately 300 seconds later FIN/RST, that would be a very strong indication of a timeout/connection-management problem.

3. Teams calls are a separate issue

This is particularly important.

Microsoft Teams media uses UDP, including the documented Teams media ranges/ports. Current Microsoft documentation lists Teams media IP ranges and UDP ports such as 3478–3481.

Microsoft also recommends that Teams media traffic be routed appropriately rather than forcing it through unsuitable proxy paths.

So I would test this separately:

Teams signaling/control

HTTPS 443
WebSocket
Explicit proxy

Teams real-time media

UDP
3478-3481
Microsoft Teams media IP ranges

If your explicit proxy is only handling HTTP/HTTPS, don't assume that your Teams call media is going through the same path.

4. Your connectivity.office.com results are very useful

The fact that it reports:

❌ Media Connection
❌ TCP Connection
❌ WebSocket

while normal M365 browsing works strongly suggests this isn't simply an M365 URL allowlist problem.

I'd concentrate on the connection behavior of the SWG, rather than adding more Microsoft URLs.

Microsoft itself says Teams connectivity problems commonly trace back to firewall/proxy connectivity and that the required URLs/IPs/ports need to be permitted.

5. Do one very useful A/B test

This will tell us a lot.

Create a temporary test policy for one test PC:

Test PC
   |
   |-- NO explicit proxy --> Internet

Run:

Teams 15–20 minute call
Outlook
connectivity.office.com

Then:

Test PC
   |
   |-- M5400 explicit proxy --> Internet

Run exactly the same tests.

If:

Direct = OK

and

M5400 proxy = Teams drops around 5 min

then you've isolated the problem to the SWG/proxy path.

6. Even better: packet capture at the 5-minute mark

During a Teams call, capture the connection and look around:

04:55
04:59
05:00
05:01

You're looking for:

FIN
RST
TCP retransmissions
WebSocket close
proxy-generated termination

If the SWG sends a RST/FIN almost exactly at 300 seconds, that's considerably stronger evidence than simply observing that the call drops at 5 minutes.

My troubleshooting order

I would do it in this exact order:

A. Find the M5400 TCP/HTTP/WebSocket idle timeout.

B. If it's 300 seconds, temporarily increase it to 1800/3600 seconds.

C. Confirm WebSocket 101 Switching Protocols succeeds.

D. Check SWG logs at the exact 5-minute failure for the connection termination reason.

E. Verify Teams UDP media traffic is not being unnecessarily forced through the explicit proxy.

F. Run the direct-vs-proxy A/B test.

G. Only after that investigate FortiGate/NAT/ISP.

One thing I would not do yet

I wouldn't keep adding more Microsoft URLs/IPs to the allowlist. Your symptoms — particularly Teams ≈ 5 minutes + Outlook intermittent + WebSocket failure — fit a connection handling/timeout problem much better than a simple missing-domain problem.

I couldn't find a public Sangfor document specifically confirming a known M5400 v13.0.120 300-second Teams bug, so I wouldn't label this a confirmed version-specific defect yet. The Microsoft documentation does, however, directly support your concern about long-lived TCP/WebSocket connections and 100–300-second proxy/firewall idle timeouts.

If you send me screenshots of the M5400 timeout/connection settings (or the relevant SWG configuration page), I can tell you exactly which settings to change and what values to use, step-by-step.
Is this answer helpful?
Arsalan Israr Lv2  Posted 2026-Oct-03 02:04
  
Your hunch is likely right — 300s is a very common default idle/session timeout on firewalls and proxies (F5, AWS ALB, etc. all default to exactly this). Check if there's a separate UDP session timeout for Teams media (not just TCP/WebSocket), since media and signaling may time out independently. Worth opening a TAC case with session logs timed to the exact drop to confirm SWG-side vs upstream
Humayun Ahmed Lv4  Posted 2026-Oct-02 12:55
  
Yes, the ~5-minute (300-second) drop strongly suggests a timeout/session issue.

Check the SWG for:

TCP/HTTP idle timeout
WebSocket timeout
Keep-Alive timeout

Temporarily increase the relevant timeout to 1800–3600 seconds and retest Teams.

Also verify Teams WebSocket (101 Switching Protocols) and media connections. If failures occur exactly around 300 seconds, capture the traffic to confirm whether SWG sends FIN/RST.
Newbie380273 Lv2  Posted 2026-Oct-01 18:42
  

Hello,

Your 5-minute / 300s doubt is 100% correct. This is a classic TCP idle / WebSocket timeout issue on SWG in explicit proxy mode.

Teams uses long-lived WebSockets for signaling. If WebSocket fails, Teams falls back to HTTP long polling which causes delay and Outlook sync issues also.

For SWG M5400 v13.0.120, please check this:

**1. Increase Timeout to 3600s**
Go to SWG -> System / Proxy Settings -> Timeout Settings.
Check:
- TCP Connection Idle Timeout (default 300s)
- HTTP Persistent Connection Timeout
- WebSocket Session Timeout

Change from 300 to 1800 or 3600 for testing. Test a Teams call for 10-15 min. This will fix the 5-min drop.

**2. Allow WebSocket Properly**
SSL bypass alone is not enough.
Make sure WebSocket Upgrade is allowed: Client -> SWG Explicit Proxy -> M365.
In logs, search for "HTTP/1.1 101 Switching Protocols". If you get 101 and after 300s FIN/RST, it confirms timeout issue.

**3. Bypass Teams Media Traffic from Proxy**
This is very important as per Microsoft docs.
Teams Media uses UDP 3478-3481, 50000-50019. This traffic should NOT go through explicit proxy.
Route it directly via firewall / bypass list. Use PAC file exception for Teams media endpoints.

Recommended flow:
- Teams Signaling / Control (HTTPS 443 + WebSocket) -> via SWG Proxy with bypass for M365 + long timeout
- Teams Media (UDP) -> Direct via Firewall, not via Proxy

Also make sure your Microsoft IPs/URLs allowlist is updated from latest MS docs and SSL Decrypt exclusion for *.teams.microsoft.com, *.office.com is added.

After changing timeout, clear sessions and test again.

Thanks.
Newbie006434 Lv2  Posted 2026-Oct-01 17:47
  
Excellent troubleshooting shared here! The 5-minute drop is classic WebSocket/Persistent connection timeout behavior on SWG. I faced similar issue with Teams on explicit proxy mode - increasing the WebSocket timeout and persistent connection timeout to 3600s actually fixed it. Also checking the 101 Switching Protocols in SWG logs is a great tip to confirm if WebSocket is actually permitted. Thanks for highlighting the SSL bypass for MS365 traffic doesn't always mean WebSocket is handled correctly.
Prosi Lv4  Posted 2026-Oct-01 10:13
  
Hello, Symptom: SWG interception of Microsoft 365/Teams traffic—not caused by common issues with the Teams or Outlook clients. Steps
1. Bypass the SWG for Teams media traffic
Microsoft recommends direct UDP connectivity rather than forcing traffic through an HTTP/TCP proxy path. Required Teams media ports include UDP 3478–3481.
2. Disable SSL/TLS inspection for Microsoft 365
Microsoft does not recommend TLS decryption, interception, or deep packet inspection for Microsoft 365 endpoints.
3. Test WebSockets separately
Microsoft identifies the blocking of WebSockets by intermediary infrastructure as a configuration that can cause Microsoft 365 connectivity issues.
4. Check Outlook after applying the bypass
Unstable Outlook connections may share the same root cause if their HTTPS connections are also being inspected or interfered with by the SWG.
Andre Agave Lv2  Posted 2026-Oct-01 09:33
  
thanks for information
Newbie900829 Lv2  Posted 2026-Oct-01 02:05
  
Hi, this is a common TCP idle timeout issue causing Teams calls to drop at 5 mins.

Please try these steps:

1. Increase TCP session timeout from 300s to 3600s under System settings.
2. Add Microsoft / Teams domains (_.teams.microsoft.com, _.office.com) to SSL decryption exclusion list.
3. Also add them to WebSocket and long-lived connection whitelist.
4. Bypass Anti-Virus and Content Filtering for Teams traffic.

Once done, clear all sessions and test again. This should fix the 5-minute disconnect.

I Can Help:

Change

Moderator on This Board

1200
265
101

Started Topics

Followers

Follow

Board Leaders