nice-fish-21757
12/26/2025, 3:36 AMtall-airline-16756
12/26/2025, 3:36 AMtall-airline-16756
12/26/2025, 3:36 AMsession.shutdown(), so the registered shutdown callback won’t run.
What you can do (short checklist):
• Confirm you registered the shutdown callback with ctx.add_shutdown_callback(...).
• If you use create_sip_participant(..., wait_until_answered=True), handle the timeout/error from that call and explicitly disconnect the room or shutdown the session in the exception path.
• If you don’t wait for answer, monitor the SIP participant’s sip.callStatus (or equivalent) and trigger cleanup when it reaches an unconnected/failure state.
• Add an explicit timeout: after N seconds of no answer, call await ctx.room.disconnect() or await session.shutdown() to ensure callbacks run.
If you’d like, paste the snippet where you dial (the create_sip_participant call and how you register the shutdown callback) and I’ll point out exactly where to add the explicit cleanup and an example try/except.
Sources: SIP Lifecycle Management Agent | LiveKit docs | Agents telephony integration | LiveKit docsnice-fish-21757
12/26/2025, 3:44 AMtall-airline-16756
12/26/2025, 3:44 AMctx.shutdown() but the shutdown callback still isn’t running.
To diagnose this quickly, please paste these three small snippets (or confirm them):
1. Where and how you register the shutdown callback (the ctx.add_shutdown_callback(...) code).
2. The exact line(s) where you call ctx.shutdown() (or `session.shutdown()`/`ctx.room.disconnect()`), and whether that call runs inside the same task that registered the callback.
3. Any logs or exceptions around shutdown (including startup logs showing the callback was registered, and any timeout/errors after calling shutdown).
Common causes to check while you paste code:
• The callback is registered after you call ctx.shutdown() (order issue).
• The callback raises an exception immediately when run (check logs for stack trace).
• The shutdown call is in a different context/object than the one where the callback was registered (different `ctx`/session).
• A shutdown timeout is hit and the hook is aborted — look for timeout logs.
If you share those snippets/logs I’ll point out the exact fix (ordering, try/except around the hook, or calling the correct shutdown function).
Sources: Job lifecycle | LiveKit docs