I've created outbound trunk in my self hosted live...
# ask-ai
a
I've created outbound trunk in my self hosted livekit server. on Twilio I've set terminate uri to sip:<my ip address> and outbound call goes when I create participant but bot is not getting dispatched in it
t
Thanks for reaching out, Hiren. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you get your bot dispatched smoothly during outbound calls. Let's go through a few key things together: 1. Outbound Trunk Configuration: Please double-check that your outbound trunk is set up correctly with the right Twilio SIP URI (for example,
<project>.pstn.twilio.com
). 2. Authentication: Make sure the
outbound_username
and
outbound_password
exactly match the credentials Twilio provided you. 3. Dispatch Rules: Take a look at your dispatch rules to confirm they're routing calls to the correct room. Also, ensure the
agent_name
in the dispatch rule matches your bot’s configuration. 4. Logs: It’s helpful to review LiveKit and Twilio call logs for any errors, such as incorrect trunk IDs or authentication issues. 5. Agent Status: Please verify that your bot is up and running, connected to the LiveKit server, and that the target room is properly set up. If any of these steps feel tricky or if you want me to walk you through them, just let me know—I’m happy to assist you every step of the way! Sources: pkg/service/ioservice_sip.go | Create and configure a Plivo SIP trunk | LiveKit Docs | lib/livekit/proto/livekit_sip_pb.rb | SIP outbound trunk | LiveKit Docs | test/lktest-sip-outbound/README.md
a
dispatch rule is not applicable for the outbound calls.. right?
t
You’re absolutely right—dispatch rules don’t apply to outbound calls in LiveKit. They’re really meant to help route inbound calls to the right rooms. When it comes to outbound calls, the way to go is using the
CreateSIPParticipant
API. This lets you specify exactly: • The SIP trunk for dialing (
sip_trunk_id
) • The number you want to call (
sip_call_to
) • The LiveKit room where the participant should join (
room_name
) • And any optional participant identity or other settings If your bot isn’t being dispatched as expected, a good step is to double-check that the
room_name
you’re passing in the API matches the room where your bot is actually active. Please feel free to reach out if you’d like me to walk you through this or if there’s anything else you need help with! Sources: protobufs/livekit_sip.proto | SIP overview | LiveKit Docs | SIP dispatch rule | LiveKit Docs
a
my agent is running on that ip address url .. without name.. so it should be dispatched, but no agent is talking to that outbound call I'm making using "lk sip participant create participant-test.json" command
t
I'm here to help you get your agent responding smoothly to outbound calls. Let's walk through a few things together: 1. Agent Readiness: Please make sure your agent is fully connected to the room either before or at the same time as the call. If the agent connects too late, they might miss the interaction. 2. Call Status: Keep an eye on the
sip.callStatus
attribute for the SIP participant. Ideally, it should move to
active
. If it stays at
dialing
or
ringing
, there might be a hiccup with the trunk or how the destination is set up. 3. Error Logs: It’s a good idea to capture and review any errors from the
lk sip participant create
command. Common issues often involve authentication problems or invalid trunk IDs. 4. Trunk Configuration: Double-check that your outbound trunk is set up correctly—with valid credentials, a provisioned phone number, and the right routing permissions. 5. Synchronization: Try using the
wait_until_answered
option in the API. This helps ensure the call is fully connected before your agent starts interacting. 6. Phone Number Format: Lastly, please confirm that the destination number is in E.164 format (for example,
+1234567890
). If any of these steps feel unclear or if you’d like me to walk you through them in more detail, just let me know—I’m here to support you! Sources: agent.py | packages/sip--make-a-call/src/make-call.ts | SIP participant | LiveKit Docs | Making outbound calls | LiveKit Docs | cmd/lk/sip.go