Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Time to complete
~15 minutes
Difficulty
Beginner-Friendly (No Code)
Goal
Connect AI to a real phone
This guide shows how to integrate LiveKit with Vobiz to enable outbound calling and inbound answering for your AI agents.
Integration flow:
OUTBOUND
Your App
LiveKit
Vobiz
Phone Network
INBOUND
Phone Network
Vobiz
LiveKit
AI Agent

Prerequisites

Before you start:
Vobiz Account with active balance → Create account
LiveKit Account with project → Sign up
LiveKit AI Agent built → LiveKit Agents docs

Part 1: Vobiz setup

Create a SIP trunk
SIP Trunk Overview
  1. Log in to the Vobiz Console
  2. In the left sidebar, navigate to SIP Trunk > Outbound Trunks > Trunks
  3. Click + Create Trunk
  4. Enter a Trunk Name (for example, “LiveKit Integration”) and an optional Description
  5. Under Authentication & Linking, select a Credential from the Credentials List (or click + Create New Credential if you don’t have one)
  6. Click + Create Trunk at the bottom right to save
Trunk Details After creating the trunk, copy your credentials from the Authentication & Linking section:
FieldValue
SIP Domain (Gateway URL)<your_unique_domain>.sip.vobiz.ai
Username<your_username>
Password<your_password>
You now have a dedicated bridge ready for voice traffic.
Keep these handy - you’ll paste them into your LiveKit code in Part 3.
Get a phone number
Purchase a phone number for outbound caller ID or inbound calls. See phone numbers.

Part 2: LiveKit setup

Get LiveKit credentials
  1. Go to the LiveKit Cloud Dashboard and select your project.
  2. Go to Settings > API Keys.
  3. You need these three values:
    VariableWhere to find
    LIVEKIT_URLSettings > General
    LIVEKIT_API_KEYSettings > API Keys
    LIVEKIT_API_SECRETSettings > API Keys
.env
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=APIxxxxxxxxxxxxx
LIVEKIT_API_SECRET=secretxxxxxxxxxx

Part 3: Connect LiveKit to Vobiz (outbound)

For a complete working example, see the LiveKit Vobiz Outbound Repository.
Initialize the LiveKit API 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 an outbound trunk
Connect LiveKit to your Vobiz SIP trunk using the credentials from Part 1:
trunk = await lk.sip.create_sip_outbound_trunk(
    livekit_api.CreateSIPOutboundTrunkRequest(
        trunk=livekit_api.SIPOutboundTrunkInfo(
            name="Vobiz Trunk",
            address="YOUR_VOBIZ_SIP_DOMAIN",       # sip_domain from Vobiz
            auth_username="YOUR_VOBIZ_USERNAME",   # username from Vobiz
            auth_password="YOUR_VOBIZ_PASSWORD",   # password from Vobiz
            numbers=["YOUR_PHONE_NUMBER"],         # your Vobiz phone number
        )
    )
)

# Save trunk.sip_trunk_id - you'll need it to make calls
Your LiveKit project is now securely linked to the Vobiz network.
Field mapping from Vobiz → LiveKit:
Vobiz fieldLiveKit field
sip_domainaddress
usernameauth_username
passwordauth_password
Your phone numbernumbers (array)

Part 4: Make outbound calls

participant = await lk.sip.create_sip_participant(
    livekit_api.CreateSIPParticipantRequest(
        sip_trunk_id="YOUR_TRUNK_ID",   # from Part 3
        sip_call_to="+1234567890",      # number to call (E.164)
        room_name="call-room",          # LiveKit room name
    )
)
Call flow:
  1. LiveKit creates the call via Vobiz
  2. The person answers and joins the LiveKit room as a participant
  3. Your AI agent joins the same room
  4. The conversation begins

Part 5: Configure inbound calling

For a complete working example, see the LiveKit Vobiz Inbound Repository.
  1. In the LiveKit Cloud Dashboard, go to Settings > Project and find the SIP URI field.
    sip:your-sip-uri.sip.livekit.cloud
    
  2. Update your Vobiz trunk to route inbound calls to LiveKit. See Update Trunk.
    Remove the sip: prefix when entering the destination in Vobiz. LiveKit shows sip:your-sip-uri.sip.livekit.cloud but you enter your-sip-uri.sip.livekit.cloud.
    PATCH https://api.vobiz.ai/api/v1/account/{auth_id}/trunks/{trunk_id}
    
    {
      "inbound_destination": "your-sip-uri.sip.livekit.cloud"
    }
    
  3. In the LiveKit dashboard, go to Telephony > Trunks and click Create new trunk > Inbound. Configure:
    • Phone Numbers: Your Vobiz number (for example, +918071387434)
    • Allowed Addresses: 0.0.0.0/0 (restrict this in production)
    Click Create and save the Trunk ID.
  4. Go to Telephony > Dispatch Rules and click Create new dispatch rule. Configure:
    • Rule Type: Individual
    • Room Prefix: call-
    • Match Trunks: Select your inbound trunk
    Expand the Agent dispatch section and set Agent Name to voice-assistant (must match your agent exactly). Click Create.

Part 6: SIP call transfer

The LiveKit Voice Agent supports cold transfer via SIP REFER.
  • Say “Transfer me” or “Transfer me to a live agent” → transfers to the default configured number
  • Say “Transfer me to +1 555 000 1234” → transfers to the requested number
The agent constructs the SIP URI (sip:+15550001234@<your-sip-domain>) and initiates the transfer automatically.
Transfer troubleshooting
ErrorCauseSolution
Status 500 (Max Auth Retry)Incorrect SIP credentialsRun python setup_trunk.py again to update credentials
Status 408 (Timeout)Invalid SIP URI or blockedEnsure VOBIZ_SIP_DOMAIN is set in .env. Verify “Call Transfer (SIP REFER)” is enabled
Status 400 (Invalid argument)Destination is not a URIUpdate code - sip: prefix and @domain are now added automatically
Disconnects but no ringTransfer succeeded, destination failedCheck the destination number or SIP provider logs

Troubleshooting

Outbound calls
Call doesn’t connect:
  • Verify address in the LiveKit trunk matches your exact Vobiz sip_domain
  • Check that credentials (auth_username, auth_password) match exactly
  • Common mistake: using sip.vobiz.ai instead of your specific domain
SIP 401 Unauthorized:
  • Verify credentials in Vobiz Console under Trunks
  • Ensure the LiveKit trunk uses the same credentials
Insufficient balance:
Inbound calls
Call disconnects immediately:
  • Confirm inbound_destination has the sip: prefix removed
  • Verify your Vobiz phone number is added to the LiveKit inbound trunk
  • Check that allowed_addresses is set to 0.0.0.0/0 in the LiveKit trunk
Agent doesn’t answer:
  • Confirm the agent is running
  • Verify the dispatch rule has “Agent dispatch” configured
  • Check that the agent name matches exactly (for example, voice-assistant)
  • Confirm the dispatch rule is linked to the correct inbound trunk

Quick reference

Credentials mapping
CredentialWhere to getUsed for
Vobiz sip_domainVobiz trunk responseLiveKit trunk address
Vobiz usernameVobiz trunk responseLiveKit trunk auth_username
Vobiz passwordVobiz 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

Resources

Vobiz LiveKit Example repositories Support
Integration complete!Your LiveKit agents can now make and receive calls through Vobiz.