does this automatically use bandwidth or network r...
# ask-ai
f
does this automatically use bandwidth or network resources / adds agent to room by dispatch or it only does that when user picks up the call via sip? CreateSIPParticipant Note Requires SIP
call
grant on authorization token. Create a SIP participant to make outgoing calls. Returns SIPParticipantInfo ParameterTypeRequiredDescriptionsip_trunk_idstringyesID for SIP trunk used to dial user.sip_call_tostringyesPhone number to call.sip_numberstringSIP number to call from. If empty, use trunk number.room_namestringyesName of the room to connect the participant to.participant_identitystringIdentity of the participant.participant_namestringName of the participant.participant_metadatastringUser-defined metadata that is attached to created participant.participant_attributesmap<string, string>Key-value mapping of user-defined attributes to attach to created participant.dtmfstringDTMF digits (extension codes) to use when making the call. Use character
w
to add a 0.5 second delay.play_dialtoneboolOptionally play dial tone in the room in the room as an audible indicator for existing participants.hide_phone_numberboolIf true, use a random value for participant identity and phone number ommitted from attributes. By default, the participant identity is created using the phone number (if the participant identity isn't explicitly set).headersmap<string, string>SIP X-* headers for INVITE request. These headers are sent as-is and may help identify this call as coming from LiveKit.include_headersSIPHeaderOptionsSpecify how SIP headers should be mapped to attributes.ringing_timeoutgoogle.protobuf.DurationMaximum time for the callee to answer the call. The upper limit is 80 seconds.max_call_durationgoogle.protobuf.DurationMaximum call duration.krisp_enabledboolTrue to enable Krisp noise cancellation for the callee.media_encryptionSIPMediaEncryptionWhether or not to encrypt media.wait_until_answeredboolIf true, return after the call is answered — including if it goes to voicemail.display_namestringOptional display name for the caller's number. If empty, results in a CNAM lookup by destination carrier. If ommitted, defaults to caller's number. For more information, see Custom caller ID
t
Thanks for reaching out, Manav. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m addressing your question about CreateSIPParticipant: whether it consumes network/bandwidth or adds an agent to the room immediately or only when the SIP callee answers. • CreateSIPParticipant starts using network resources immediately. LiveKit sends the SIP INVITE and signaling/connection setup happens as soon as the API is called. • The SIP participant is created and appears in the specified room immediately (its
sip.callStatus
will be
dialing
until answered). • Two-way audio media (actual media bandwidth for the call) begins only when the callee answers and the call becomes
active
. If
wait_until_answered: true
, the API call will wait until that happens. • Whether an agent is added to the room depends on your dispatch configuration (explicit dispatch vs. automatic dispatch rules or room/token settings). Agent dispatch is controlled by those rules and is not automatically tied to the callee answering unless your rules are configured that way. Would you like me to check how your current dispatch rules are configured or walk through an example setup to ensure agents are added exactly when you want? Sources: Making outbound calls | LiveKit docs | Make outbound calls | LiveKit docs | SIP APIs | LiveKit docs | SIP participant | LiveKit docs | Agent dispatch | LiveKit docs
f
is making outbound calls will autoscale my instances on number of calls dialled or on calls picked?
t
Short answer: autoscaling is driven by answered (active) calls, not by calls merely dialed. Details: • Dialing via CreateSIPParticipant initiates signaling and a SIP participant in the room (status
dialing
), but this has minimal resource impact. • Significant CPU/memory and media forwarding begin when the callee answers and the call becomes `active`; autoscalers monitor those resource metrics. • So instances scale based on active/answered calls (and resulting resource usage), not on outbound attempts. Would you like me to review your current autoscaling rules or suggest metrics (CPU, active participants, concurrent streams) to use for scaling? Sources: Making outbound calls | LiveKit docs | Make outbound calls | LiveKit docs | Deploying to custom environments | LiveKit docs | Deploy and scale agents on LiveKit Cloud
f
if i dial the call, but parallely dispatch agent to a room, will this use my actual cpu memory usage and autoscale? or it will only happen on call pickup?
t
Short answer: dispatching the agent will use CPU/memory and can trigger autoscaling immediately — dialing alone will not. Details: • If you dispatch an agent to the room, the agent worker/process starts, loads any models/prewarm code, and consumes CPU and memory right away. That agent load counts toward autoscaling metrics. • Creating the SIP outbound call (dialing) performs signaling and creates a SIP participant with status
dialing
, but it has minimal agent-side CPU/memory impact until the call is answered. • When the callee picks up, media becomes active and media-related load increases further; but the agent’s resource usage already started at dispatch time. If you want to avoid scaling before answer, you can dispatch the agent only after you detect
sip.callStatus
becomes
active
. Would you like a pattern or example for that conditional dispatch? Sources: Deploying to custom environments | LiveKit docs | Agent server options | LiveKit docs | Agents telephony integration | LiveKit docs | Make outbound calls | LiveKit docs
f
how to dial outbound in a way that room only gets created / agent is dispatched only on call is picked
t
You're asking how to dial outbound so the room/agent are only created/dispatched when the call is picked up. Do this: 1. Don't auto-dispatch agents via room config or dispatch rules. 2. Initiate the outbound call with
CreateSIPParticipant
but either: ◦ Use
wait_until_answered=true
so the API call returns only after the call is answered, then programmatically dispatch the agent to the room; or ◦ Start the call without waiting, and subscribe to participant events/webhooks for
participant_attributes_update
where
sip.callStatus
becomes
active
. When you receive that event, call
CreateAgentDispatch
(or your agent dispatch API) to add the agent to the room. 1. (Optional) Use a control/dialing room that has no auto-dispatch so dialing doesn’t trigger agents; after answer, create or move into the agent room and dispatch. This ensures agent worker processes (and their CPU/memory) only start after the call is active, avoiding premature autoscale. Would you like a code example for webhooks or the
wait_until_answered
flow? Sources: Making outbound calls | LiveKit docs | Make outbound calls | LiveKit docs | server-sdk-js | livekit/livekit_composite | DeepWiki | Agents telephony integration | LiveKit docs
f
is there not a way that when i make the call, it automatically dispatches my metadata based agent to a random room name on call pickup
t
Short answer: there’s no single built-in switch that makes CreateSIPParticipant automatically dispatch your metadata-based agent into a random room only when the callee picks up. You can achieve the behavior reliably with this pattern: 1. Generate a unique room name per call (e.g., outbound-call-<id>). 2. Create the outbound call with
CreateSIPParticipant
but do NOT configure auto-dispatch in room config or dispatch rules. ◦ Option A (simpler): call
CreateSIPParticipant
with
wait_until_answered=true
. The API returns only after the call is answered. ◦ Option B: call
CreateSIPParticipant
without waiting and subscribe to webhook / participant events; watch for
participant_attributes_update
where
sip.callStatus
==
active
. 1. When you detect the call is active (or
CreateSIPParticipant
returns), call the Agent Dispatch API (
CreateAgentDispatch
) to dispatch your agent to that generated room and include your metadata. The agent will then join that room and consume resources. Why: CreateSIPParticipant always creates the SIP participant (and the room if it doesn’t exist) and starts signaling immediately, but agent dispatch must be performed explicitly; delaying dispatch until
active
avoids wasting agent CPU/memory and unwanted autoscaling. If you want, I can provide a short code example for the webhook flow or the
wait_until_answered
+ dispatch flow in your preferred language. Which do you prefer? Sources: Agents telephony integration | LiveKit docs | Make outbound calls | LiveKit docs | Agent dispatch | LiveKit docs | Agent server | LiveKit docs