fresh-telephone-307
12/07/2025, 6:23 PMcall 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 IDtall-airline-16756
12/07/2025, 6:23 PMtall-airline-16756
12/07/2025, 6:23 PMsip.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 docsfresh-telephone-307
12/07/2025, 6:24 PMtall-airline-16756
12/07/2025, 6:25 PMdialing), 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 Cloudfresh-telephone-307
12/07/2025, 6:26 PMtall-airline-16756
12/07/2025, 6:26 PMdialing, 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 docsfresh-telephone-307
12/07/2025, 6:27 PMtall-airline-16756
12/07/2025, 6:27 PMCreateSIPParticipant 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 docsfresh-telephone-307
12/07/2025, 6:28 PMtall-airline-16756
12/07/2025, 6:28 PMCreateSIPParticipant 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