<@U07FRRZH2GN> can you tell me how the inbound cal...
# ask-ai
f
@icy-policeman-64898 can you tell me how the inbound call flow works, end to end
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.
Here’s a quick rundown of how the inbound call flow works in LiveKit: 1. Call Initiation: Someone dials a phone number tied to your SIP trunking provider, which then sends an INVITE request to LiveKit SIP. 2. Authentication and Authorization: LiveKit SIP checks the call using your configured credentials and looks for a matching dispatch rule. If something doesn’t match or the rule isn’t found, the call gets rejected. 3. Call Routing and Room Creation: Once authenticated, a SIP participant is created, and the caller is placed into a LiveKit room according to the dispatch rule. Other participants might join too, depending on that rule. 4. Caller Interaction: The caller will hear a dial tone until someone else joins and starts speaking. If a PIN is needed, they’ll be asked to enter it. To get this set up, you’ll need: • A SIP trunking provider (like Twilio or Telnyx) that’s set up to send SIP traffic to LiveKit SIP. • LiveKit SIP configured with an inbound trunk and dispatch rules to route calls into rooms. • Optionally, an AI voice agent to help handle calls if you want. If you want me to walk you through any part of this or have questions, just let me know—I’m here to help! Sources: Accepting inbound calls | LiveKit Docs | pkg/sip/inbound.go | Inbound calls with Twilio Voice | LiveKit Docs | Inbound calls with Twilio Voice | LiveKit Docs | Accepting incoming calls | LiveKit Docs
f
how will the agent know that a new call is comming in?
t
When a new call comes in, here’s how the agent gets notified: 1. New Room Creation: A fresh LiveKit room is set up just for that incoming call. 2. Dispatch Rules: The SIP service checks its dispatch rules, and if it finds a match, it assigns the agent mentioned in the rule to the room. 3. Agent Notification: The LiveKit framework lets the agent know by creating an instance of the agent and adding them to the room. 4. Room Connection: The agent then connects to the room and can start chatting with the caller right away. This way, the agent is always in the loop and ready to help. If you want me to explain anything in more detail, just let me know! Sources: Accepting inbound calls | LiveKit Docs | README.md | agent.py | packages/sip--um-actually/README.md
f
commad to delte exisitnfg sip trunk and create a new inboound sip trunk
t
If you want to delete an existing SIP trunk and set up a new inbound SIP trunk, here’s a simple way to do it: 1. Delete an existing SIP trunk:
lk sip inbound delete <trunk-id>
Just swap out
<trunk-id>
with the ID of the SIP trunk you want to remove. 2. Create a new inbound SIP trunk:
lk sip inbound create --name <name> --numbers <numbers> --media-enc <encryption> --auth-user <username> --auth-pass <password>
Here’s what to replace: ◦
<name>
with a friendly name for your trunk. ◦
<numbers>
with the list of numbers you want to use. ◦
<encryption>
with the type of media encryption you prefer (like
SRTP
). ◦
<username>
with your authentication username. ◦
<password>
with your authentication password. Here’s a quick example to get you started:
Copy code
lk sip inbound create --name "MyInboundTrunk" --numbers "+1234567890" --media-enc SRTP --auth-user "sipuser" --auth-pass "sipsecret"
If you have any questions or need a hand with this, just let me know—I’m here to help!