DvaarikVoice API

Integrations / jambonz

jambonz to an AI voice agent

Put an AI voice agent on your own SIP trunk using jambonz as the media gateway. Setu handles the jambonz dialect and hands the voice engine plain PCM16, including the flush that makes barge-in work.

path /jambonz · 16 kHz by default, set by the verb · written from the vendor's published reference

What jambonz sends and expects

Wire format
Binary PCM16 frames; the first frame is a JSON metadata text frame
Sample rate
16 kHz by default, set by the verb
Flush playback on interruption
{"type":"killAudio"}

Carriers queue seconds of audio ahead of the caller. Without this frame, an interrupted caller keeps hearing a sentence the agent gave up on two seconds ago.

The trap

The flush message is killAudio under a type key — a third naming convention on this list. jambonz also sends its call metadata as the first frame on the socket, so a handler that assumes every text frame is an event will misread the opening one.

Wiring it up

Return a jambonz application that uses the listen verb against the bridge.

1 · run the bridge

your server
export DVAARIK_API_KEY=dvk_live_...
export AGENT_PROMPT="You are Riya, the receptionist at Sunrise Dental."
npx @dvaarik/setu

2 · point jambonz at it

jambonz config
{
  "verb": "listen",
  "url": "wss://your-host/jambonz",
  "sampleRate": 16000,
  "bidirectionalAudio": { "enabled": true, "streaming": true }
}

Then call the number. Audio goes to the Voice API, the agent answers from your prompt, and the reply streams back on the same socket — billed from your prepaid balance at ₹1.50 to ₹3.75 a minute depending on the voice grade. Nothing about your jambonz account changes: the number, the trunk and the per-minute connectivity stay billed by jambonz.

Prefer to write it yourself?

You do not have to use the bridge. The protocol reference is one REST call and one WebSocket, and Setu is MIT licensed — the jambonz.ts adapter is about a hundred readable lines. Copy it, port it, or read it to find out what the vendor docs left out. There is also a complete Python and FastAPI implementation in the repository's examples folder, covering the whole protocol including barge-in.