assistant-api supports five telephony providers. Each is identified by a string constant in api/assistant-api/internal/channel/telephony/telephony.go.
Provider Comparison
| Provider | Transport | Audio Format | Region |
|---|---|---|---|
| Twilio | WebSocket (Media Streams) | μ-law 8kHz | Global |
| Vonage | WebSocket | Linear PCM 16kHz | Global |
| Exotel | WebSocket | μ-law 8kHz | India / SEA |
| Asterisk AudioSocket | Raw TCP port 4573 | SLIN 16-bit 8kHz | Self-hosted PBX |
| Asterisk WebSocket | WebSocket (chan_websocket) | μ-law 8kHz | Self-hosted PBX |
| SIP | UDP port 5090 + RTP | PCM | Direct SIP / SIP trunks |
Twilio, Vonage, and Exotel are cloud providers — they call your server.
PUBLIC_ASSISTANT_HOST must be a publicly reachable HTTPS hostname. For local development, use ngrok.Asterisk connects from your PBX to Rapida — no public URL needed on Asterisk’s side.SIP is a built-in server in assistant-api — any SIP client dials it directly.URL Routing
All telephony paths follow this pattern (source:api/assistant-api/internal/type/telephony.go):
| Path | Method | Purpose |
|---|---|---|
/v1/talk/{provider}/call/{assistantId} | POST / GET | Inbound call webhook — provider → Rapida |
/v1/talk/{provider}/ctx/{contextId} | WebSocket | Bidirectional audio stream |
/v1/talk/{provider}/ctx/{contextId}/event | POST | Call status / lifecycle events |
contextId is generated on the first webhook hit. It is stored in PostgreSQL and binds together the call session, assistant, conversation, and auth token.