Skip to main content
The assistant-api supports five telephony providers. Each is identified by a string constant defined in api/assistant-api/internal/channel/telephony/telephony.go.
const (
    Twilio   Telephony = "twilio"
    Exotel   Telephony = "exotel"
    Vonage   Telephony = "vonage"
    Asterisk Telephony = "asterisk"
    SIP      Telephony = "sip"
)

Provider Comparison

ProviderTransportAudio FormatRegion
TwilioWebSocket (Media Streams)μ-law 8kHzGlobal
VonageWebSocketLinear PCM 16kHzGlobal
ExotelWebSocketμ-law 8kHzIndia / SEA
Asterisk AudioSocketRaw TCP 0.0.0.0:4573Linear PCM 8kHzSelf-hosted PBX
Asterisk WebSocketWebSocket (chan_websocket)μ-law 8kHzSelf-hosted PBX
SIPUDP 0.0.0.0:5090 + RTPPCMDirect SIP / SIP trunks
Twilio, Vonage, and Exotel are cloud providers — they call your server. You need PUBLIC_ASSISTANT_HOST set to a public HTTPS hostname (use ngrok locally).Asterisk AudioSocket and WebSocket run on your own PBX — Asterisk connects out to Rapida.SIP is a built-in server in assistant-api — any SIP client can call it directly.

URL Routing Pattern

All telephony paths follow this structure (source: api/assistant-api/internal/type/telephony.go):
// Inbound call webhook — provider calls this when a call arrives
func GetContextAnswerPath(provider, contextID string) string {
    return fmt.Sprintf("v1/talk/%s/ctx/%s", provider, contextID)
    // Example: v1/talk/twilio/ctx/abc-123
}

// Status / event callback
func GetContextEventPath(provider, contextID string) string {
    return fmt.Sprintf("v1/talk/%s/ctx/%s/event", provider, contextID)
    // Example: v1/talk/twilio/ctx/abc-123/event
}
PathMethodPurpose
/v1/talk/{provider}/call/{assistantId}POST / GETInbound call webhook (provider → Rapida)
/v1/talk/{provider}/ctx/{contextId}WebSocketBidirectional audio stream
/v1/talk/{provider}/ctx/{contextId}/eventPOSTStatus / lifecycle events
The contextId is created on the first webhook hit and binds the conversation to a provider session. It is stored in PostgreSQL with the assistant ID, conversation ID, and auth token.

Inbound Call Flow


What’s Next