Hello, is possible to set a custom emptyTimeout in...
# ask-ai
a
Hello, is possible to set a custom emptyTimeout in the dispatch rule? or how can i set a custom emptyTimeout for my inbound calls?
t
Thanks for reaching out, Angel. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you customize the
emptyTimeout
for rooms created through SIP dispatch rules or inbound calls! You can easily do this by specifying the
roomConfig
parameter when setting up your dispatch rule. This way, you get to control important room-level settings like
emptyTimeout
, which determines how long a room stays open if no one joins. Here's a friendly example using the LiveKit server SDK in TypeScript to guide you:
Copy code
await sipClient.createSipDispatchRule(
  {
    type: 'individual',
    roomPrefix: 'call',
  },
  {
    name: 'inbound-dispatch-rule',
    trunkIds: ['trunk-id'],
    roomConfig: {
      emptyTimeout: 600, // Room stays open for 600 seconds if no one joins
      departureTimeout: 30,
    },
  }
);
Also, just so you know, you can set default room configurations like
emptyTimeout
at the server level in the LiveKit config file (such as
config-sample.yaml
). But if you specify values in
roomConfig
when creating the dispatch rule, those will take precedence. I hope this helps you get everything set up just the way you want! Sources: pkg/rtc/room.go | packages/livekit-server-sdk/src/SipClient.ts | Sources/LiveKit/Types/RoomConfiguration.swift
a
is there any inconvenience if i set the emtyTimeout to 0? for sip calls. i dont need reconnections. becuase if they end the call and call again i will create a new room
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!