We have deployed the voice agent on production, It...
# ask-ai
s
We have deployed the voice agent on production, It's timing out frequently..., out of 10 call 7 call getting time out .. We are not sure how to fix this issue as we are not getting any log at our end ... @refined-appointment-81829 @dry-elephant-14928 Can you please suggest the best practice here ? Here is once session detail which got timed out
Copy code
{
id: "AE_2ftfgVNpoTNp"
project_id: "p_99stuk17a91"
room_id: "RM_uZRFPimU8Nui"
timestamp: "2025-07-09T14:23:30Z"
type: "Participant left (CONNECTION_TIMEOUT)"
participant_id: "PA_o6c3GnTUYCmQ"
participant_identity: "agent-AJ_w4xXW2dbhmaR"
node_id: "NM_OASHBURN1A_HGd4PixR8WP8"
timestamp_us: 1752071010581595
disconnect_reason: "CONNECTION_TIMEOUT"
}
Slack Conversation
t
Thanks for reaching out, Navin. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To address frequent CONNECTION_TIMEOUT issues in your LiveKit voice agent deployment, consider the following best practices and troubleshooting steps: • Use the LiveKit Connection Tester to identify problems during UDP and DTLS connection phases. • Force clients to use TURN relay by setting
connectOpts.rtcConfig = { iceTransportPolicy: 'relay' }
to bypass potential firewall/NAT restrictions. • Whitelist TURN server domains (
*.turn.livekit.cloud
) on TCP port 443 to ensure TURN connectivity. • Review and adjust firewall and NAT settings to allow necessary traffic for LiveKit connections. • Enable detailed logging to capture more diagnostic information around connection timeouts. If CONNECTION_TIMEOUT persists, investigate network congestion and consider advanced strategies like adjusting buffer sizes or traffic shaping. These steps collectively help improve connection reliability and reduce timeout occurrences. Sources: Firewall Tips | src/room/PCTransportManager.ts | Voice Assistants | livekit/livekit_composite | DeepWiki | Speech & Audio Processing | livekit/livekit_composite | DeepWiki | Community & Support | livekit/livekit_composite | DeepWiki
s
connectOpts.rtcConfig = { iceTransportPolicy: 'relay' } which client side, we are using the nodejs agent provided by livekit for client side , where we can make the changes
t
Hey there! If you're working with the LiveKit Node.js client and want to make sure you're using TURN connections, I've got a friendly tip for you. You can easily enforce TURN usage by setting the
rtcConfig
to include
iceTransportPolicy: 'relay'
when you're setting up your connection. Just so you know, the Node.js SDK doesn't have a specific
connectOpts
parameter, but you can still tweak the WebRTC configuration when you're creating or joining a room. I'd be happy to help you pinpoint exactly where to add this configuration – if you could share the code snippet you're using to create or connect the client, I can walk you through it! Oh, and one more thing: make sure your TURN server is all set up and ready to go on the LiveKit server side. Double-check those domain and port settings to ensure your relay connections work smoothly. Sources: Firewall Tips | Deploying LiveKit | LiveKit Docs
s
How we can enable it for pyhton sdk
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!