Skip to main content
Back to All ArticlesEngineering Blog
Voice AI & TelephonyNov 23, 2026•8 min read

Autonomous Voice Agents with Asterisk PBX: Engineering Real-Time Order Confirmation Calls

How to bridge Asterisk PBX telephony with streaming Whisper STT, LLM conversational state machines, and neural TTS for automated live outbound order verification.

Author: Mesbah UddinTechnical Editorial · Systems Engineering
High-volume eCommerce operations frequently struggle with unverified Cash-on-Delivery (COD) orders, fraudulent purchases, and delivery scheduling failures. Deploying autonomous conversational voice agents over real telephony channels automates order verification with human-like conversation. ### The Telephony Audio Bridge Connecting Asterisk PBX to modern streaming AI models requires low-latency, bidirectional audio streaming: 1. **PJSIP Audio Server**: Asterisk routes call audio to an external WebSocket streaming server via an `AudioSocket` or `EAGI` audio tap. 2. **Raw PCM Chunking**: Audio is streamed in 80ms chunks (16kHz, 16-bit mono) directly to a streaming speech-to-text pipeline. ```text Customer Phone │ (PSTN / SIP Trunk) ▼ [Asterisk PBX] │ (WebSocket AudioSocket) ▼ [Streaming Voice Pipeline] ├── Whisper STT (<250ms) ├── Conversational State Machine (LLM Function Calling) └── Neural TTS Synthesizer (<200ms) │ ▼ (Bidirectional Audio) Customer Hears Natural Response ``` ### Overcoming Conversational Latency & Handling Barge-In The biggest challenge in voice bots is turn-taking. If latency exceeds 800ms, awkward conversational pauses break caller engagement. We solved this with: - **Acoustic Voice Activity Detection (VAD)**: When the customer speaks while the bot is talking, the pipeline immediately halts audio playback (barge-in) and switches the state machine back to listening mode. - **Phonetic Filler Injections**: Injecting natural acknowledgment sounds ("Got it", "Sure, one moment") while background database queries execute. ### Order State Progression & CRM Sync Upon call completion, the agent’s structured intent output (e.g., `CONFIRMED`, `RESCHEDULE_FRIDAY`, `CANCEL_INCORRECT_ADDRESS`) is emitted as a webhook to the Laravel eCommerce backend, updating inventory reservations and notifying warehouse dispatch teams instantaneously.
Topics & Architecture
#Voice AI#Asterisk PBX#Whisper STT#FastAPI#Telephony#eCommerce#WebSockets
MU
Mesbah Uddin

Senior Software Engineer & Systems Architect

Specializing in multi-tenant SaaS, real-time WebRTC/Asterisk telephony, and applied AI systems since 2024. Building production systems for clients in Bangladesh, Germany, Canada, USA, Singapore, Italy, and Saudi Arabia.