I have deployed my voice agent using livekit api, ...
# ask-ai
d
I have deployed my voice agent using livekit api, how do i intiate a outbound call from this voice agent which is connected with twilio sip truck from livekit api
t
Thanks for reaching out, Harsha. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Ready to make an outbound call from your voice agent using the LiveKit API with a Twilio SIP trunk? Let me walk you through it step-by-step: 1. Set Up Your Twilio SIP Trunk: First, create a SIP trunk in Twilio with a domain ending in
.pstn.twilio.com
. Don’t forget to configure authentication and link your Twilio phone number to this trunk. 2. Register the Outbound Trunk in LiveKit: Next, use the LiveKit CLI to set up your outbound trunk configuration. Keep the
SIPTrunkID
you get—it’ll come in handy soon! 3. Create Your Voice Agent: Use the LiveKit CLI to create a voice agent template or pick one from the examples (Python or Node.js work great). Make sure to include the
SIPTrunkID
during setup. 4. Make the Outbound Call: Now, use the
CreateSIPParticipant
API to place your call. Here’s a quick Python example:
Copy code
await ctx.api.sip.create_sip_participant(    api.CreateSIPParticipantRequest(        room_name=ctx.room.name,        sip_trunk_id='ST_xxxx',  # Your outbound trunk ID        sip_call_to='+1234567890',  # Number to call        participant_identity='caller',        wait_until_answered=True    ))
If you prefer, you can also start a call right from the CLI by creating a
sip-participant.json
file and running the right command. For all the nitty-gritty details, check out the Voice AI telephony guide. I’m here if you need any help along the way! Sources: Create and configure a Twilio SIP trunk | LiveKit Docs | packages/sip--make-a-call/src/make-call.ts | agent.py | Agents telephony integration | LiveKit Docs | Making outbound calls | LiveKit Docs