Skip to main content

How do I set up a SIP trunk for a LiveKit-based voice AI project?

LiveKit uses SIP trunking to connect phone calls to LiveKit rooms where AI agents are running. To set up Vobiz as the SIP trunk for a LiveKit project: create a Vobiz SIP trunk, configure a LiveKit SIP Trunk resource pointing to Vobiz’s SIP domain, and define a SIP Dispatch Rule to route inbound calls to your AI agent’s room. Outbound calls are initiated via the LiveKit API with Vobiz as the carrier.

Architecture: How LiveKit + Vobiz Works

When a call arrives at a Vobiz phone number, Vobiz sends SIP INVITE to LiveKit’s SIP server. LiveKit creates a SIP Participant in the specified room. Your AI Agent (running in the same room) receives the audio track, processes it, and publishes its audio response — which LiveKit delivers back to the caller via Vobiz. For outbound calls, your code uses the LiveKit API to create an outbound SIP Participant, which triggers Vobiz to dial the destination number.

Setup: Inbound Calls (PSTN → LiveKit Agent)

Step 1 — Provision a Vobiz Phone Number

Step 2 — Note Your Vobiz SIP Domain

Your Vobiz SIP trunk domain and credentials are available in the console under SIP Trunks. The SIP domain format is:

Step 3 — Create a LiveKit SIP Trunk Resource

Using the LiveKit CLI or API, create an Inbound SIP Trunk pointing to Vobiz:

Step 4 — Create a SIP Dispatch Rule

A Dispatch Rule tells LiveKit which room to route an inbound call to:
This routes every inbound call to a unique room (call-{call_uuid}). Your AI Agent process should be watching for new rooms matching this prefix.

Step 5 — Point the Vobiz Number at LiveKit’s SIP Server

In the Vobiz console, create an Application and set the Answer URL to point to LiveKit’s SIP endpoint. Use SIP application type and enter LiveKit’s SIP server URI from your LiveKit project settings.

Setup: Outbound Calls (LiveKit Agent → PSTN)

Create an Outbound SIP Trunk in LiveKit that uses Vobiz for outbound dialling:
Then initiate outbound calls from your AI agent code:

Audio Configuration

LiveKit uses Opus audio by default. Vobiz transcodes between Opus (LiveKit internal) and G.711 PCMU (PSTN) automatically. For the lowest latency, select the Mumbai media region for your Vobiz SIP trunk if your LiveKit infrastructure runs in AWS ap-south-1.

Frequently Asked Questions

Yes. Vobiz is a standard SIP provider — LiveKit’s SIP Bridge connects to Vobiz using standard SIP over TLS with SRTP media. No Vobiz-specific configuration is required beyond providing your SIP trunk URI and credentials to LiveKit.
Yes. Configure both an Inbound SIP Trunk (for receiving calls) and an Outbound SIP Trunk (for making calls) in LiveKit, both using the same Vobiz SIP credentials. The same DID number is used as the caller ID for outbound calls.
In the Vobiz console, navigate to SIP Trunks > Create Trunk. After creation, the dashboard shows your SIP domain, username, and password. These are the credentials you enter into LiveKit’s SIP Trunk configuration.
With the Mumbai media PoP on Vobiz and a LiveKit server running in AWS ap-south-1, telephony RTT is typically 40–80ms. LiveKit’s internal audio processing adds minimal overhead. See Low Latency Voice AI for tuning guidance.