lively-horse-90722
09/17/2025, 10:12 AMtall-airline-16756
09/17/2025, 10:12 AMtall-airline-16756
09/17/2025, 10:13 AMctx.wait_for_playout() to make sure the agent’s audio finishes playing completely before moving forward.
3. Delete the Room: Then, call the delete_room API to close the session for everyone involved and tidy up any resources. Here’s an example:
from livekit import api
async def hangup_call():
ctx = get_job_context()
if ctx is None:
return
await ctx.api.room.delete_room(
api.DeleteRoomRequest(room=ctx.room.name)
)
This way, you won’t have any leftover recordings or resources hanging around. If you’d like, I’m here to help you with any part of this process—just let me know!
Sources: Making calls using SIP | LiveKit Docs | agent.py | Agents telephony integration | LiveKit Docs | Job lifecycle | LiveKit Docs | telephony/sip_lifecycle.pylively-horse-90722
09/17/2025, 10:14 AMtall-airline-16756
09/17/2025, 10:15 AMlively-horse-90722
09/17/2025, 10:16 AMtall-airline-16756
09/17/2025, 10:16 AMlively-horse-90722
09/17/2025, 10:17 AM