i can see the inbound call received on the livekit...
# ask-ai
s
i can see the inbound call received on the livekit cloud but it does not to dispatch to agent, i have the trunk created and its dispatch rule.
t
Thanks for reaching out, Youssef. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's work together to resolve the issue of inbound calls not dispatching to an agent. Please take a moment to check the following: 1. Agent Name Matching: Make sure the
agent_name
in the agent worker's
WorkerOptions
exactly matches the
room_config.agent.agent_name
in the dispatch rule. This little detail is often the key! 2. Trunk and Dispatch Rule Association: Double-check that the dispatch rule points to the correct
trunkIds
for the inbound trunk receiving calls. If this is left out, the rule will apply to all trunks, which might not be what you want. 3. SIP Authentication: Please verify that the
auth_username
and
auth_password
in your trunk configuration match the credentials provided by your SIP provider. If you’re using IP-based authentication, ensure the
allowed_addresses
includes your SIP provider’s IP range. 4. Call Routing: Check that the inbound trunk has the right phone number and that your SIP provider is routing calls to LiveKit’s SIP endpoint on port 5060 (UDP). This helps keep the calls flowing smoothly. 5. Logs and Debugging: You can use the LiveKit CLI or Inspector to see if the inbound call is being received, confirm trunk authentication is successful, and verify that the agent is launched into the room. If any of these steps feel tricky or if you want me to walk you through them, just let me know. I’m here to help you every step of the way! Sources: SIP troubleshooting guide | LiveKit Docs | SIP dispatch rule | LiveKit Docs | src/setup-livekit.ts | protobufs/livekit_sip.proto | README.md
s
how can i inspect this?
t
I'm here to help you with inspecting inbound call issues in LiveKit. You can try the following tools and methods to get a clearer picture: 1. LiveKit CLI: This is a handy tool to list and check your resources. For example: `livekit-cli list-sip-trunkslivekit-cli list-sip-dispatch-rules`These commands will allow you to verify how your trunks and dispatch rules are set up. 2. LiveKit Inspector: The Inspector is great for monitoring logs and events. You might want to look out for: ◦ Inbound
INVITE
requests coming from your SIP provider. ◦ Whether the trunk authentication was successful. ◦ Creation of a SIP participant and room. ◦ When the agent launches into the room. 1. Logs: Taking a look at the logs can help confirm that the call is routed properly and that the agent is matched and launched into the room as expected. If you'd like, I’m more than happy to walk you through using these tools or help interpret what you find. Just let me know!
s
Please walk me through debugging and inspecting the logs
t
Let’s work together to debug and inspect logs so we can get to the bottom of the issue with your inbound calls: 1. Verify Trunk Configuration: You can start by running this command to list your SIP trunks and make sure the correct trunk is set up with the expected phone number: `livekit-cli list-sip-trunks`Take a moment to check that the trunk includes the phone number receiving the call and that the authentication details look right. 2. Check Dispatch Rules: Next, run this command to list your dispatch rules and confirm the correct rule is linked to your trunk: `livekit-cli list-sip-dispatch-rules`Make sure the
trunkIds
in the rule match your trunk, and that the
room_config.agent.agent_name
matches your agent worker’s name. 3. Monitor Logs: You can use the LiveKit Inspector or CLI logs to follow the call flow: ◦ Look out for the inbound
INVITE
request coming from your SIP provider. ◦ Check that trunk authentication goes through successfully. ◦ See if a SIP participant is created and a room is generated. ◦ Confirm that the agent is launched into the room. 1. Inspect Specific Errors: If you come across errors like
403 Forbidden
or
404 Not Found
, these often point to authentication issues or configuration mismatches. Please feel free to share any specific errors you see—I’m here to help interpret them with you. Give these steps a try, and whenever you’re ready, share what you find or any errors you encounter. I’m here to support you every step of the way!
s
what are the cli command to insoect
t
I'd love to help you get a clear view of your configuration! Here are some handy CLI commands you can use to check things out: 1. List SIP Trunks: This command will show you all the SIP trunks you have set up along with their details:
livekit-cli list-sip-trunks
2. List Dispatch Rules: If you want to take a look at your dispatch rules and how they’re configured, try this:
livekit-cli list-sip-dispatch-rules
These should give you a good snapshot of your trunks and dispatch rules. If you’d like, I’m here to help you understand what you see or troubleshoot any specific issues—just let me know!