FreeSWITCH v1.11.3 + mod_audio_stream for aicc; PostgreSQL/S3 via env vars (amd64, arm64)
761
An aicc (AI-native call center) image built from FreeSWITCH v1.11.3 sources. The module set, configuration tree, Lua scripts and sound files inside the image match the aicc host environment (/usr/local/freeswitch); external dependencies such as PostgreSQL, S3, the voice bot and the PSTN gateway are injected at startup through environment variables.
linux/amd64 and linux/arm64v1.11.3 (sofia-sip and spandsp pinned to specific commits, see the image LABELs)mod_audio_stream (rasonyang/mod_audio_stream, libwsc statically linked)debian:bookworm-slim| Tag | Description |
|---|---|
v1.11.3 | Multi-arch manifest: linux/amd64 + linux/arm64 |
latest | Same as the newest version, multi-arch (linux/amd64 + linux/arm64) |
docker run -d --name freeswitch --network host \
-e FS_LOCAL_IP=192.168.31.55 \
-e FS_ESL_LISTEN_IP=0.0.0.0 \
-e AICC_LUA_DSN="pgsql://hostaddr=10.0.0.5 dbname=aicc user=aicc_lua password='secret'" \
-e AICC_CC_DSN="pgsql://hostaddr=10.0.0.5 dbname=aicc_fs user=aicc password='secret'" \
-e AICC_RECORDINGS_DIR="http://aicc-recordings.s3.example.com" \
-v fs-db:/usr/local/freeswitch/db -v fs-log:/usr/local/freeswitch/log \
rasonyang/freeswitch-aicc:v1.11.3
docker exec freeswitch fs_cli -P 18021 -x status
A complete example is in the image source tree at docker/aicc/docker-compose.example.yml.
Configuration is rewritten only for variables that are actually set; anything left unset keeps the same default as the host configuration. The one exception is local_ip_v4: the host configuration hardcodes the host IP, which a container cannot bind, so when FS_LOCAL_IP is unset the container's primary IP is used.
| Variable | Injected into | Default |
|---|---|---|
FS_LOCAL_IP | local_ip_v4 (SIP/RTP bind address) | container primary IP |
FS_EXTERNAL_IP | external_rtp_ip, external_sip_ip (NAT public address) | $${local_ip_v4} |
FS_DOMAIN | domain | $${local_ip_v4} |
FS_DEFAULT_PASSWORD | default_password (extension default password) | host value |
| Variable | Injected into | Default |
|---|---|---|
FS_ESL_LISTEN_IP | listen-ip | 127.0.0.1 (must be 0.0.0.0 for access from outside the container) |
FS_ESL_PORT | listen-port | 18021 |
FS_ESL_PASSWORD | password | ClueCon |
FS_ESL_ACL | apply-inbound-acl | lan (127.0.0.1 + 192.168.31.0/24 in acl.conf.xml) |
| Variable | Injected into | Description |
|---|---|---|
AICC_LUA_DSN | vars.xml aicc_lua_dsn | Business database DSN used by the aicc_*.lua scripts |
AICC_CC_DSN | vars.xml aicc_cc_dsn | Call center database DSN |
FS_CORE_DB_DSN | switch.conf.xml core-db-dsn | Switch the core database to PostgreSQL (SQLite by default) |
FS_CALLCENTER_DSN | callcenter.conf.xml odbc-dsn | Switch mod_callcenter to PostgreSQL (SQLite by default) |
DSN format: pgsql://hostaddr=10.0.0.5 dbname=aicc user=aicc password='secret'.
Note: the database referenced by FS_CORE_DB_DSN must be reachable at startup, otherwise FreeSWITCH exits with Cannot Initialize; if FS_CALLCENTER_DSN is unreachable, mod_callcenter fails to load (the other modules are unaffected). AICC_LUA_DSN/AICC_CC_DSN are only connected when the Lua scripts run, so startup is not affected.
| Variable | Injected into | Description |
|---|---|---|
AICC_RECORDINGS_DIR | vars.xml aicc_recordings_dir | URL prefix for recording uploads (HTTP/S3/MinIO); the PUT is performed by mod_http_cache |
FS_S3_ACCESS_KEY_ID | http_cache.conf.xml aws-s3 profile | S3 signing is enabled when all three are set |
FS_S3_SECRET_ACCESS_KEY | same as above | |
FS_S3_BASE_DOMAIN | same profile's base-domain and domains | e.g. s3.example.com or minio.internal:9000 |
FS_S3_BUCKET | same profile's domains (optional) | When set, the profile domain is <bucket>.<base-domain>, otherwise <base-domain> |
FS_S3_REGION | same profile's region | us-east-1 by default |
mod_http_cache matches a profile by exact URL hostname against its domain, so the hostname formed from FS_S3_BUCKET/FS_S3_BASE_DOMAIN must equal the URL host in AICC_RECORDINGS_DIR. For example, AICC_RECORDINGS_DIR=http://aicc-recordings.s3.example.com corresponds to FS_S3_BUCKET=aicc-recordings and FS_S3_BASE_DOMAIN=s3.example.com.
| Variable | Injected into |
|---|---|
AICC_BOT_HOST / AICC_BOT_PORT | vars.xml aicc_bot_host / aicc_bot_port (defaults $${local_ip_v4} / 6060) |
PSTN_GATEWAY_HOST / PSTN_GATEWAY_PORT / PSTN_GATEWAY_CALLER_ID | vars.xml pstn_gateway_* (defaults 192.168.31.41 / 5080 / 95001) |
| Variable | Injected into |
|---|---|
FS_RTP_START_PORT / FS_RTP_END_PORT | switch.conf.xml rtp-start-port / rtp-end-port (default 16384-32768) |
At startup the entrypoint prints a single [entrypoint] injected: ... line listing the names of the injected variables (values are not printed).
| Port | Purpose |
|---|---|
| 5060/udp,tcp | SIP internal |
| 5080/udp,tcp | SIP external |
| 5066/tcp | SIP over WebSocket |
| 7443/tcp | SIP over WSS |
| 18021/tcp | ESL |
| 16384-32768/udp | RTP |
--network host is recommended for SIP/RTP. On a bridge network you must set FS_EXTERNAL_IP, narrow the FS_RTP_*_PORT range, and map the ports individually.
| Path | Contents |
|---|---|
/usr/local/freeswitch/db | SQLite (core, sofia registrations, callcenter, voicemail) |
/usr/local/freeswitch/log | Logs and CDRs |
/usr/local/freeswitch/recordings | Local recordings |
/usr/local/freeswitch/storage | Voicemail |
/usr/local/freeswitch/certs | Optional. Mount wss.pem and dtls-srtp.pem; self-signed certificates are generated when missing |
mod_console, mod_logfile, mod_cdr_csv, mod_event_socket, mod_sofia, mod_loopback, mod_commands, mod_dptools, mod_expr, mod_fifo, mod_hash, mod_voicemail, mod_valet_parking, mod_dialplan_xml, mod_g723_1, mod_g729, mod_opus, mod_sndfile, mod_native_file, mod_local_stream, mod_tone_stream, mod_lua, mod_http_cache, mod_say_en, mod_callcenter, mod_pgsql, mod_audio_stream.
/usr/local/freeswitch/conf: the aicc configuration (vars.xml, sip_profiles, dialplan/aicc, autoload_configs and so on, with backup files removed)/usr/local/freeswitch/scripts: aicc_inbound.lua, aicc_queue.lua, aicc_track.lua, aicc_xml.lua (the mod_lua XML handler; directory/configuration are served from PostgreSQL)/usr/local/freeswitch/sounds: en/us/callie (8k/32k/48k) and music (8k/16k/32k/48k)The process runs in the foreground as the freeswitch user (-nonat -nf -nc), and HEALTHCHECK uses fs_cli -x status.
# Requires: the FreeSWITCH source repository (with tag v1.11.3), a host /usr/local/freeswitch,
# the mod_audio_stream sources (including the libs/libwsc submodule), and docker buildx
docker/aicc/build.sh # defaults: FS_REF=v1.11.3, IMAGE=rasonyang/freeswitch-aicc
FS_REF=v1.11.3 MOD_AUDIO_STREAM=~/src/mod_audio_stream MAKE_JOBS=3 docker/aicc/build.sh /path/to/ctx
LOAD=1 PLATFORM=linux/arm64 docker/aicc/build.sh # single platform, loaded into the local daemon for testing
The build script exports the sources with git archive (working-tree changes are excluded), copies the host conf/scripts/sounds into the build context, then runs one docker buildx build --platform linux/amd64,linux/arm64 --push that builds both platforms and pushes the multi-arch v1.11.3 and latest tags. On Apple Silicon run Colima with --vz-rosetta so the amd64 half is compiled under Rosetta; QEMU user-mode emulation is not reliable for gcc (random segfaults).
Content type
Image
Digest
sha256:46d34d666…
Size
87.8 MB
Last updated
14 days ago
docker pull rasonyang/freeswitch-aicc