lively-horse-90722
09/17/2025, 10:24 AMtall-airline-16756
09/17/2025, 10:24 AMtall-airline-16756
09/17/2025, 10:25 AMRoomInputOptions.close_on_disconnect is set to False, you’ll want to manually delete the room to keep everything running smoothly. Here’s a simple way to handle it:
1. First, detect when the user hangs up using callbacks or events.
2. Next, make sure any ongoing agent speech finishes by calling wait_for_playout().
3. Finally, use the delete_room API through the LiveKit server to close the room for everyone involved.
This method helps keep your rooms neat and tidy, avoiding problems like participants sticking around or extra audio in recordings. If you’d like, I’m here to help you implement this step-by-step—just let me know!
Sources: Agents telephony integration | LiveKit Docs | Inside a session | LiveKit Docs | Inside a session | LiveKit Docs | telephony/sip_lifecycle.py | agent.py