hallowed-artist-66283
04/24/2026, 9:38 AMtall-airline-16756
04/24/2026, 9:38 AMtall-airline-16756
04/24/2026, 9:38 AMhallowed-artist-66283
04/24/2026, 9:40 AMtall-airline-16756
04/24/2026, 9:40 AMrtcConfig when calling connect(...).
◦ If you see iceTransportPolicy: 'relay' — TURN is being forced.
◦ If you see an iceServers array with custom entries, those are custom TURN/STUN servers.
1. Run the Connection Test (diagnostic)
◦ Use the Connection Test / ConnectionCheck in your client SDK to check WebSocket, WebRTC, and TURN.
◦ Example (JS):
const checker = new ConnectionCheck({ url: 'wss://your-project.livekit.cloud', token: 'YOUR_TOKEN' });
const turnResult = await checker.checkTURN();
console.log(turnResult.status);
• If TURN fails but other checks pass, TURN connectivity is blocked by the network.
1. Verify whether LiveKit’s default TURN is being used
◦ If no iceServers are configured, LiveKit supplies TURN automatically (*.turn.livekit.cloud).
◦ No code = default TURN behavior.
1. Check common network blockers
◦ Corporate proxies/DPI (e.g., Zscaler) or strict firewalls often block UDP/DTLS or inspect TLS and break DTLS. Ask your network team to allow/whitelist turn.livekit.cloud and your project domain and disable protocol inspection for those domains.
What to send me next (this helps me pinpoint root cause):
• A short snippet of your agent/client connect call (the connect(...) options).
• Result of the Connection Test (especially TURN status).
• One example session timestamp + participant ID and the client network type (home Wi‑Fi, corp VPN, mobile).
I’ll use that to recommend the next steps (change client config, test TURN routing, or dig into logs).
Sources: Firewall Tips | Diagnosing Connection Errors with Connection Test Utility | Zscaler proxy configuration, with interactive elementshallowed-artist-66283
04/24/2026, 9:41 AMtall-airline-16756
04/24/2026, 9:41 AMawait ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY) call does not show any TURN/ICE options. That means the agent is using the client SDK’s default ICE behavior (LiveKit will supply TURN automatically if needed).
Next steps to verify and debug TURN/ICE:
1. Check the code path that creates the underlying RTC connection
◦ Find where ctx.connect is implemented/which client SDK version you’re using and inspect if it accepts an `rtcConfig`/`iceServers` or iceTransportPolicy option.
◦ If you don’t set iceTransportPolicy: 'relay', TURN is not being forced.
1. Look for any explicit iceServers in your client/agent code
◦ If present, those are custom TURN/STUN entries and may override defaults.
1. Run the Connection Test / ConnectionCheck from the same environment as the agent
◦ Example JS usage (adjust for your SDK): create a ConnectionCheck with your project URL + token and run `checkTURN()`; confirm status is SUCCESS or share the failure details.
1. Collect a short log sample
◦ When a participant disconnects, capture agent/client logs around the disconnect—look for ICE candidate exchange, DTLS handshake errors, or ICE failures.
If you want, paste:
• The file/lines where ctx.connect is defined or the client SDK + version,
• Output of a ConnectionCheck TURN test,
• A short log around a disconnect.
I’ll point to exact config changes or tests to run next.
, with interactive elementshallowed-artist-66283
04/24/2026, 9:44 AMiceServers in agent codetall-airline-16756
04/24/2026, 9:44 AMiceServers and you’re not passing rtcConfig, your agent is using the SDK’s default ICE behavior (LiveKit will provide TURN servers when needed). That means the issue is unlikely caused by a custom TURN config in your agent code.
Next focused steps to debug CONNECTION_TIMEOUT:
1. Run a ConnectionCheck from the same host/environment as the agent and share the TURN result.
◦ If you’re not using JS, tell me the SDK language/version and I’ll give the exact snippet to run.
1. Collect a short log around a disconnect (15–30s before/after) and look for:
◦ ICE candidate exchange lines
◦ DTLS handshake failures
◦ ICE timeout/failure messages
1. Test from multiple networks/devices:
◦ If disconnects only happen on specific networks (corporate, mobile), suspect firewall/DPI blocking UDP/DTLS.
◦ If it’s everywhere, share SDK version + agent deployment details.
If you want, tell me your SDK language/version now and I’ll provide the exact ConnectionCheck snippet and the specific log lines to look for.
, with interactive elementshallowed-artist-66283
04/24/2026, 9:45 AMtall-airline-16756
04/24/2026, 9:45 AMice_transport_policy, the SDK uses default ICE and LiveKit supplies TURN automatically.
2) How to force TURN or supply custom TURN (Python)
• You can pass rtc_config when connecting. Example:
from livekit import RTCConfig
rtc_cfg = RTCConfig(ice_transport_policy="relay") # force TURN
await ctx.connect(rtc_config=rtc_cfg, auto_subscribe=AutoSubscribe.AUDIO_ONLY)
• To supply custom TURN servers, set ice_servers on RTCConfig.
3) Run a connection/TURN check from the agent host
• Use the ConnectionCheck equivalent for Python (or run a small JS check from the same host/network). If you want the exact Python snippet for your SDK version, tell me the version and I’ll provide it.
4) What logs to collect (share these)
• 15–30s around a disconnect. Look for:
◦ ICE candidate gathering and exchange logs
◦ ICE connection state changes (e.g., "failed", "disconnected")
◦ DTLS/SRTP handshake errors
◦ Any TURN allocation or authentication errors
5) Quick triage you can run now
• Run ConnectionCheck from the same host and report TURN result (SUCCESS or FAILURE).
• Test connecting the agent from a different network (home/mobile) to see if the issue follows the host or the network.
• If you can, enable debug logging in the SDK and paste the log snippet for one disconnect (timestamp + participant id).
Tell me:
• Python SDK version,
• Result of a ConnectionCheck (or say if you want the snippet),
• One log snippet around a disconnect.
I’ll give the exact Python code for the check and the specific log lines to look for next.
, with interactive elements