Integrations / Raw SIP or anything else
Raw SIP or anything else to an AI voice agent
Bridge audio from a provider Setu has no adapter for, or from a browser, app or test harness. Setu handles the Raw SIP or anything else dialect and hands the voice engine plain PCM16, including the flush that makes barge-in work.
path /raw · Whatever you send, declared on connect · written from the vendor's published reference
What Raw SIP or anything else sends and expects
- Wire format
- Binary PCM16 frames, no envelope
- Sample rate
- Whatever you send, declared on connect
- Flush playback on interruption
Close and reopen, or handle the interrupted event yourselfCarriers 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
If you hold a SIP trunk rather than a CPaaS account, do not build a SIP stack. Put jambonz in front of it — open source, self-hosted, SIP in and WebSocket out — and use the jambonz adapter. Running your own SIP stack drags in licensing questions that a media gateway avoids entirely.
Wiring it up
Open a WebSocket to the /raw path and send PCM16 frames. Anything that can emit audio can drive it.
1 · run the bridge
export DVAARIK_API_KEY=dvk_live_...
export AGENT_PROMPT="You are Riya, the receptionist at Sunrise Dental."
npx @dvaarik/setu2 · point Raw SIP or anything else at it
Open a WebSocket to the /raw path and send PCM16 frames. Anything that can emit audio can drive it. The bridge listens on /raw, so the target is wss://your-host/raw.
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 Raw SIP or anything else account changes: the number, the trunk and the per-minute connectivity stay billed by Raw SIP or anything else.
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 raw.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.
Other providers