telnyx plugin bridges PSTN phone calls into a Vision Agents + Stream call through Telnyx Call Control webhooks and bidirectional Media Streaming.
Vision Agents uses Stream Video for real-time WebRTC transport by default. External WebRTC transports are supported as well. Most AI providers offer free tiers to get started.
What the plugin provides
- Call Control webhook handling pattern (via your FastAPI server)
- Bidirectional Telnyx Media Streaming over WebSocket
CallRegistryfor call/session/token trackingattach_phone_to_callto bridge Telnyx audio ↔ Stream WebRTC- Audio conversion: PCMU, PCMA (8 kHz), L16 (16 kHz)
Prerequisites
Installation
Environment Variables
Telnyx account setup
Quick local dev (--setup-telnyx) — the plugin examples auto-create a temporary Call Control App, set the webhook URL, route the inbound number, and clean up on shutdown.
Manual setup:
- Create a Telnyx Call Control App.
- Set the app webhook URL to
https://<NGROK_URL>/telnyx/events. - Route your inbound phone number to that Call Control App.
- For outbound calls, ensure the app has an outbound voice profile for your target country. On restricted accounts, verify destination numbers before dialing.
Quick Start
The plugin gives you registry, media stream, and bridge primitives. Your FastAPI server wires them to Telnyx webhooks and WebSockets:Inbound calls
Telnyx sends webhooks toPOST /telnyx/events. On call.initiated with direction incoming, register the call and answer with a media stream URL:
Outbound calls
Pre-register the call in the registry, start your server, then dial via the Telnyx Call Control API withconnection_id set to your Call Control App ID:
Key Components
Audio formats
To send agent audio back to the caller, start Telnyx streaming with
stream_bidirectional_mode=rtp.
Common setup errors
Next Steps
Telnyx Plugin Examples
Minimal inbound and outbound phone examples
Phone Calling
Provider overview and learning path
Twilio
Alternative telephony provider
Stream Video RTC
Default edge transport for agent calls
RAG for Agents
Add knowledge base to phone agents
Build a Voice Agent
Get started with voice