Introduction
LiveKit SIP bridges the gap between traditional telephony and modern digital communication. It enables seamless interaction between traditional phone systems and LiveKit rooms.
Key features include:
- Dial-In: Accept incoming calls from phone numbers directly into a LiveKit room.
- Dial-Out via API: Initiate calls to phone numbers using an API.
- DTMF Tone Transmission: Send and receive Dual-tone multi-frequency (DTMF) signals during calls.
In order to use LiveKit SIP, you need to provide a SIP trunk provider. We've tested with Twilio and Telnyx.
For LiveKit Cloud customers, SIP is ready to use with your project without additional configuration. When self-hosting LiveKit, SIP service needs to be deployed separately.
See SIP Quickstart for a guided tutorial.
Concepts
LiveKit SIP is built around three core concepts. These concepts are represented by objects created through the API and affect how your calls are handled.
Trunks
SIP Trunks are used to authenticated SIP traffic in and out. An Inbound Trunk can be configured to accept traffic from certain IPs or phone numbers. An Outbound Trunk is where outbound call configuration is set.
Dispatch Rules
Dispatch Rules control how inbound calls are handled and determine which room a call is placed into. Calls can be placed into rooms directly or be prompted for PINs. The logic of SIP Dispatch Rules can be influenced by call attributes, such as the calling number and the called number.
SIP Participants
A SIP Participant represents an active SIP session. For each inbound call, a SIP Participant is created automatically. To start an outbound call, use the CreateSIPParticipant
to create a SIP Participant. You can disconnect or send DTMF to SIP Participants at any time.
Service architecture
Workflow
Inbound SIP
Steps required to accept an inbound SIP call.
- SIP Trunk Provider setup
- LiveKit SIP configuration
- Create an Inbound Trunk via API (or CLI) to accept your inbound SIP Traffic. The phone number(s) associated with the Trunk will accept calls from the user.
- Create a Dispatch Rule via the LiveKit CLI to route your inbound SIP traffic to a LiveKit Room
- Accepting a call
- Users calls the phone number registered via your SIP Trunk Provider
- SIP Trunk Provider makes the connection to the LiveKit SIP instance
- LiveKit SIP authenticates the inbound call from the
SIP Inbound Trunk
you created - LiveKit SIP routes the inbound call according to the
SIP Dispatch Rule
you created - LiveKit SIP joins the LiveKit room and makes the phone call available as a LiveKit room participant
Outbound SIP
Steps required to make an outbound SIP call.
- SIP Trunk Provider setup
- LiveKit SIP configuration
- Create an Outbound Trunk via API (or CLI). The phone number(s) associated with the Trunk will be used to dial out to the user.
- Making a call
- Create a SIP Participant with the user's phone number via API (or CLI) to make your outbound call
- LiveKit SIP sends an
INVITE
to your SIP Provider - If the SIP Provider accepts, the LiveKit SIP joins the LiveKit room and makes the phone call available as a LiveKit room participant
What's next
Give it a try yourself with our SIP Quickstart guide.