Skip to main content
The assistant-api supports five telephony providers. Each is identified by a string constant 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 port 4573SLIN 16-bit 8kHzSelf-hosted PBX
Asterisk WebSocketWebSocket (chan_websocket)μ-law 8kHzSelf-hosted PBX
SIPUDP port 5090 + RTPPCMDirect 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):
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}/eventPOSTCall status / lifecycle events
func GetContextAnswerPath(provider, contextID string) string {
    return fmt.Sprintf("v1/talk/%s/ctx/%s", provider, contextID)
}
func GetContextEventPath(provider, contextID string) string {
    return fmt.Sprintf("v1/talk/%s/ctx/%s/event", provider, contextID)
}
The contextId is generated on the first webhook hit. It is stored in PostgreSQL and binds together the call session, assistant, conversation, and auth token.

Inbound Call Flow


Provider Pages