Inbound call workflow
When an inbound call is received, your SIP trunking provider sends a text-based INVITE request to LiveKit SIP. The SIP service checks authorization credentials configured for the LiveKit trunk with the credentials configured on your provider's SIP trunk and looks for a matching dispatch rule. If there's a matching dispatch rule, a SIP participant is created for the caller and put into a LiveKit room.
Depending on the dispatch rule, other participants (for example, a voice agent or other users) might join the room.
User dials the SIP trunking provider phone number.
SIP trunking provider connects caller to LiveKit SIP.
LiveKit SIP authenticates the trunk credentials and finds a matching dispatch rule.
LiveKit server creates a SIP participant for the caller and places them in a LiveKit room (per the dispatch rule).
User hears dial tone until LiveKit SIP responds to the call:
If the dispatch rule has a pin, prompts the user with "Please enter room pin and press hash to confirm."
- Incorrect pin: "No room matched the pin you entered." Call is disconnected with a tone.
- Correct pin: "Entering room now."
User continues to hear a dial tone until another participant publishes tracks to the room.
Setup for accepting calls
The following are required to accept an inbound SIP call.
SIP trunking provider setup
Purchase a phone number from a SIP provider.
For a list of tested providers, see the table in Using LiveKit SIP.
Configure SIP trunking with the provider to send SIP traffic to your LiveKit SIP instance.
For instructions for setting up a SIP trunk using Twilio or Telnyx, see Configuring a SIP provider trunk.
LiveKit SIP configuration
Create an inbound trunk associated with your SIP provider phone number. You only need to create one inbound trunk for each SIP provider phone number.
Create a dispatch rule. The dispatch rules dictate how SIP participants and LiveKit rooms are created for incoming calls. The rules can include whether a caller needs to enter a pin code to join a room and any custom metadata or attributes to be added to SIP participants.
Next steps
After you've set up your inbound trunk and dispatch rules, follow the quickstart to create an agent that accepts incoming calls.