- Purpose: Core telephony platform
- Technology: Asterisk 20
- Responsibilities:
- SIP registration and authentication
- Call routing and management
- RTP audio stream handling
- User-to-user call bridging
- Call detail record (CDR) logging
- Purpose: Bridge between Asterisk and chatbot services
- Technology: Python, FastAPI, Redis
- Responsibilities:
- Session management and state persistence
- Audio format conversion
- Routing to language-specific chatbots
- Bidirectional audio streaming
- Circuit breaker for service failures
- Purpose: AI-powered English conversation
- Technology: Python, OpenAI APIs, LangChain
- Pipeline:
- Speech-to-Text (Whisper)
- Language Model (GPT-4)
- Text-to-Speech (OpenAI TTS)
- Purpose: AI-powered Kinyarwanda conversation
- Technology: Python, Custom ML models
- Pipeline:
- Speech-to-Text (Custom Kinyarwanda model)
- Language Model (Fine-tuned Kinyarwanda LLM)
- Text Normalization (Kinyarwanda-specific)
- Text-to-Speech (Custom Kinyarwanda TTS)
- Purpose: Session state and caching
- Technology: Redis 7
- Usage:
- Call session storage
- Conversation history
- Temporary audio buffers
User A → Asterisk → User B
User → Asterisk → Orchestrator → Chatbot Service
↓
STT → LLM → TTS
↓
User ← Asterisk ← Orchestrator ← Audio Response
All services communicate over a Docker bridge network (voice-network):
- Subnet: 172.20.0.0/16
- Internal DNS resolution
- Isolated from host network except exposed ports
| Extension Range | Purpose |
|---|---|
| 1000-1999 | User extensions |
| 2000 | English chatbot |
| 3000 | Kinyarwanda chatbot |
- Asterisk Codecs: opus, ulaw, alaw (prioritized in order)
- Internal Processing: 16-bit PCM, 16kHz
- RTP Ports: 10000-10100
orchestrator → redis
orchestrator → english-bot
orchestrator → kinyarwanda-bot
asterisk → orchestrator
- Orchestrator can be horizontally scaled with load balancer
- Redis can be clustered for high availability
- Chatbot services can run multiple instances
- Asterisk can be clustered using Kamailio or similar
- Network: Docker network isolation
- Authentication: SIP authentication for users
- Encryption: TLS/SRTP support (configurable)
- API: JWT tokens between services
- Rate Limiting: On chatbot endpoints
- Service health endpoints (
/health) - Prometheus metrics (
/metrics) - Asterisk CDR logs
- Application logs (structured JSON)
- Redis connection status
| Failure | Impact | Recovery |
|---|---|---|
| Asterisk down | All calls fail | Auto-restart (30s) |
| Orchestrator down | Chatbot calls fail | Auto-restart, user calls continue |
| Chatbot down | That language unavailable | Circuit breaker, error message |
| Redis down | New sessions fail | In-memory fallback |
- User-to-user latency: <200ms
- Chatbot response time: <3s
- Concurrent calls: 10+
- Audio quality: MOS >4.0
- Session timeout: 5 minutes
- WebRTC support for browser-based clients
- Multi-language detection and switching
- Call recording and transcription
- Analytics dashboard
- Load balancing and clustering
- Kubernetes deployment