> ## Documentation Index
> Fetch the complete documentation index at: https://www.vobiz.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LiveKit + Vobiz SIP Trunking | Real-Time AI Voice Calls India

> LiveKit connects to Vobiz SIP trunking for real-time AI voice agents - inbound and outbound calling across 130+ countries with dispatch rules and trunk setup.

[LiveKit + Vobiz Integration Tutorial](https://www.youtube.com/embed/SsutaAit-_M)

## Overview

Time to complete\~15 minutes

DifficultyBeginner-Friendly (No Code)

GoalConnect 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](https://console.vobiz.ai/signup)

**LiveKit Account** with project → [Sign up](https://cloud.livekit.io)

**LiveKit AI Agent** built → [LiveKit Agents docs](https://docs.livekit.io/agents)

## Part 1: Vobiz setup

Create a SIP trunk

![SIP Trunk Overview](https://mintcdn.com/vobizai/OZ7y9Kg025aXyvCH/images/console-new-ui/create-trunk-1.png?fit=max\&auto=format\&n=OZ7y9Kg025aXyvCH\&q=85\&s=1006cb5a3a7f0e70da03cc4f1d63b94d)

1. Log in to the [Vobiz Console](https://console.vobiz.ai)

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](https://mintcdn.com/vobizai/OZ7y9Kg025aXyvCH/images/console-new-ui/create-trunk-2.png?fit=max\&auto=format\&n=OZ7y9Kg025aXyvCH\&q=85\&s=e9358157b58810712f69d92c53e30498)

After creating the trunk, copy your credentials from the **Authentication & Linking** section:

| Field | Value |
| - | - |
| SIP Domain (Gateway URL) | `<your_unique_domain>.sip.vobiz.ai` |
| Username | `<your_username>` |
| Password | `<your_password>` |

> [!TIP]
>
> You now have a dedicated bridge ready for voice traffic.

> [!TIP]
>
> 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](https://www.vobiz.ai/docs/account-phone-number.md).

## Part 2: LiveKit setup

Get LiveKit credentials

1. Go to the [LiveKit Cloud Dashboard](https://cloud.livekit.io) and select your project.

2. Go to **Settings > API Keys**.

3. You need these three values:

   | Variable | Where to find |
   | - | - |
   | `LIVEKIT_URL` | Settings > General |
   | `LIVEKIT_API_KEY` | Settings > API Keys |
   | `LIVEKIT_API_SECRET` | Settings > API Keys |

```bash .env theme={null}
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=APIxxxxxxxxxxxxx
LIVEKIT_API_SECRET=secretxxxxxxxxxx
```

## Part 3: Connect LiveKit to Vobiz (outbound)

> [!NOTE]
>
> For a complete working example, see the [LiveKit Vobiz Outbound Repository](https://github.com/vobiz-ai/LiveKit-Vobiz-Outbound).

Initialize the LiveKit API client

```python theme={null}
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:

```python theme={null}
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
```

> [!TIP]
>
> Your LiveKit project is now securely linked to the Vobiz network.

Field mapping from Vobiz → LiveKit:

| Vobiz field | LiveKit field |
| - | - |
| `sip_domain` | `address` |
| `username` | `auth_username` |
| `password` | `auth_password` |
| Your phone number | `numbers` (array) |

## Part 4: Make outbound calls

```python theme={null}
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

> [!NOTE]
>
> For a complete working example, see the [LiveKit Vobiz Inbound Repository](https://github.com/vobiz-ai/Livekit-vobiz-inbound).

1. In the [LiveKit Cloud Dashboard](https://cloud.livekit.io), go to **Settings > Project** and find the **SIP URI** field.

   ```text theme={null}
   sip:your-sip-uri.sip.livekit.cloud
   ```

2. Update your Vobiz trunk to route inbound calls to LiveKit. See [Update Trunk](https://www.vobiz.ai/docs/trunks.md).

   > [!WARNING]
   >
   > 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`.

   ```bash theme={null}
   PATCH https://api.vobiz.ai/api/v1/Account/{auth_id}/trunks/{trunk_id}
   ```

   ```json theme={null}
   {
     "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

| Error | Cause | Solution |
| - | - | - |
| Status 500 (Max Auth Retry) | Incorrect SIP credentials | Run `python setup_trunk.py` again to update credentials |
| Status 408 (Timeout) | Invalid SIP URI or blocked | Ensure `VOBIZ_SIP_DOMAIN` is set in `.env`. Verify "Call Transfer (SIP REFER)" is enabled |
| Status 400 (Invalid argument) | Destination is not a URI | Update code - `sip:` prefix and `@domain` are now added automatically |
| Disconnects but no ring | Transfer succeeded, destination failed | Check 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](https://console.vobiz.ai) under Trunks
* Ensure the LiveKit trunk uses the same credentials

**Insufficient balance:**

* Check your balance at [Vobiz Console](https://console.vobiz.ai) and top up if needed

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

| Credential | Where to get | Used for |
| - | - | - |
| Vobiz `sip_domain` | Vobiz trunk response | LiveKit trunk `address` |
| Vobiz `username` | Vobiz trunk response | LiveKit trunk `auth_username` |
| Vobiz `password` | Vobiz trunk response | LiveKit trunk `auth_password` |
| Vobiz phone number | Vobiz Numbers API | LiveKit trunk `numbers` |
| LiveKit SIP URI | LiveKit Settings | Vobiz `inbound_destination` |
| LiveKit trunk ID | After creating trunk | Making calls |

Common errors

| Error | Cause | Fix |
| - | - | - |
| 401 Unauthorized | Credentials mismatch | Verify Vobiz username/password |
| Call fails silently | Wrong address | Use exact Vobiz `sip_domain` |
| Insufficient balance | Low credits | Add funds in Vobiz Console |
| Inbound disconnects | Wrong `inbound_destination` | Remove `sip:` prefix |
| Agent doesn't join | Missing agent dispatch | Configure agent name in dispatch rule |

## Resources

**Vobiz**

* [SIP Trunks](https://www.vobiz.ai/docs/trunks.md)
* [Phone Numbers](https://www.vobiz.ai/docs/account-phone-number/list-account-phone-numbers.md)
* [Balance & Billing](https://www.vobiz.ai/docs/account/balance.md)
* [Console](https://console.vobiz.ai)

**LiveKit**

* [LiveKit Agents](https://docs.livekit.io/agents)
* [SIP Integration](https://docs.livekit.io/sip)
* [Python SDK](https://docs.livekit.io/client-sdk-python)

**Example repositories**

* [Inbound starter](https://github.com/vobiz-ai/Livekit-vobiz-inbound)
* [Outbound & transfer starter](https://github.com/vobiz-ai/LiveKit-Vobiz-Outbound)

**Support**

* Vobiz: [support@vobiz.ai](mailto:support@vobiz.ai)
* LiveKit: [LiveKit docs](https://docs.livekit.io/intro/overview/)

> [!TIP]
>
> **Integration complete!**
>
> Your LiveKit agents can now make and receive calls through Vobiz.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.