I’m experiencing an issue with the Self-hosted on ...
# ask-ai
m
I’m experiencing an issue with the Self-hosted on Digital Ocean Livekit Server with SIP. When a room is created, my participant joins the room, but the first greetings take an unusually long time. The greeting time can range from 20 seconds to 40 seconds in some cases. I’m not sure what I’m doing wrong.
t
Thanks for reaching out, Muhammad. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! I understand the delay in participant greetings when using SIP with your self-hosted LiveKit server on Digital Ocean can be a bit frustrating. Let’s walk through some steps together to troubleshoot and hopefully smooth things out: • Network Configuration: Double-check that your NAT traversal is set up right, your firewall rules allow SIP traffic, and your RTP port ranges (like 20000-20010) are correctly configured. • Jitter Buffer: Try enabling jitter buffer settings to help improve audio quality and reduce delays. • WebRTC Setup: Keep in mind, a 5-second delay during WebRTC setup is pretty normal. See if what you’re seeing matches this. • SIP Trunk Configuration: Take a look at your authentication and trunk IDs to make sure there’s nothing off that might be causing delays. • Diagnostics: Gathering call flow logs, trunk configurations, and WebRTC stats can really help pinpoint where things might be slowing down. If you’re still running into issues after trying these, just give me a shout! We can dig deeper together or get some extra help to get this sorted out. Sources: test/integration/sip_test.go | pkg/service/sip.go | SIP Integration | livekit/livekit_composite | DeepWiki | SIP troubleshooting guide | LiveKit Docs | Getting Help | livekit/livekit_composite | DeepWiki
m
Tested all goo call connects but take at least 10 sec before hearing something first.
t
Hey there! To help us figure out that 10-second delay before the audio starts, could you share a bit more about your setup? • When does the delay happen — during SIP signaling, media negotiation, or when connecting to the LiveKit room? • Are you working with any specific SIP providers or using custom configurations? • What timeout and jitter buffer settings do you currently have? • Do you use any custom SIP headers or special authentication methods? With these details, we’ll be in a much better spot to pinpoint what’s going on and help you sort it out.
m
2025-08-13T003228.985Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:439 remote ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "SUBSCRIBER", "candidate": "candidate:3048731918 1 tcp 1671430143 159.203.20.235 7881 typ host tcptype passive ufrag VIYBoqVgYlHnhyif"} 2025-08-13T003228.985Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:439 remote ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "SUBSCRIBER", "candidate": "candidate:497351156 1 udp 2130706431 10.20.0.6 51797 typ host ufrag VIYBoqVgYlHnhyif"} 2025-08-13T003228.985Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:341 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "SUBSCRIBER", "candidate": "candidate:1512660953 1 udp 1694498815 159.203.20.235 41574 typ srflx raddr 0.0.0.0 rport 41574 ufrag KpIJMGJIavRghjYs"} 2025-08-13T003228.985Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:341 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.24^C subscribing to existing room participants {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "participants": 0} 2025-08-13T003228.994Z INFO sip sip/inbound.go:546 Waiting for track subscription(s) {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "jitterBuf": false, "sipRule": "SDR_xz5JPhGneMTP", "room": "open-room", "participant": "sip_1001", "participantName": "Phone 1001"} 2025-08-13T003229.014Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/transport.go:416 starting to negotiate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060"} ice ERROR: 2025/08/13 003229 Failed to enable mDNS over IPv6: (listen udp6 [ff02:]5353: socket: address family not supported by protocol) 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/transport.go:418 create offer {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "offer": "v=0\r\no=- 845382904663736504 1755045149 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=msid-semantic:WMS*\r\na=fingerprint:sha-256 25BEE1BA80C77D07C4419352D8CC7C2505BE00D58674F88FFF1AD2D89564FBC0\r\na=extmap allow mixed\r\na=groupBUNDLE 0 1\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 9 0 8\r\nc=IN IP4 0.0.0.0\r\na=setupactpass\r\na=mid0\r\na=ice-ufragmamMJgQQXAvIRmKC\r\na=ice pwdgbUYAGFAXgTqTFpJbudjproGlMwTKqft\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtcp-fb:111 transport-cc \r\na=rtpmap:9 G722/8000\r\na=rtcp-fb:9 transport-cc \r\na=rtpmap:0 PCMU/8000\r\na=rtcp-fb:0 transport-cc \r\na=rtpmap:8 PCMA/8000\r\na=rtcp-fb:8 transport-cc \r\na=extmap:1 urnietfparamsrtp hdrextssrc-audio-level\r\na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=ssrc:1984180001 cnamepion\r\na=ssrc1984180001 msid:pion audio\r\na=ssrc:1984180001 mslabelpion\r\na=ssrc1984180001 labelaudio\r\na=msidpion audio\r\na=sendrecv\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=setupactpass\r\na=mid1\r\na=sendrecv\r\na=sctp-port5000\r\na=max message size1073741823\r\na=ice-ufragmamMJgQQXAvIRmKC\r\na=ice pwdgbUYAGFAXgTqTFpJbudjproGlMwTKqft\r\n"} 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:326 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:138708206 1 udp 2130706431 159.203.20.235 46532 typ host ufrag mamMJgQQXAvIRmKC"} 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:326 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:497351156 1 udp 2130706431 10.20.0.6 54364 typ host ufrag mamMJgQQXAvIRmKC"} 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:326 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:3701001842 1 udp 2130706431 10.118.0.2 55987 typ host ufrag mamMJgQQXAvIRmKC"} 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:326 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:233762139 1 udp 2130706431 172.17.0.1 42250 typ host ufrag mamMJgQQXAvIRmKC"} 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:326 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:3528925834 1 udp 2130706431 172.18.0.1 54677 typ host ufrag mamMJgQQXAvIRmKC"} 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:326 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:1512660953 1 udp 1694498815 159.203.20.235 36877 typ srflx raddr 0.0.0.0 rport 36877 ufrag mamMJgQQXAvIRmKC"} 2025-08-13T003229.015Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:326 local ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:2918273010 1 udp 16777215 159.203.20.235 37816 typ relay raddr 0.0.0.0 rport 44050 ufrag mamMJgQQXAvIRmKC"} 2025-08-13T003229.017Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:429 successfully set publisher answer {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060"} 2025-08-13T003229.017Z DEBUG sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/engine.go:439 remote ICE candidate {"nodeID": "NE_GHf9RdSFRmy7", "callID": "SCL_Uj389HdqQSMk", "fromIP": "188.245.216.195", "toIP": "159.203.20.235:5060", "fromHost": "188.245.216.195", "fromUser": "1001", "toHost": "159.203.20.235", "toUser": "medicare2", "sipTag": "as4895ea80", "sipCallID": "5ede1cb7277f105367e509291f689ab5@188.245.216.195:5060", "target": "PUBLISHER", "candidate": "candidate:138708206 1 udp 2130706431 159.203.20.235 50421 typ host ufrag bsluIsDwdtevmWuU"}
t
It looks like the logs are showing some possible delays during the ICE candidate exchange phase, which might be slowing down how quickly your audio starts. No worries though—here are a few things you can try to smooth things out: • Network Configuration: Double-check that NAT traversal is set up right and that your firewalls are letting UDP traffic through on the needed ports. If UDP is getting blocked, setting up TURN to relay traffic can really help. • Force TURN: If you’re dealing with a strict firewall, you can make clients use TURN by setting the
iceTransportPolicy
to
relay
. This often clears up connection hiccups. • Monitor ICE Logs: Take a look at the ICE logs for any failed candidate additions or transport type choices—this can give clues about where things might be getting stuck. • Whitelist TURN Servers: Make sure to whitelist
*.turn.livekit.cloud
on TCP/443 so TURN traffic can flow without being blocked. • Test Connectivity: Try out the LiveKit Connection Tester to spot any issues with UDP or DTLS stages. It’s a handy tool to pinpoint trouble spots. If you hit any snags or want some extra help after trying these, just let me know—I’m here to help! Sources: Firewall Tips | SIP Integration | livekit/livekit_composite | DeepWiki | pkg/rtc/transport.go
m
This is on self hosted VM
t
Thanks for letting me know this is on a self-hosted VM. For setups like yours, here are a few extra steps that can help make ICE candidate exchange smoother and cut down on delays: • Check NAT Configuration: Make sure your VM’s network is set up right for NAT traversal. This means having STUN/TURN servers in place and ensuring public IPs are properly mapped. • Firewall Rules: Double-check that your VM’s firewall lets UDP traffic through on the ports WebRTC needs (like 20000-20010 for RTP) and for SIP signaling (like 5060). • TURN Server Setup: If you’re running your own TURN server, confirm it’s configured correctly and accessible from both the VM and your clients. • ICE Candidate Logging: Turn on detailed ICE candidate logging on your LiveKit server so you can keep an eye on the exchange process and spot any hiccups. • Regional Deployment: If you can, try placing your VM closer to your participants geographically to help reduce network latency. Feel free to reach out if you want a hand setting any of this up or if you’re still seeing issues after trying these tips. I’m here to help!