How the LiveKit SIP Service works
mainThe LiveKit SIP service acts as a bridge between WebRTC sessions and telephony networks using SIP Trunking. It allows you to bring SIP traffic into a LiveKit room, enabling features like dialing out (sending INVITEs), dialing in (accepting INVITEs), digest authentication, and DTMF (touch tone) support.
Inbound Call Workflow
To accept inbound calls, you must follow these steps:
- Create an SIP Trunk using the
CreateSIPTrunkAPI (via LiveKit server). - Create an SIP Dispatch Rule using the
CreateSIPDispatchRuleAPI (via LiveKit server). - When a call is received, the SIP service connects to the specified LiveKit room, and the SIP caller joins as a participant.
Service Architecture
The SIP service communicates with the LiveKit server via Redis, which is also used to store SIP session state. Note that the SIP service must expose a public IP address to allow remote SIP peers to connect.