does departure_timeout work with outbound SIP call...
# ask-ai
g
does departure_timeout work with outbound SIP call?
t
Thanks for reaching out, Kim. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for your question! The
departure_timeout
parameter doesn't apply to outbound SIP calls in LiveKit, but don’t worry—there are other timeout settings that can help you manage those calls effectively, like: • Ringing Timeout: This controls how long the system waits for the call to be answered. • Max Call Duration: This sets the maximum length of the entire call. • Media Timeouts: These handle scenarios where RTP/media timeouts occur. If you’re aiming for a specific timeout behavior, like cleaning up calls when participants leave, just let me know! I’d be happy to walk you through the right configuration to get things working smoothly. Sources: livekit-protocol/livekit/protocol/sip.pyi | packages/livekit-server-sdk/src/SipClient.ts | lib/livekit/proto/livekit_sip_pb.rb | test/integration/sip_test.go | protobufs/livekit_sip.proto
g
I have AI agent, user (SIP Participant) and a Egress Agent inside a room. When SIP Participant leaves, I want the egress to stop recording and the room to end as soon as possible.
t
To gracefully stop egress and end the room when the SIP participant leaves, here’s a helpful approach you can try: • Monitor Participant Disconnection: Keep an eye out for the
participant_disconnected
event—that’s how you’ll know when the SIP participant has left the room. • Delete the Room: Once you detect that, you can use the
DeleteRoom
API to end the session for everyone and stop any ongoing egress. This way, everything closes up nicely. Here’s a simple example showing how you might watch for the disconnection and then delete the room:
Copy code
def on_participant_disconnected_handler(participant):
    if participant.kind == "PARTICIPANT_KIND_SIP":
        # Trigger room deletion logic here
        delete_room(participant.room_name)

def delete_room(room_name):
    # Call the DeleteRoom API to end the room
    api.room.delete_room(room=room_name)
I hope this helps you manage the room smoothly! If you have any questions or want to walk through the implementation together, just let me know—I’m here to help.