steep-balloon-41261
04/20/2026, 1:49 AMtall-airline-16756
04/20/2026, 1:49 AMtall-airline-16756
04/20/2026, 1:50 AMdelete_room succeeds, the room and SIP participant are removed but your self‑hosted SIP bridge does not send a SIP BYE to Twilio, leaving the PSTN leg open until Twilio times out. Let’s narrow this down and get it fixed.
Could you provide the following so I can diagnose faster?
• Are you running the official LiveKit SIP bridge from the same release as agents 1.4.0, and is it self‑hosted or a custom build?
• Exact sequence you call to terminate the session (agent hang_up → do you call delete_room immediately or rely on agent shutdown to delete the room?). A short pseudocode snippet is fine.
• SIP bridge logs (debug level) around the hang_up/delete_room time — especially any INVITE/ACK/200/Bye activity or errors.
• Twilio call SID and approximate timestamps of the hanging call (if available) so we can correlate with bridge logs.
• SIP trunk / dispatch rule configuration or any custom SIP headers you set when originating the call.
While you gather that, try these checks which commonly reveal causes:
• Enable debug logging on the SIP bridge and watch for receipt of the room/participant removal event and any attempt to send BYE.
• Confirm delete_room ordering: if you delete the room before the bridge has the participant context, the bridge may not send BYE. Try letting the agent session close first (or use delete_room_on_close=True) and observe whether BYE is sent.
• Verify the SIP trunk and routing rules in your self‑hosted SIP bridge match the original call leg (sometimes missing mapping prevents BYE from being routed).
• Check for race conditions: increase the delay between agent hang_up and delete_room as a quick test to see if BYE appears.
• Inspect the SIP bridge for errors about missing dialog state or inability to reach Twilio when attempting BYE.
If you send the requested logs/config and the sequence you use, I’ll review them and suggest exact next steps or a patch/workaround.
Sources: Python SDKs | livekit/livekit_composite | DeepWiki | Job lifecycle | LiveKit Documentation | Agent speech and audio | LiveKit Documentation | Agents telephony integration | LiveKit Documentation | sip | livekit/livekit_composite | DeepWiki, with interactive elements