All-in-one FreeSWITCH AI VoiceBot with real-time VAD, Whisper STT, and smart semantic intent flows.
414
An automated, real-time IVR VoiceBot that handles inbound telephone calls via FreeSWITCH, transcribes caller speech, and navigates a dynamic JSON-defined conversation flow. Powered by Silero VAD, DeepFilterNet2 neural noise cancellation, and Whisper STTβall in a single, ready-to-run container!
This image is a complete, production-ready solution that turns any standard SIP/VoIP telephone line into an interactive AI voice conversation. It is designed to handle high-fidelity audio streams, clean background noise in real-time, and route callers through conversational trees with high semantic accuracy.
supervisord.π Caller β FreeSWITCH (SIP) β WebSocket Audio Stream β AI Pipeline β Voice Response
+-----------------------------------------------------------+
| FreeSWITCH Container |
| |
| +--------------+ +------------------------+ |
| | mod_sofia |--------->| mod_audio_fork | |
| | (SIP Stack) | | (WebSocket Streamer) | |
| +--------------+ +-----------+------------+ |
+----------------------------------------|------------------+
|
v WebSocket: 16kHz Mono PCM
+-----------------------------------------------------------+
| Python VoiceBot Engine |
| |
| +---------------------------------------------------+ |
| | Per-Call Audio Pipeline | |
| | | |
| | 1. Silero VAD - Speech detection | |
| | 2. DeepFilterNet2 - Neural noise cancellation| |
| | 3. Whisper STT - Speech-to-Text | |
| | 4. JSON IVR Engine - Intent matching | |
| +-------------------------+-------------------------+ |
| | |
| v |
| [Broadcast Response Audio] |
+-----------------------------------------------------------+
You can launch the complete stack using Docker Compose or as a Standalone Container.
Clone the project files:
git clone https://github.com/rajshahunify/freeswitch_voicebot.git
cd freeswitch_voicebot
Spin up the entire environment:
docker compose up -d
Run the image directly with custom environment variables:
docker run -d \
--name freeswitch-voicebot \
-p 5060:5060/udp \
-p 5080:5080/udp \
-p 8021:8021 \
-p 16384-16484:16384-16484/udp \
-e VOICEBOT_EXTENSION=5000 \
-e EXTERNAL_IP=127.0.0.1 \
rajunify123/freeswitch-voicebot:latest
127.0.0.1:5060).1000 and Password: 1234.5000 (or your custom VOICEBOT_EXTENSION).This project ships with three Docker Compose files optimized for different platforms and use cases:
| Compose File | Platform | Use Case | Command |
|---|---|---|---|
docker-compose.yml | β Windows, macOS, Linux | Default / Production β Bridge networking, works everywhere | docker compose up -d |
docker-compose.dev.yml | β Windows, macOS, Linux | Development β Volume mounts for live code editing without rebuild | docker compose -f docker-compose.dev.yml up -d |
docker-compose.host.yml | β οΈ Linux only | High-Performance β Host networking, zero NAT overhead | docker compose -f docker-compose.host.yml up -d |
Use the default docker-compose.yml (bridge mode). Docker Desktop on Windows and macOS does not support host networking.
docker compose up -d
Tip: Set
EXTERNAL_IP=127.0.0.1when testing locally from the same machine.
You have two options:
Standard (bridge mode) β same as Windows/macOS:
docker compose up -d
High-performance (host networking) β recommended for production servers with many concurrent calls:
docker compose -f docker-compose.host.yml up -d
Note: With host networking, set
EXTERNAL_IPto your server's public or LAN IP address.
For active development with live code reloading (source code is volume-mounted into the container):
docker compose -f docker-compose.dev.yml up -d
After editing Python code, restart the services without rebuilding:
docker exec freeswitch-voicebot supervisorctl restart voicebot-server voicebot-agent
After editing FreeSWITCH XML configs:
docker exec freeswitch-voicebot fs_cli -x "reloadxml"
Customize the behavior of the voicebot using these environment variables:
| Variable | Default | Description |
|---|---|---|
VOICEBOT_EXTENSION | 5000 | The extension dialed on your softphone to trigger the bot. |
EXTERNAL_IP | 127.0.0.1 | Public or host IP address for proper SDP negotiation. |
WEBSOCKET_URL | ws://127.0.0.1:8000/media | Target websocket endpoint for streaming call audio. |
STT_URL | http://164.52.203.140:8890/transcribe | Transcription endpoint of your Whisper instance. |
NC_ENABLED | false | Set to true to enable DeepFilterNet2 noise cancellation. |
VAD_THRESHOLD | 0.3 | Sensitivity threshold for speech detection (lower = more sensitive). |
MAX_CONCURRENT_CALLS | 5 | Maximum number of active voice calls allowed simultaneously. |
LOG_LEVEL | INFO | Output verbosity level (DEBUG, INFO, WARNING, ERROR). |
To change how the voice bot answers, simply define your custom dialog steps in your JSON conversation file. You can mount your own custom configurations and audio soundboards into the container:
/app/ivr/flow.json..wav prompts in the mounted FreeSWITCH sounds directory at /usr/local/freeswitch/sounds/custom/.Content type
Image
Digest
sha256:06f4d2f1eβ¦
Size
5 GB
Last updated
4 months ago
docker pull rajunify123/freeswitch-voicebot