Boni
Back to blog

Boni Voice

Route Real Indian Phone Calls to Your LiveKit Voice Agent — A Developer's Guide to the Boni Voice LiveKit Connector

Boni Team7 min read

Route Real Indian Phone Calls to Your LiveKit Voice Agent — A Developer's Guide to the Boni Voice LiveKit Connector

You built a LiveKit voice agent. It handles ASR, runs your LLM, synthesises speech, manages turn-taking — the hard parts are done. Then you try to wire a real Indian phone number to it and discover the actual pain: finding a DID provider who sells developer-tier Indian numbers without a corporate agreement, navigating SIP trunk setup, configuring inbound call routing through LiveKit's dispatch rules, handling PSTN-to-WebRTC bridging, staying compliant with TRAI rules, and logging CDRs for billing reconciliation. None of that is your core product. All of it burns weeks.

The Boni Voice LiveKit connector is a pilot service that collapses that operational layer into a managed connector — you get an Indian business DID, inbound calls route to your LiveKit trunk, your agent answers. This guide walks through the problem, what the connector abstracts, how the integration conceptually fits together, and who should care.


The Problem: Indian DID + LiveKit = Operational Mess

LiveKit's SIP stack is excellent. The dispatch rule / trunk model for routing inbound PSTN calls to rooms and agents is clean. The gap is everything before a call reaches your LiveKit instance:

DID provisioning. Indian number providers typically target enterprise buyers. Getting a programmable Indian DID as a developer — especially at low volume, without an entity/KYC process that takes two weeks — is painful. Most providers don't publish APIs. The ones that do are priced for carriers, not startups.

SIP trunking. You need to configure a SIP trunk that bridges the PSTN leg to LiveKit's SIP inbound service. This involves registering trunk credentials with your DID provider, configuring allowed IP ranges, dealing with codec negotiation across PSTN/SIP boundaries, and debugging audio issues with no observability.

Routing logic. Once a call arrives at LiveKit via SIP, you need dispatch rules to decide which room to route to, which agent to spin up, and what to do on failure — voicemail, fallback queue, transfer. Managing this config per-number, per-use-case, adds surface area quickly.

Compliance. Indian telephony has TRAI requirements around commercial communications. A business number in India isn't just technical provisioning — headers, DND scrubbing, and caller ID registration matter.

Logs and billing. CDR logs, call recordings, transcripts — you need these both for billing and for debugging your voice AI. Most DIY approaches stitch this together from disparate sources.

The LiveKit connector addresses this entire surface.


What the Connector Abstracts

At its core, the Boni Voice LiveKit connector is a managed layer sitting between Indian PSTN and your LiveKit deployment:

  • Indian number onboarding — get a DID through the Boni Voice console without a carrier-level agreement. A developer tier is in beta from roughly Rs 500/month. The number is a real Indian business number, usable for inbound voice.
  • Inbound routing to your LiveKit trunk — when a call arrives on your DID, Boni Voice bridges it to a LiveKit SIP inbound trunk you configure. The connector handles the PSTN-SIP leg so you don't manage trunk credentials with the DID provider directly.
  • Dispatch integration — you configure how calls are dispatched inside LiveKit: which room to create, which agent to wake, what metadata to attach to the call participant. The connector passes call metadata (caller number, DID called, timestamp) as LiveKit participant attributes.
  • Fallback handling — if your LiveKit agent is unavailable or dispatch fails, you configure fallback behaviour (voicemail, transfer, busy signal) at the connector level rather than building it into every agent.
  • CDR logs, recordings, transcripts — available through the Boni Voice API and console. This gives you a single source of truth for debugging and billing, separate from what you instrument inside LiveKit.
  • WhatsApp Calling support — the Boni Voice API is designed WhatsApp Calling API-first, so the same number and routing logic can extend to WhatsApp Calling, not just PSTN, when relevant to your use case.

Conceptual Integration Walkthrough

Note: The config shapes and pseudocode below are illustrative. They show the structure of the integration, not authoritative API contracts. Check the current Boni Voice LiveKit docs for exact endpoint documentation and SDK references.

Step 1 — Provision a number

From the Boni Voice console, you provision an Indian DID and note the number ID. At this point Boni handles the carrier relationship, KYC, and DID routing.

# Illustrative: number provisioning via Boni Voice API
POST /voice/numbers/provision
{
  "country": "IN",
  "type": "local",
  "capabilities": ["inbound_voice"]
}
# Response includes: number_id, e164_number, provisioned_at

Step 2 — Register your LiveKit SIP trunk

In your LiveKit instance, you create an inbound SIP trunk. Boni Voice needs the trunk URI and credentials to bridge calls to it.

# Illustrative LiveKit SIP trunk config
sip:
  inbound_trunk:
    name: "boni-voice-inbound"
    numbers:
      - "+91XXXXXXXXXX"
    auth_username: "<trunk-user>"
    auth_password: "<trunk-secret>"

You register this trunk with the Boni Voice connector, linking your number ID to the LiveKit SIP endpoint:

# Illustrative: link number to LiveKit trunk
POST /voice/connectors/livekit
{
  "number_id": "<your-number-id>",
  "livekit": {
    "sip_uri":    "sip.your-livekit-host.example",
    "trunk_id":   "<livekit-trunk-id>",
    "auth_username": "<trunk-user>",
    "auth_password": "<trunk-secret>"
  },
  "fallback": {
    "action": "voicemail",
    "voicemail_webhook": "https://your-app.example/voicemail"
  }
}

Step 3 — Configure LiveKit dispatch

Inside LiveKit, a dispatch rule maps inbound SIP calls to rooms and agents. Your voice AI agent should already be using livekit-agents and registered to handle room events. The dispatch rule targets rooms by the DID or caller pattern:

# Illustrative: LiveKit dispatch rule via Python SDK
await api.sip.create_sip_dispatch_rule(
    CreateSIPDispatchRuleRequest(
        rule=SIPDispatchRule(
            dispatch_rule_individual=SIPDispatchRuleIndividual(
                room_prefix="call-",
            )
        ),
        trunk_ids=["<livekit-trunk-id>"],
        name="boni-inbound-calls",
        attributes={"source": "boni-voice", "did": "+91XXXXXXXXXX"}
    )
)

Step 4 — Your agent answers

When a call arrives, the flow is:

Caller dials +91XXXXXXXXXX
    -> Boni Voice PSTN ingress
    -> Boni bridges to your LiveKit SIP trunk
    -> LiveKit dispatch rule fires -> room created
    -> Your agent worker picks up the room
    -> Agent answers, ASR/LLM/TTS runs
    -> On hangup: Boni logs CDR, recording, transcript

Your agent code doesn't change — it's the same livekit-agents worker you already built. The connector makes the Indian number and routing work without you managing the PSTN leg.


Webhook Events (Illustrative Shape)

Boni Voice fires webhooks for call lifecycle events so your backend can track state:

// Illustrative call.answered event
{
  "event": "call.answered",
  "call_id": "c_xxxxxxxx",
  "number_id": "n_xxxxxxxx",
  "from": "+91YYYYYYYYY",
  "to": "+91XXXXXXXXXX",
  "livekit_room": "call-c_xxxxxxxx",
  "answered_at": "2026-07-15T10:22:05Z"
}

Use these to cross-reference your agent session logs with Boni CDRs for debugging and billing.


Who This Is For

Voice-AI startups building products on top of LiveKit who need Indian numbers without an enterprise carrier agreement and want to ship fast.

Agencies building phone agent solutions for clients — clinics, logistics desks, travel helplines — who need a repeatable provisioning path without custom SIP integration per deployment.

Internal tooling teams at companies that already use Bow Chat / Bow Phone and want phone-AI capability on the same telephony layer.

If you're entirely on a hyperscaler telephony stack with international numbers, the connector is less relevant for now — it's specifically designed for the Indian PSTN context.


Pilot Status and Open Source

The LiveKit connector is in pilot. That means early access, limited number inventory, and API surfaces that may change before GA. Boni is planning to open-source the connector, which means you'll be able to inspect the bridging logic, run a self-hosted variant, and contribute dispatch patterns once the OSS release lands.

For current access, pricing, and documentation, and to talk to the team directly, reach out via boni.one/apis/voice.


Summary

If you've already done the hard work of building a LiveKit voice agent, the remaining obstacle is real-world telephony — especially for Indian numbers. The Boni Voice LiveKit connector handles DID provisioning, PSTN-SIP bridging, routing, logs, and fallback so your agent code stays focused on the AI layer. It's in pilot, scoped to Indian business numbers, and built by the same team behind Boni's broader voice API platform.

Check the docs, provision a test number, wire it to your existing LiveKit trunk, and see how far you get before you have to touch SIP config. That's the point.

Boni VoiceVoice APILiveKitDevelopers

Next step

Bring Boni into your business.

Talk to Boni