important-judge-78504
10/02/2025, 3:24 PMtall-airline-16756
10/02/2025, 3:24 PMtall-airline-16756
10/02/2025, 3:24 PMctx.shutdown() manually after you come across a TwirpError when using create_sip_participant. This helps make sure the agent context closes properly and prevents any hiccups with managing its lifecycle. If you’d like, I’m here to help clarify anything or assist you further—just let me know!
Sources: Docs::Agents | agent.py | tests/test_ipc.pyimportant-judge-78504
10/02/2025, 3:35 PMtall-airline-16756
10/02/2025, 3:35 PMctx.shutdown() manually won’t interfere with LiveKit’s automatic shutdown when a participant disconnects. They’re both designed to work smoothly together, so the framework takes care of everything properly no matter which one triggers the shutdown. Also, feel free to call ctx.shutdown() multiple times—it’s completely safe because the framework handles it gracefully. If you have any more questions or need a hand with anything else, just let me know—I’m here to help!
Sources: Inside a session | LiveKit Docs | Making calls using SIP | LiveKit Docs | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti...important-judge-78504
10/02/2025, 3:50 PMtall-airline-16756
10/02/2025, 3:50 PMdeparture_timeout setting, which is set to 20 seconds by default. This gives a nice little buffer in case someone’s connection drops temporarily and they want to come back. Also, if a room is created but no one joins within the empty_timeout period (which is 300 seconds by default), the room will close automatically too. You can always tweak these settings in the LiveKit server settings to fit your needs. If you have any questions about this, I’m here to help!
Sources: config-sample.yamlimportant-judge-78504
10/02/2025, 3:52 PMtall-airline-16756
10/02/2025, 3:53 PMcreate_sip_participant call fails and causes a disconnect event, don’t worry—this won’t affect your next retries. Each call is handled independently, and the disconnect is just part of tidying things up after a failure. To keep everything running smoothly and avoid any hiccups like duplicate participants, it’s a good idea to use unique participant identities for each retry or make sure any leftover participant data from earlier attempts is cleared out before trying again. If you’d like, I’m here to walk you through this step-by-step or answer any questions you have—just let me know!
Sources: Making outbound calls | LiveKit Docs | test/integration/sip_test.go | livekit-agents/livekit/agents/job.py | sip-refer/agent.py | pkg/service/sip.goimportant-judge-78504
10/02/2025, 3:53 PMtall-airline-16756
10/02/2025, 3:54 PMcreate_sip_participant attempt, as long as there are other active participants still connected. The room stays open as long as at least one participant (like an agent session or another connected user) is there. This way, you can comfortably retry outbound calls without worrying about the room closing too soon. If you’d like me to explain anything further or have any other questions, please don’t hesitate to ask—I’m here to help!
Sources: telephony/sip_lifecycle.py | agent.py | Making outbound calls | LiveKit Docs | Docs::Telephony | examples/warm-transfer/warm_transfer.pyimportant-judge-78504
10/02/2025, 3:54 PMtall-airline-16756
10/02/2025, 3:55 PMimportant-judge-78504
10/02/2025, 3:55 PMtall-airline-16756
10/02/2025, 3:56 PMcreate_sip_participant attempt, the room won’t automatically shut down or interfere with retries—this holds true as long as the room itself isn’t explicitly deleted. LiveKit only shuts down a room when all Standard and Ingress participants leave, and SIP participant disconnections during call setup don’t trigger room closure by default.
To make sure your retries go smoothly, try to avoid calling delete_room too early, keep an eye on sip.callStatus to track call outcomes, and handle exceptions like TwirpError to figure out when retries are appropriate. If you’d like, I’d be happy to share an example of retry logic or clarify anything further—just let me know!
Sources: livekit-agents/livekit/agents/job.py | Docs::Telephony | Docs::Telephony | agent.py | telephony/sip_lifecycle.py