Restrict Voice Agent to 5 Concurrent Calls with Automatic Queueing for Additional Callers

Hi LiveKit Team,

We’re looking to limit the concurrency of our voice agent to 5 active calls.

Our expected behavior is:

  • The agent should accept a maximum of 5 concurrent calls.
  • When a 6th caller arrives, the call should not be rejected or receive a “worker at full capacity” error.
  • Instead, the caller should remain queued/waiting until one of the active calls ends.
  • As soon as a slot becomes available, the queued call should automatically be connected to the agent.

Is there a built-in way to achieve this using LiveKit Agents or SIP, or would this need to be implemented externally (e.g., at the SIP provider, SBC, or application layer)?

If this isn’t currently supported, what is the recommended architecture for implementing a waiting queue while limiting the agent to a fixed number of concurrent calls?

@darryncampbell +++++++++

This is not directly built in. I am not sure this is a great solution but thinking out loud you could:

  1. Keep track of active calls your agent is involved in
  2. Use request_fnc to check if you have an open slot and not accept if you are above your limit

There will be a timeout if there is not a slot open in a given amount of time.

I guess another option is you could have a sort of lobby where you park calls and play messages/audio to callers while they are waiting for a slot. Once a slot becomes available you would move them to a room and dispatch and agent there. I don’t have any off the shelf example of this but you should be able to do this with the server APIs.