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.
Inbound call
Section titled “Inbound call”A caller dials your Teler number, and Teler asks your Bridge what to do.
| Step | What happens |
|---|---|
| 1 | Caller dials your Teler number. |
| 2 | Teler POSTs the Incoming Call URL on the Voice App. |
| 3 | Your Bridge returns a stream Call Flow with a ws_url. |
| 4 | Teler opens a WebSocket to that ws_url and starts streaming audio. |
| 5 | Your Bridge proxies audio to and from your AI provider. |
Outbound call
Section titled “Outbound call”Your code asks Teler to dial a number and connect it to your Bridge.
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" }'| Step | What happens |
|---|---|
| 1 | Your code calls POST /api/v1/voice/calls/initiate with from, to, and flow_url. |
| 2 | Teler dials the callee. |
| 3 | When the callee answers, Teler POSTs your flow_url. |
| 4 | Your Bridge returns a stream flow with a ws_url. |
| 5 | Teler opens a WebSocket to that ws_url and starts streaming audio. |
| 6 | Your Bridge proxies audio to your AI provider. |
Bridge responsibilities
Section titled “Bridge responsibilities”| Concern | Owned by Bridge | Owned by AI provider |
|---|---|---|
| WebSocket connect, ping, close | yes | no |
| Base64 decode/encode | yes | no |
| Sample-rate conversion | yes | no |
| Audio buffering and chunking | yes | no |
| Interrupt / clear on barge-in | yes (forwards to Teler) | yes (decides when) |
| Speech-to-text | no | yes |
| LLM inference | no | yes |
| Text-to-speech | no | yes |
Next steps
Section titled “Next steps” WebSocket Messages The exact message types you'll send and receive.
Recipes Drop-in Bridges for OpenAI, ElevenLabs, Gemini, Vapi, and more.
SDKs StreamConnector: the SDK primitive for building a Bridge.