FreeSWITCH 1.10 + mod_audio_fork: real-time L16 audio streaming via WebSocket for AI & ASR.
438
A production-ready FreeSWITCH 1.10 Docker image pre-built with mod_audio_fork — a module that forks live call audio and streams it in real-time over a WebSocket connection to any remote server. Ideal for AI voice agents, speech recognition (ASR) pipelines, real-time transcription, and conversational IVR applications.
mod_audio_fork attaches a media bug to a FreeSWITCH channel and streams raw L16 (16-bit PCM) audio over a WebSocket (ws:// or wss://) to your backend in real-time. Audio is never written to disk, making this ideal for privacy-sensitive or "no data at rest" deployments.
It also supports receiving audio back from the WebSocket server and playing it to the caller — enabling full-duplex AI-driven conversations.
docker pull rajunify123/freeswitch-mod-audio-fork:v1
docker run -d \
--name freeswitch \
--network host \
-e EXT_SIP_IP=<your-public-ip> \
-e EXT_RTP_IP=<your-public-ip> \
-v /path/to/your/conf:/usr/local/freeswitch/conf \
rajunify123/freeswitch-mod-audio-fork:v1
Note:
--network hostis recommended for SIP/RTP to avoid NAT issues in most deployments.
| Port | Protocol | Purpose |
|---|---|---|
| 5060 | UDP/TCP | SIP signalling |
| 5061 | TCP/TLS | SIP over TLS (SIPS) |
| 8021 | TCP | FreeSWITCH Event Socket (ESL) |
| 5080 | UDP/TCP | SIP (outbound profile) |
| 16384–32768 | UDP | RTP media streams |
| Variable | Default | Description |
|---|---|---|
EXT_SIP_IP | auto | Public IP for SIP signalling |
EXT_RTP_IP | auto | Public IP for RTP media |
DOMAIN | localhost | FreeSWITCH domain |
ESL_PASSWORD | ClueCon | Event Socket password (change in prod!) |
Once a call is established, trigger audio forking via the FreeSWITCH API:
uuid_audio_fork <uuid> start <wss-url> <mix-type> <sampling-rate> [metadata-json]
Parameters:
uuid — FreeSWITCH channel UUIDwss-url — WebSocket endpoint (ws:// or wss://)mix-type — mono | mixed | stereosampling-rate — 8k or 16kmetadata-json — Optional JSON sent as the first frame before audio beginsExample:
uuid_audio_fork 8cf9eb-... start wss://my-asr-server.com/stream stereo 8k {"caller":"12125551234"}
Stop streaming:
uuid_audio_fork <uuid> stop
The WebSocket server can send audio back to play to the caller:
{
"type": "streamAudio",
"data": {
"audioDataType": "raw",
"sampleRate": 8000,
"audioData": "<base64-encoded-pcm>"
}
}
| Event Name | Description |
|---|---|
mod_audio_fork::connect | WebSocket connection established |
mod_audio_fork::disconnect | WebSocket connection closed |
mod_audio_fork::transfer | Data received from WebSocket server |
mod_audio_fork::error | Connection or streaming error occurred |
| Variable | Default | Description |
|---|---|---|
MOD_AUDIO_FORK_SUBPROTOCOL_NAME | audio.drachtio.org | WebSocket sub-protocol name |
MOD_AUDIO_FORK_SERVICE_THREADS | 1 | libwebsocket service threads (max 5) |
| Path | Purpose |
|---|---|
/usr/local/freeswitch/conf | FreeSWITCH configuration |
/usr/local/freeswitch/sounds | Sound files |
/usr/local/freeswitch/recordings | Call recordings |
/usr/local/freeswitch/log | Logs |
| Tag | Description |
|---|---|
latest | Latest stable build |
v1 | First stable release |
FreeSWITCH is licensed under the MPL 1.1. mod_audio_fork is open-source (drachtio project).
Content type
Image
Digest
sha256:788a1ec1d…
Size
922.7 MB
Last updated
7 months ago
docker pull rajunify123/freeswitch-mod-audio-fork