VoIPsy

VoIPsy

Overview
We have developed a standalone AI-powered call-handling engine for a reputed taxi company
Tailored specifically for a taxi company to automate and manage incoming customer calls for booking taxis. The system integrates with Asterisk to manage incoming calls and uses a Python-based socket server to stream and process audio in real time
Incoming voice is streamed from Asterisk to the application.
Speech is converted to text using a high-performance transcription model.
The transcribed text is analyzed by a Large Language Model (LLM) to extract the address and formulate a natural response.
The response is then converted back into speech and played to the caller via Asterisk.
Challenges
Limited staff availability and reduced customer satisfaction
During non-office hours, staff availability was limited, leading to missed booking opportunities and reduced customer satisfaction. The client required an automated system capable of handling incoming calls efficiently without human intervention, especially during off-hours.
The Solution
AI-driven call handling system
We implemented an AI-driven call handling system that enables seamless, automated taxi bookings 24/7. The solution leverages state-of-the-art speech recognition, natural language processing, and speech synthesis technologies, integrated within a Dockerized environment for portability and scalability.
Functional & Technical Workflow
CALL RECEPTION
Asterisk receives the incoming call on a configured VoIP number.
AUDIO STREAMING
Voice is streamed to a Python-based socket server using the Asterisk AudioSocket module.
SPEECH-TO-TEXT
Audio is transcribed using the faster-whisper model for rapid and accurate conversion.
LLM PROCESSING
Transcribed text is analyzed by the Mistral LLM to identify the pickup address and generate a conversational response.
TEXT-TO-SPEECH
The response is converted to speech using Piper TTS and played back to the caller via Asterisk.
ADDRESS VALIDATION
If an address is detected, it is validated using Google’s API. If valid, a taxi is booked. If not, the system prompts for clarification and repeats the process until a valid address is confirmed.
A Very Flexible System
The system can be configured to use any of the following LLM sources:
Cloud-based Mistral
AWS Bedrock
Local Ollama instance (for offline/GPU-accelerated processing)
Supports both English and Italian.
The modular design allows for the replacement of any component (STT, LLM, TTS) based on evolving business or technical needs.
Key Benefits & Impact
24/7 AVAILABILITY

Enables round-the-clock call handling, especially during off-hours.
SCALABLE

Can handle multiple simultaneous calls without human intervention.
IMPROVED CUSTOMER EXPERIENCE

Reduces wait times and enhances booking reliability.
INCREASED REVENUE
Captures bookings that would otherwise be lost during non-office hours.
PRIVACY AND CONTROL

Fully local deployment option ensures data privacy, with no external API calls (beyond VoIP and optional validation).
Conclusion
This AI-powered call handling engine represents a significant step forward in automating customer communication. While it has been customized for a taxi service, the same system can be easily adapted to other industries such as healthcare, logistics, or customer support.
Its containerized architecture ensures quick deployment on any infrastructure, whether cloud or on-premises, with full control over data and performance. The ability to toggle between LLM sources gives businesses flexibility in balancing cost, latency, and privacy needs.
Future Enhancements

Multilingual
Support
Expand support for additional languages based on client demographics.

Analytics
Dashboard
Provide real-time insights into call volumes, booking success rates, and customer interaction quality.

CRM
Integration
Connect with customer databases or dispatch systems to log and manage bookings directly.

Fallback to
Human Agent
Automatically transfer the call to a human agent if AI is unable to resolve the query within a set number of attempts.
Technical Stack

Docker + Ubuntu 22.04:
Containerized deployment for easy hosting and portability.

Asterisk 20.12.0:
Manages incoming SIP calls and audio routing.

Faster-Whisper:
Fast and accurate speech-to-text transcription.

Mistral LLM (via Cloud, AWS Bedrock, or Ollama):
Extracts intent and key information (e.g.,pickup address) and generates human-like responses.

Piper TTS:
Converts the LLM-generated responses into natural-sounding voice.

Google Address Validation API:
Ensures pickup addresses are valid and serviceable.