LiveKit + Vobiz Integration Guide

Connect your LiveKit AI voice agents to Vobiz SIP infrastructure for phone calling capabilities.

Overview

This guide shows how to integrate LiveKit with Vobiz to enable:

  • Outbound calling - AI agents can call any phone number
  • Inbound calling - AI agents can answer calls to your Vobiz numbers

Integration flow:

Call Flow
Outbound: Your App → LiveKit → Vobiz → Phone Network
Inbound:  Phone Network → Vobiz → LiveKit → AI Agent

Prerequisites

Before starting:

Part 1: Vobiz Setup

Create SIP Trunk

Create a SIP trunk in Vobiz to handle voice traffic.

See: Vobiz SIP Trunks Documentation

Save these values from the response:

  • sip_domain (e.g., 5f3a607b.sip.vobiz.ai)
  • username
  • password

You'll need them for LiveKit configuration.

Get Phone Number

Purchase a phone number for outbound caller ID or inbound calls.

See: Vobiz Phone Numbers Documentation

Part 2: LiveKit Setup

Get LiveKit Credentials

  1. Go to LiveKit Cloud Dashboard
  2. Select your project
  3. Navigate to SettingsKeys
  4. Copy these values:
CredentialWhere to Find
LIVEKIT_URLSettings → Project URL
LIVEKIT_API_KEYSettings → Keys → API Key
LIVEKIT_API_SECRETSettings → Keys → Secret Key
Example
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=APIxxxxxxxxxxxxx
LIVEKIT_API_SECRET=secretxxxxxxxxxx

Part 3: Connect LiveKit to Vobiz (Outbound)

Initialize LiveKit API Client

Initialize LiveKit Client
from livekit import api as livekit_api

lk = livekit_api.LiveKitAPI(
    url="YOUR_LIVEKIT_URL",
    api_key="YOUR_LIVEKIT_API_KEY",
    api_secret="YOUR_LIVEKIT_API_SECRET"
)

Create Outbound Trunk

Connect LiveKit to your Vobiz SIP trunk:

Create Outbound Trunk
trunk = await lk.sip.create_sip_outbound_trunk(
    livekit_api.CreateSIPOutboundTrunkRequest(
        trunk=livekit_api.SIPOutboundTrunkInfo(
            name="Vobiz Trunk",
            address="YOUR_VOBIZ_SIP_DOMAIN",      # From Vobiz trunk response
            auth_username="YOUR_VOBIZ_USERNAME",  # From Vobiz trunk response
            auth_password="YOUR_VOBIZ_PASSWORD",  # From Vobiz trunk response
            numbers=["YOUR_PHONE_NUMBER"]         # Your Vobiz phone number
        )
    )
)

# Save trunk.sip_trunk_id - you'll need it for making calls

Field Mapping:

Vobiz FieldLiveKit Field
sip_domainaddress
usernameauth_username
passwordauth_password
Your phone numbernumbers (array)

Part 4: Make Outbound Calls

Create Outbound Call
participant = await lk.sip.create_sip_participant(
    livekit_api.CreateSIPParticipantRequest(
        sip_trunk_id="YOUR_TRUNK_ID",         # From previous step
        sip_call_to="+1234567890",            # Number to call (E.164 format)
        room_name="call-room"                 # LiveKit room name
    )
)

Call flow:

  1. LiveKit creates the call via Vobiz
  2. Person answers → joins LiveKit room as participant
  3. Your AI agent joins the same room
  4. Conversation begins

Part 5: Configure Inbound Calling

Step 1: Get LiveKit SIP URI

  1. Go to LiveKit Cloud Dashboard
  2. Select your project
  3. Go to SettingsProject
  4. Find SIP URI field
Example
sip:your-project-id.sip.livekit.cloud

Step 2: Update Vobiz Trunk Inbound Destination

Update your Vobiz trunk to route calls to LiveKit.

See: Vobiz Update Trunk Documentation

CRITICAL: Remove the sip: prefix when configuring Vobiz!

What LiveKit ShowsWhat to Enter in Vobiz
sip:project-id.sip.livekit.cloudproject-id.sip.livekit.cloud
API Example
PATCH https://api.vobiz.ai/v1/account/{accountId}/trunks/{trunkId}
Request Body
{
  "inbound_destination": "project-id.sip.livekit.cloud"
}

Step 3: Create LiveKit Inbound Trunk

Via LiveKit Dashboard (Recommended):

  1. Go to TelephonyTrunks
  2. Click Create new trunkInbound
  3. Configure:
    • Phone Numbers: Your Vobiz number (e.g., +918071387434)
    • Allowed Addresses: 0.0.0.0/0 (restrict in production)
  4. Click Create
  5. Save the Trunk ID

Step 4: Create Dispatch Rule

Configure LiveKit to auto-spawn your AI agent when calls arrive.

Via LiveKit Dashboard:

  1. Go to TelephonyDispatch Rules
  2. Click Create new dispatch rule
  3. Configure:
    • Rule Type: Individual
    • Room Prefix: call-
    • Match Trunks: Select your inbound trunk
  4. Expand "Agent dispatch" section
  5. Set Agent Name: voice-assistant (must match your agent)
  6. Click Create

Troubleshooting

Outbound Calls

Call Doesn't Connect

Check:

  • address in LiveKit trunk matches your exact Vobiz sip_domain
  • Credentials (auth_username, auth_password) match exactly
  • Common mistake: Using generic sip.vobiz.ai instead of your specific domain

SIP 401 Unauthorized

  • Verify credentials in Vobiz Console → Trunks
  • Ensure LiveKit trunk has matching credentials

Insufficient Balance

Inbound Calls

Call Disconnects Immediately

Check:

  1. Vobiz inbound_destination has sip: prefix removed
  2. Vobiz phone number added to LiveKit inbound trunk
  3. allowed_addresses set to 0.0.0.0/0 in LiveKit trunk

Agent Doesn't Answer

Check:

  1. Agent is running
  2. Dispatch rule has "Agent dispatch" configured
  3. Agent name matches exactly (e.g., voice-assistant)
  4. Dispatch rule linked to correct inbound trunk

Quick Reference

Required Credentials

WhatWhere to GetUsed For
Vobiz sip_domainVobiz API trunk responseLiveKit trunk address
Vobiz usernameVobiz API trunk responseLiveKit trunk auth_username
Vobiz passwordVobiz API trunk responseLiveKit trunk auth_password
Vobiz phone numberVobiz Numbers APILiveKit trunk numbers
LiveKit SIP URILiveKit SettingsVobiz inbound_destination
LiveKit trunk IDAfter creating trunkMaking calls

Common Errors

ErrorCauseFix
401 UnauthorizedCredentials mismatchVerify Vobiz username/password
Call fails silentlyWrong addressUse exact Vobiz sip_domain
Insufficient balanceLow creditsAdd funds in Vobiz console
Inbound disconnectsWrong inbound_destinationRemove sip: prefix
Agent doesn't joinMissing agent dispatchConfigure agent name in dispatch rule

Additional Resources

Support

Integration complete!

Your LiveKit agents can now make and receive calls through Vobiz.