Twilio inbound calls
The Python reference bridge terminates a bidirectional Twilio Media Stream and opens one Converse session per call. Twilio remains responsible for the phone number and call; your service owns deployment and application tools.
- Download
bridge.py,pyproject.tomlandenv.example. - Set
CONVERSE_API_KEY,TWILIO_AUTH_TOKENand the exact externalPUBLIC_BASE_URL. - Run
uv sync, thenuv run uvicorn bridge:app --env-file .env --host 0.0.0.0 --port 8000behind public HTTPS. - Point the Twilio number's incoming Voice webhook at
POST https://your-host/voice.
The bridge validates Twilio signatures, converts 8 kHz G.711 mu-law audio, and maps Twilio mark/clear playback state onto Converse interruption events. Add your tool schemas and handlers in tool_manifest() and execute_tool(). See the complete bridge notes.