await ctx.wait_for_participant() what is the timeo...
# ask-ai
b
await ctx.wait_for_participant() what is the timeout for SIP participants for this? 2026-04-14 190147.302 error Unexpected error occurred: room disconnected while waiting for participant 2026-04-14 190127.106 info Waiting for participant to join room. In this case I got an error after 20 seconds
✅ 1
t
Thanks for reaching out, Vineeth. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you’re asking about the timeout for SIP participants when using
await ctx.wait_for_participant()
and why you saw a disconnect ~20s after waiting. •
ctx.wait_for_participant()
does not impose a timeout — it waits indefinitely for a participant to join. • The ~20s disconnect is not from
wait_for_participant()
itself. For SIP participants this commonly happens due to transport/keep-alive issues or SIP call setup failures (for example ICE/STUN keep-alive lapses or SIP trunk/dispatch problems) that lead to a room disconnect or a
STATE_MISMATCH
disconnect around that timescale. • Recommended next steps: ◦ Wrap the wait in your own timeout (for example
asyncio.wait_for(...)
) if you need a hard limit. ◦ Add error handling around the wait to catch disconnects and log the disconnect reason. ◦ Verify SIP trunk and dispatch rules and check that ICE/keep-alive packets are being exchanged during call setup. If you want, share the room logs or the disconnect reason string and I’ll help pinpoint whether it’s ICE, SIP routing, or something else. Sources: Job lifecycle | LiveKit Documentation | Understanding the STATE_MISMATCH Disconnect Reason | Agents telephony integration | LiveKit Documentation | sip | livekit/livekit_composite | DeepWiki, with interactive elements