is there any way to handle max concurrent calls/co...
# ask-ai
p
is there any way to handle max concurrent calls/connections in livekit sip?
t
Thanks for reaching out, Vaneeza. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! In LiveKit, SIP participants are included in the overall participant concurrency limit, which counts all connected users across your rooms. For instance, on the free Build plan, you can have up to 100 concurrent participants per project, and this number includes SIP participants. If you ever need more capacity, higher limits are available with our paid plans. Although there isn't a specific setting to limit concurrent SIP calls directly, you can keep an eye on your overall concurrency using the LiveKit Cloud dashboard. Also, using settings like
max_call_duration
can help manage how long individual calls last, which can be a helpful way to indirectly control concurrency over time. If you're looking for more precise control—like limiting just SIP calls—you might want to add some application-level logic to restrict how many SIP participants are created at once. Please feel free to reach out if you'd like help with this or have any other questions. I'm here to support you! Sources: LiveKit Pricing | livekit-protocol/livekit/protocol/sip.py | lib/livekit/proto/livekit_sip_pb.rb | pkg/sip/inbound.go | Quotas and limits | LiveKit docs
p
is this the correct way for concurrent calls? agents.cli.run_app( agents.WorkerOptions( entrypoint_fnc=entrypoint, agent_name=AGENT_NAME, prewarm_fnc=prewarm_vad, # Use the prewarm function defined above initialize_process_timeout=20.0, # Increased timeout for Fly.io machine wake-up max_concurrent_sessions=MAX_CONCURRENT_CALLS # Enable multiple simultaneous calls ) ) bcz my particapant disconnects as soon as a new particapant connects.
t
It sounds like the issue you're facing, where a participant disconnects as soon as a new one joins, is happening because both participants are using the same identity. LiveKit requires each participant in a room to have a unique identity, so when someone connects with an identity that's already in use, the existing participant gets disconnected with the reason
DUPLICATE_IDENTITY
. To help fix this, I recommend making sure every SIP participant has a unique identity when they connect. A good approach is to combine details from the SIP call context, like a phone number and a timestamp, to create unique identities. This way, you can avoid any identity conflicts and allow multiple participants to join smoothly without anyone getting disconnected. If you'd like, I’m here to help you with how to implement these changes—just let me know! Sources: Connecting to LiveKit | LiveKit docs | Rooms, participants, and tracks | LiveKit docs | LiveKit Server Platform | livekit/livekit_composite | DeepWiki | livekit-rtc/livekit/rtc/participant.py | test/integration/sip_test.go