Asterisk with usecallmanager.nz Patch for Cisco IP Phones
2.7K
Container image that builds and runs Asterisk with the cisco-usecallmanager patchset applied, plus defaults for SIP/PJSIP to include multiple config files. Designed to let you drop your own Asterisk config in at runtime and have variables expanded automatically.
This image with version 22.x is not yet intended for production. See https://usecallmanager.nz/change-log.html for details regarding chan_sip backport including changes to chan_sip.
*.conf files from /config into /etc/asterisk,envsubst) on those copied files (except dialplan files)This image consumes the patchset from the UseCallManager project:
Hints and current state as of Asterisk 22.x (Nov 2025):
chan_sip in the UCM patches. Read the change log linked above and validate your configuration.chan_sip might be suitable for connection to Cisco Phones, pjsip for other SIP endpoints.Note: This repository’s Dockerfile currently builds against Asterisk Debian source version set by ARG ASTERISK_DEBIAN_VERSION (default in this repo points to 22.6.0 currently) on Debian Trixie.
EXTERNAL_IP yourself.At container start, /docker-entrypoint.sh performs the following:
User/group remap (optional)
ASTERISK_UID and ASTERISK_GID are provided, the script recreates the asterisk user and group with those IDs. This is useful to align file permissions with your host user when bind-mounting volumes.External IP detection
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | sed 's/\"//g'
EXTERNAL_IP for later substitution./config directory, the script exits with a non‑zero status. If your environment blocks that DNS query, set EXTERNAL_IP explicitly.Configuration files
a) Config ingestion from /config
/config exists, every *.conf file under it is copied into /etc/asterisk preserving relative paths. For example:
/config/pjsip.conf → /etc/asterisk/pjsip.conf/config/pjsip.d/my-peer.conf → /etc/asterisk/pjsip.d/my-peer.confenvsubst, except dialplan files:
extensions.conf or anything under extensions.d/ are copied verbatim (no substitution) to avoid breaking ${...} style Asterisk dialplan expressions..conf 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 volumes files
/config directory, you can also mount your own config files at runtimeOptional hooks
/docker-entrypoint.d/ exists, the script runs all executable parts using run-parts before starting Asterisk. This is handy for last-mile tweaks.Ownership and start
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 defined with default values except the ones below.
For basic use cases, simply mount directory volumes to:
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.
ari.conf - defines tryingclude ari.d/*.conf - ari disabled by defaultsip.conf - defines tryingclude sip.d/*.confpjsip.conf - defines tryingclude pjsip.d/*.confextensions.conf - defines tryingclude extensions.d/*.confasterisk.conf - defines verbose = 5, debug = 3, autosystemname = yeslogger.conf - sets logging to stdoutmodules.conf - disables modules which produce load warningsAll other config files are debian default asterisk config files. If you need to change the loaded modules, override the modules.conf file by a volume mount.
Runtime (entrypoint) variables:
ASTERISK_USER (default: asterisk)ASTERISK_GROUP (default: same as user)ASTERISK_UID / ASTERISK_GID (optional remap)EXTERNAL_IP (optional; auto-detected if not set and /config exists).conf files (expanded via envsubst). For example: SIP_BIND_ADDR, SIP_BIND_PORT, LOCAL_NET, etc.Build-time (Docker build args):
DEBIAN_VERSION (default: trixie)ASTERISK_DEBIAN_VERSION (Debian source version string)PATCH_VERSION (UCM patch version, e.g., 22.6.0)
docker run \
--name asterisk \
-e EXTERNAL_IP=203.0.113.10 \ # set explicitly if autodetect is blocked
-e ASTERISK_UID=$(id -u) -e ASTERISK_GID=$(id -g) \ # optional UID/GID remap
-v $(pwd)/my-asterisk-config:/config:ro \ # configs to be processed/expanded
-p 5060:5060/udp \ # SIP signaling udp
-p 5060:5060/tcp \ # SIP signaling
-p 10000-10020:10000-10020/udp \ # RTP media range (adjust as needed)
cygnusnetworks/asterisk-usecallmanager:latest # or: ghcr.io/CygnusNetworks/asterisk-usecallmanager:latest
Notes:
/config, the image’s baked-in configs are used./etc/asterisk directly instead, but /config is recommended so you benefit from envsubst.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-stopped
Make 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 (via run-parts) before Asterisk starts. Use this for last-minute file generation or tweaks.chan_sip changes/backports have caveats. Review: https://usecallmanager.nz/change-log.htmlpjsip for other SIP endpoints or sip trunksEXTERNAL_IP manually (e.g., with compose or -e). Ensure outbound DNS works if you rely on autodetect.${EXTERNAL_IP} in pjsip.conf/sip.conf).envsubst runs only on non-dialplan .conf files; dialplan files (extensions.conf/extensions.d/*) are copied verbatim.docker build \
--build-arg DEBIAN_VERSION=trixie \
--build-arg ASTERISK_DEBIAN_VERSION=22.6.0~dfsg+~cs6.15.60671435-1 \
--build-arg PATCH_VERSION=22.6.0 \
-t asterisk-usecallmanager:22.6 .
Adjust the args to match versions provided by Debian and the usecallmanager patchset you want to consume. Make sure that the debian archive currently hold the ASTERISK_DEBIAN_VERSION which you specified. See: https://packages.debian.org/sid/asterisk for Debian unstable (sid) packages.
This repository contains Docker build scripts and example configs. Asterisk itself is licensed under GPLv2; consult 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.
Content type
Image
Digest
sha256:f073e359e…
Size
135.8 MB
Last updated
3 months ago
docker pull cygnusnetworks/asterisk-usecallmanager