Integrations / FreJun / Teler
FreJun / Teler 🇮🇳 to an AI voice agent
Connect a FreJun (Teler) Indian number to an AI voice agent over Teler's bidirectional stream. Setu handles the FreJun / Teler dialect and hands the voice engine plain PCM16, including the flush that makes barge-in work.
path /frejun · 8 kHz · production-tested on live calls
What FreJun / Teler sends and expects
- Wire format
- JSON text frames, base64 PCM16 in {"type":"audio","audio_b64":…,"chunk_id":n}
- Sample rate
- 8 kHz
- Flush playback on interruption
{"type":"clear"}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
Three traps, and we hit all of them on live calls. Teler's play-out is fixed at 8 kHz, so 16 kHz audio comes back as a half-speed ghost. A voice engine emits faster than realtime, and overflowing Teler's buffer produces a periodic burst artifact that is audible on the live leg but ABSENT from the recording, because the recording is stitched from the bytes you sent — so you cannot hear it back to debug it. And Teler inserts roughly 20 ms of pause at each chunk boundary regardless of buffer depth, so uniform small frames stutter. The adapter sends 8 kHz, paces to realtime with a lead, and grows its frames from 800 ms to 2.4 s so the first word stays fast and the rest stays smooth.
Wiring it up
Point your Teler app's stream URL at the bridge. Both /frejun and /teler are accepted.
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 FreJun / Teler at it
Point your Teler app's stream URL at the bridge. Both /frejun and /teler are accepted. The bridge listens on /frejun, so the target is wss://your-host/frejun.
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 FreJun / Teler account changes: the number, the trunk and the per-minute connectivity stay billed by FreJun / Teler.
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 frejun.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