Right now, within my project, using Twilio, I'm ab...
# ask-ai
f
Right now, within my project, using Twilio, I'm able to make outbound calls. So when I run srparticipant.json file, it is calling the phone number that I've mentioned. But how do I accept incoming calls? How do I make my agent accept incoming calls? How do I set that up? @icy-policeman-64898
t
Thanks for reaching out, Abhishek. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're already set for outbound calls — to accept incoming Twilio calls and have your agent answer them, do these steps: 1. Configure Twilio to forward incoming calls to LiveKit • If using Elastic SIP Trunking: add an Origination URL pointing to
sip:<your-project-domain>.sip.livekit.cloud
, enable TLS transport and SRTP. • Or use a TwiML Bin that dials your LiveKit SIP URI and assign it to your Twilio number. (See: Inbound calls with Twilio Voice.) 1. Create a LiveKit inbound trunk that maps your Twilio number to LiveKit • Example trunk JSON includes the Twilio number and, if needed,
auth_username
/
auth_password
. • Create it with
lk sip inbound create <file>
. (See: SIP inbound trunk.) 1. Create a dispatch rule to route incoming calls to rooms and agents • Dispatch rules can create rooms with a prefix (e.g.,
call-
) and list the agent(s) to dispatch. • Create with
lk sip dispatch create <file>
. (See: Agents telephony integration.) 1. Ensure your agent is configured for explicit dispatch • Give the agent a matching name in code (e.g.,
agent_name: "my-agent"
) so the dispatch rule can start that agent when calls arrive. 1. Test the flow • Call your Twilio number → Twilio forwards to LiveKit → inbound trunk matches the number → dispatch rule creates room and starts agent → agent joins and answers. Quick troubleshooting tips: • If agent doesn’t answer: confirm the agent name in code matches the dispatch rule. • If call is rejected: verify SIP URI format and TLS on Twilio. • If no audio: check SRTP/codec settings and trunk noise-cancellation options. If you want, tell me: • Which Twilio method you plan to use (Elastic SIP Trunking or TwiML), and • Your agent name (as defined in code), and I’ll give the exact example config snippets you can drop into your setup. Sources: Secure trunking | LiveKit docs | Inbound calls with Twilio Voice | LiveKit docs | SIP inbound trunk | LiveKit docs | Agents telephony integration | LiveKit docs | SIP participant | LiveKit docs