The agent I am using is having automatic dispatch,...
# ask-ai
b
The agent I am using is having automatic dispatch, Until the evening, I tested a lot with the playground. But now suddenly it's not working in the playground. I'm able to talk with SIP, but now with WebRTC
t
Thanks for reaching out, Neelambar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
WebRTC connectivity issues in the LiveKit playground, while SIP continues to work, are often caused by network or firewall restrictions that specifically affect WebRTC's connection requirements. WebRTC uses a two-phase connection process: • ICE (Interactive Connectivity Establishment): Determines the best connection route. • DTLS+SRTP: A secure handshake process for encrypted media transmission. Common failure points include: • Firewall and NAT Issues: Firewalls may block UDP traffic or unknown ports, disrupting WebRTC while allowing SIP. • Transport Priority Limitations: WebRTC prioritizes ICE/UDP, ICE/TCP, TURN/UDP, and TURN/TLS. If higher-priority options fail, connections may not fallback properly. Why SIP Still Works: SIP uses different protocols and connection methods, making it less susceptible to the specific restrictions affecting WebRTC. Additionally, TURN over TCP/TLS on port 443 mimics HTTPS traffic, which is more firewall-friendly. Troubleshooting Steps: 1. Run the LiveKit Connection Tester with and without a firewall to identify failed stages (e.g., UDP or DTLS). 2. Force TURN usage by setting:
connectOpts.rtcConfig = { iceTransportPolicy: 'relay' }
. 3. Whitelist
*.turn.livekit.cloud
if needed. These steps should help identify and resolve the issue. Let me know if you need further assistance. Sources: Firewall Tips | SIP Integration | livekit/livekit_composite | DeepWiki
b
So my agent is running from my linux server, and I am using the browser from my laptop
t
When you're running an agent on a Linux server and accessing it through a browser on your laptop, you might run into some WebRTC connectivity hiccups. This can happen for a few reasons, so let’s walk through them together: 1. Network-Related Issues: • Sometimes, packet loss between your server and laptop can cause delays and make audio or video quality worse. • Since WebRTC uses UDP, firewalls or NAT settings might block or limit this traffic, which can cause problems. 2. Client-Side CPU Constraints: • If you’re on a lower-end laptop, it might have a tough time handling real-time encoding and processing. This can lead the browser to lower video resolution and frame rates to keep things running. • Also, if your bandwidth is limited, high-resolution video might get disabled to save on data. 3. Specific Troubleshooting Steps: • If you’re having trouble capturing audio, try increasing the queue size with
rtc.AudioSource(queue_size_ms=2000)
. • If the agent isn’t responding well to speech, tweaking the VAD sensitivity using
VADStream(min_silence_duration=0.3)
can help. • To reduce high latency, it’s a good idea to have your server close to your STT/TTS/LLM services to cut down on network distance. • Make sure your firewalls and NAT settings allow UDP traffic, and if needed, whitelist
*.turn.livekit.cloud
. These tips should help smooth out your WebRTC experience between your Linux server and laptop browser. If you hit any specific errors or want a hand with anything else, just let me know—I’m here to help!