narrow-chef-82684
09/22/2025, 3:27 PMrefined-appointment-81829
09/22/2025, 3:28 PMnarrow-chef-82684
09/22/2025, 3:30 PMbrave-island-45242
09/22/2025, 6:12 PMasync def auto_hangup_timer(ctx: "JobContext", timeout_seconds: int = 600) -> None:
await asyncio.sleep(timeout_seconds))
await ctx.api.room.delete_room(DeleteRoomRequest(room=ctx.room.name))
async def entrypoint(ctx: JobContext) -> None:
...
timeout_task = asyncio.create_task(auto_hangup_timer(ctx), name="auto_hangup")
...
If 600 seconds pass then it would delete the room. I'd also recommend cleaning the task in the shutdown callback.narrow-chef-82684
09/23/2025, 2:12 AMbrave-island-45242
09/23/2025, 3:20 PMnarrow-chef-82684
10/03/2025, 2:44 PMbrave-island-45242
10/03/2025, 4:50 PMbrave-island-45242
10/03/2025, 4:52 PMnarrow-chef-82684
10/04/2025, 3:02 AM