Skip to content

Bridge

A Bridge is the small service you run that sits between Teler and your AI provider. Teler opens a WebSocket to your Bridge for the call’s audio; the Bridge in turn opens a WebSocket to your AI provider (OpenAI Realtime, ElevenLabs, Gemini Live, etc.) and relays audio between them.

The Bridge owns:

  • WebSocket lifecycle: connect, handshake, reconnect, close.
  • Audio transport: base64-decode incoming, base64-encode outgoing.
  • Sample-rate conversion if Teler and your provider use different rates.
  • Interrupt and clear primitives for barge-in.

Your AI provider stays focused on speech-to-text, LLM, and text-to-speech.

A caller dials your Teler number, and Teler asks your Bridge what to do.

StepWhat happens
1Caller dials your Teler number.
2Teler POSTs the Incoming Call URL on the Voice App.
3Your Bridge returns a stream Call Flow with a ws_url.
4Teler opens a WebSocket to that ws_url and starts streaming audio.
5Your Bridge proxies audio to and from your AI provider.

Your code asks Teler to dial a number and connect it to your Bridge.

Terminal window
curl -X POST "https://api.frejun.ai/api/v1/voice/calls/initiate" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"from_number": "+91XXXXXXXXXX",
"to_number": "+91XXXXXXXXXX",
"flow_url": "https://your-bridge.example.com/flow",
"status_callback_url": "https://your-bridge.example.com/webhook"
}'
StepWhat happens
1Your code calls POST /api/v1/voice/calls/initiate with from, to, and flow_url.
2Teler dials the callee.
3When the callee answers, Teler POSTs your flow_url.
4Your Bridge returns a stream flow with a ws_url.
5Teler opens a WebSocket to that ws_url and starts streaming audio.
6Your Bridge proxies audio to your AI provider.
ConcernOwned by BridgeOwned by AI provider
WebSocket connect, ping, closeyesno
Base64 decode/encodeyesno
Sample-rate conversionyesno
Audio buffering and chunkingyesno
Interrupt / clear on barge-inyes (forwards to Teler)yes (decides when)
Speech-to-textnoyes
LLM inferencenoyes
Text-to-speechnoyes