Container image that builds and runs Asterisk with the UseCallManager (cisco-usecallmanager) patchset applied, for running Cisco IP phones (SIP firmware) against Asterisk. It ships defaults for SIP/PJSIP that include multiple config files, so you can drop your own Asterisk config in at runtime and have variables expanded automatically.
Warning: The UseCallManager patch for Asterisk 22 is, according to its author, ready for testing and may not be suitable for production use. It contains substantial changes to
chan_sip. Read the change log before using this image.
- Base OS: Debian Trixie (slim).
- Asterisk packages: built from the Debian source package (fetched from snapshot.debian.org) and patched with the UseCallManager (UCM) patchset.
- Architectures:
linux/amd64andlinux/arm64. - Entry point: a small bootstrap script that
- remaps the runtime user if requested,
- auto-detects your public IPv4 address (unless you set it),
- copies all files from
/configinto/etc/asterisk, - performs environment variable substitution (
envsubst) on those copied files (except dialplan files), - starts Asterisk (or the command you pass to the container).
- Health check: the container reports
healthyonceasterisk -rx "core show uptime"answers (if you run a custom command instead of Asterisk, the container will show up asunhealthy).
Images are published to Docker Hub and the GitHub Container Registry:
| Registry | Image |
|---|---|
| Docker Hub | cygnusnetworks/asterisk-usecallmanager |
| GHCR | ghcr.io/cygnusnetworks/asterisk-usecallmanager |
vX.Y.Z– the UCM patch version, which equals the Asterisk version it is built from (e.g.v22.10.0= Asterisk 22.10.0 +cisco-usecallmanager-22.10.0.patch).latest– the most recent build.
The exact Debian package version and snapshot used for a build are the ARG defaults in the Dockerfile of the respective tag.
Updates are automated: a daily workflow checks usecallmanagernz/patches for a newer patch of the current Asterisk major version. As soon as Debian also ships the matching Asterisk source package, the Dockerfile is updated, a vX.Y.Z tag is pushed, the image is built and a GitHub release is created.
This image consumes the patchset from the UseCallManager project:
- Site: https://usecallmanager.nz/
- Change log: https://usecallmanager.nz/change-log.html
- Patches: https://github.com/usecallmanagernz/patches
Hints for Asterisk 22.x:
- There have been backports and changes affecting
chan_sipin the UCM patches (renamed and removed options). Read the change log linked above and validate your configuration. chan_sipis suitable for connecting Cisco phones,pjsipfor other SIP endpoints and trunks.
- Docker Engine or compatible runtime.
- For external RTP media, open/forward a UDP range on your host (by default 10000–10020, see
rtp.conf) and the SIP signaling port(s) you plan to use. - If you need lots of parallel channels, increase the port range in
rtp.confand do not use the docker proxy for exposing these ports (usenetwork_mode: hostinstead). - Outbound DNS to query Google's DNS (used to detect the public IP) unless you set
EXTERNAL_IPyourself.
At container start, /docker-entrypoint.sh performs the following:
-
User/group remap (optional)
- If
ASTERISK_UIDandASTERISK_GIDare provided, the script changes the IDs of theasteriskuser and group (usermod/groupmod). This is useful to align file permissions with your host user when bind-mounting volumes.
- If
-
External IP detection (only if
/configexists)- If
EXTERNAL_IPis set, it is used as is. - Otherwise the script tries to detect your public IPv4 address:
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"'
- The result is exported as
EXTERNAL_IPfor later substitution. - If no address can be detected, the container exits with a non‑zero status. If your environment blocks that DNS query, set
EXTERNAL_IPexplicitly, or setIGNORE_EXTERNAL_IP_CHECK=trueif your config does not use${EXTERNAL_IP}.
- If
-
Configuration files Configuration can be done in two ways (they can also be mixed):
a) Config ingestion from
/config- If a directory
/configexists, every file under it is copied into/etc/asteriskpreserving relative paths. For example:/config/pjsip.conf→/etc/asterisk/pjsip.conf/config/pjsip.d/my-peer.conf→/etc/asterisk/pjsip.d/my-peer.conf
- Variable substitution is applied to all config files via
envsubst, except dialplan files:extensions.confand anything underextensions.d/are copied verbatim (no substitution) to avoid breaking${...}style Asterisk dialplan expressions.
- All other files have shell-style variables expanded using the container's environment (e.g.,
${EXTERNAL_IP},${SIP_BIND_PORT},${WHATEVER}that you define).
b) Config through volume mounts
- If you do not provide a
/configdirectory, you can mount your own config files directly. - Mount your config files for SIP, PJSIP, ARI and extensions into
/etc/asterisk/sip.d,/etc/asterisk/pjsip.d,/etc/asterisk/ari.dand/etc/asterisk/extensions.d. - The main config files
sip.conf,pjsip.conf,ari.confandextensions.confin/etc/asteriskinclude the files of these subdirectories.
- If a directory
-
Optional hooks
- If
/docker-entrypoint.d/exists, the script runs all executable files in it usingrun-partsbefore starting Asterisk. This is handy for last-mile tweaks.
- If
-
Ownership and start
- Key Asterisk directories are chowned to the runtime user (read-only mounts are skipped with a warning).
- Without arguments Asterisk is launched in the foreground as PID 1. If you pass a command (e.g.
docker run … cygnusnetworks/asterisk-usecallmanager bash), the steps above run first and then your command is executed instead of Asterisk.
Base configs are bundled under /etc/asterisk in the image (copied from this repo's config/). Any files you place in /config will override or augment those.
All config files are Debian default Asterisk config files, except the ones below.
For basic use cases, simply mount directory volumes to:
/etc/asterisk/sip.d/etc/asterisk/pjsip.d/etc/asterisk/extensions.d/etc/asterisk/ari.d
All *.conf files there will be read. If you need more control over configs, do a volume mount to /config. Files present there will be copied to /etc/asterisk after envsubst parsing.
| File | Content |
|---|---|
ari.conf |
ARI disabled by default, #tryinclude "ari.d/*.conf" |
sip.conf |
#tryinclude "sip.d/*.conf" |
pjsip.conf |
#tryinclude "pjsip.d/*.conf" |
extensions.conf |
#tryinclude "extensions.d/*.conf" |
asterisk.conf |
verbose = 5, debug = 3, autosystemname = yes |
logger.conf |
logs to the console (container stdout) |
modules.conf |
disables modules which produce load warnings (including the ARI modules) |
rtp.conf |
RTP port range 10000–10020 |
If you need to change the loaded modules (e.g. to enable ARI), override modules.conf with your own version.
Runtime (entrypoint) variables:
| Variable | Default | Description |
|---|---|---|
ASTERISK_USER |
asterisk |
User Asterisk runs as |
ASTERISK_GROUP |
same as user | Group Asterisk runs as |
ASTERISK_UID / ASTERISK_GID |
– | Remap the user/group IDs (both must be set) |
EXTERNAL_IP |
auto-detected | Public IPv4 address, available as ${EXTERNAL_IP} in config files |
IGNORE_EXTERNAL_IP_CHECK |
false |
true/1 skips the IP detection and does not exit if EXTERNAL_IP is unset |
ENTRYPOINT_DEBUG |
false |
true/1 traces the entrypoint script (set -x) |
Any additional variables you define can be used in your .conf files (expanded via envsubst), for example SIP_BIND_ADDR, SIP_BIND_PORT, LOCAL_NET.
Build-time variables (Docker build args):
| Argument | Description |
|---|---|
DEBIAN_VERSION |
Debian release of the base image (default: trixie) |
DEBIAN_SNAPSHOT |
snapshot.debian.org timestamp the Asterisk source package is fetched from |
ASTERISK_DEBIAN_VERSION |
Debian source version of the asterisk package (without epoch) |
PATCH_VERSION |
UCM patch version, e.g. 22.10.0 |
# EXTERNAL_IP: set explicitly if autodetect is blocked
# ASTERISK_UID/GID: optional UID/GID remap
# /config: configs to be processed/expanded
# 10000-10020/udp: RTP media range (adjust together with rtp.conf)
docker run -d \
--name asterisk \
-e EXTERNAL_IP=203.0.113.10 \
-e ASTERISK_UID=$(id -u) -e ASTERISK_GID=$(id -g) \
-v $(pwd)/my-asterisk-config:/config:ro \
-p 5060:5060/udp \
-p 5060:5060/tcp \
-p 10000-10020:10000-10020/udp \
cygnusnetworks/asterisk-usecallmanager:latestUse ghcr.io/cygnusnetworks/asterisk-usecallmanager:latest to pull from the GitHub Container Registry instead.
Notes:
- If you don't mount
/config, the image's baked-in configs are used. - You can mount
/etc/asteriskdirectly instead, but/configis recommended so you benefit from envsubst. - Open the Asterisk CLI with
docker exec -it asterisk asterisk -r.
services:
asterisk:
image: cygnusnetworks/asterisk-usecallmanager:latest
# image: ghcr.io/cygnusnetworks/asterisk-usecallmanager:latest # alternative image source
container_name: asterisk
environment:
# Provide EXTERNAL_IP if your DNS cannot resolve via Google's o-o.myaddr mechanism
EXTERNAL_IP: ${EXTERNAL_IP:-}
# Optional user remap to match host user
ASTERISK_UID: ${UID:-1000}
ASTERISK_GID: ${GID:-1000}
# Any variables you reference inside your *.conf files
LOCAL_NET: 192.168.1.0/24
SIP_BIND_ADDR: 0.0.0.0
SIP_BIND_PORT: "5060"
volumes:
- ./my-asterisk-config:/config:ro
ports:
- "5060:5060/udp"
- "5060:5060/tcp"
- "10000-10020:10000-10020/udp"
restart: unless-stoppedMake sure you understand the implications of your network setup and possible IPv4 NAT scenarios.
/docker-entrypoint.sh— main launcher (see “How configuration works”)./docker-entrypoint.d/— optional directory; any executable files placed here will run (viarun-parts) before Asterisk starts. Use this for last-minute file generation or tweaks.
- UCM-related features and
chan_sipchanges/backports in Asterisk 22 have caveats. Review: https://usecallmanager.nz/change-log.html - Prefer
pjsipfor other SIP endpoints or SIP trunks. - Pin your image to a
vX.Y.Ztag instead oflatestand test upgrades in a staging environment. - The default
asterisk.confenables verbose and debug output; lowerverbose/debugfor production.
- External IP detection fails: set
EXTERNAL_IPmanually (e.g., with compose or-e). Ensure outbound DNS works if you rely on autodetect. - No audio or one-way audio: confirm the RTP port range is published from host to container and your firewall/NAT rules are correct; ensure your SIP signaling advertises the correct public address (use
${EXTERNAL_IP}inpjsip.conf/sip.conf). - Variable not expanded: remember that
envsubstruns only on non-dialplan files; dialplan files (extensions.conf/extensions.d/*) are copied verbatim.
Example (adjust the values):
docker build \
--build-arg DEBIAN_VERSION=trixie \
--build-arg DEBIAN_SNAPSHOT=20260615T023212Z \
--build-arg ASTERISK_DEBIAN_VERSION=22.10.0+dfsg+~cs6.17.60671434-1 \
--build-arg PATCH_VERSION=22.10.0 \
-t asterisk-usecallmanager:22.10.0 .PATCH_VERSIONmust exist ascisco-usecallmanager-<version>.patchin usecallmanagernz/patches.ASTERISK_DEBIAN_VERSIONmust be a Debian source version ofasterisk(see the snapshot.debian.org package page) andDEBIAN_SNAPSHOTa snapshot timestamp that contains it..github/scripts/update-version.shdetermines all three values automatically for the newest patch and rewrites the Dockerfile.
The Docker build scripts and configs in this repository are licensed under the GNU General Public License v2.0, like Asterisk itself (several config files are derived from the Asterisk sample configs). Consult the Debian packaging and the UseCallManager project for their respective licenses.
Many thanks to the UseCallManager project for providing the patches and the maintainer Gareth Palmer.
See: https://github.com/sponsors/usecallmanagernz for sponsorship of the usecallmanager project.