bitter-analyst-30633
04/14/2026, 1:43 PMtall-airline-16756
04/14/2026, 1:43 PMtall-airline-16756
04/14/2026, 1:43 PMawait 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