Vision Agents requires a Stream account
for real-time transport.
Choose a provider
Twilio
Media Streams, TwiML, built-in webhook helpers — default in our examples
Telnyx
Call Control API, bidirectional media streaming
How phone agents work
Every phone integration follows the same pattern, regardless of provider:- Webhook — the provider notifies your server of an incoming call (or you initiate an outbound call via REST API)
- Register — create a call entry in a provider registry with a secret token
- Stream URL — tell the provider to open a WebSocket media stream to your server
- Bridge —
attach_phone_to_callconnects phone audio ↔ a Stream call where your agent listens and responds
Shared building blocks
Both telephony plugins expose the same core primitives:| Building block | Role |
|---|---|
| Call registry | Tracks active calls, assigns tokens, optional async prepare to warm up the agent |
| Media stream | WebSocket handler that receives/sends phone audio |
attach_phone_to_call | Bridges provider audio ↔ Stream WebRTC participant |
| Tokenized media URL | Provider connects to wss://<host>/<provider>/media/{call_id}/{token} |
| Twilio | Telnyx | |
|---|---|---|
| Answer mechanism | Return TwiML with <Stream> | Call Control Answer/Dial API with stream_url |
| Webhook auth | verify_twilio_signature (built-in) | Ed25519 verification (see plugin examples) |
| Audio encoding | mulaw 8 kHz | PCMU/PCMA 8 kHz or L16 16 kHz |
Prerequisites
Before starting any phone example:- Stream API key and secret
- A telephony provider account with at least one phone number
- ngrok (or another HTTPS tunnel) for local development
- A public webhook URL pointing at your FastAPI server
Learning path
Follow this order:- Twilio Phone Agent — get your first inbound and outbound call working
- Phone Support Agent (RAG) — add knowledge retrieval on top
- Twilio or Telnyx integration pages — API reference when building your own server
Twilio Phone Agent
Step-by-step phone tutorial
Phone Support Agent (RAG)
Add knowledge retrieval to calls
Quick orientation
Point webhooks at your server
Configure your provider to send call events to your FastAPI endpoints (e.g.
https://<NGROK_URL>/twilio/voice for Twilio).Run an example and call your number
Follow the Twilio Phone Agent tutorial for full commands. Dial your Twilio number to verify end-to-end audio.
Next Steps
Twilio Integration
Plugin API reference
Telnyx Integration
Alternative provider
RAG for Agents
Knowledge retrieval backends
Stream Video RTC
Default edge transport
Build a Voice Agent
Voice agent fundamentals