Directory Structure
Step 1 — Add the Provider Constant
Openapi/assistant-api/internal/channel/telephony/telephony.go:
/v1/talk/my-provider/call/{assistantId}
Step 2 — Implement internal_type.Telephony
Step 3 — Implement internal_type.Streamer
- Rapida’s STT pipeline expects raw PCM 16-bit mono
- Twilio and Exotel send base64-encoded μ-law 8kHz in JSON envelopes — decode before forwarding
- Vonage sends raw Linear PCM 16kHz binary frames
Step 4 — Register in the Factory
Openapi/assistant-api/internal/channel/telephony/telephony.go:
Step 5 — Rebuild
Reference Implementations
| Provider | Directory | Pattern |
|---|---|---|
| Twilio | internal/twilio/ | JSON envelope, base64 μ-law, TwiML response |
| Vonage | internal/vonage/ | NCCO JSON, binary PCM frames |
| Asterisk | internal/asterisk/ | Two-phase HTTP + ARI outbound |
| SIP | internal/sip/ | Direct UDP, RTP media |
Telephony Overview
URL routing and provider comparison
Adding an STT Provider
Same interface pattern for speech-to-text
Configuration
All assistant-api env vars
Architecture
Full system topology