Sign inSign up

malan5/malan2_asterisk

By malan5

•Updated 6 months ago

Asterisk PBX on Alpine Linux with PJSIP, custom dial plan, and RTP port range pre-configured.

Image
Networking
1

482

malan5/malan2_asterisk repository overview

⁠malan2_asterisk

A containerized Asterisk PBX image built on Alpine Linux, pre-configured with PJSIP support, a custom entrypoint, and a large RTP port range — ready to drop into your VoIP infrastructure.


⁠What's Inside

  • Asterisk installed via Alpine's apk with asterisk-sample-config
  • PJSIP configured via a modular pjsip_local.conf include pattern
  • Custom extensions.conf and pjsip_local.conf baked in
  • Startup instructions script via /docker-entrypoint.d/setup-instructions.sh
  • Custom entrypoint at /entrypoint.sh
  • Locale set to C.UTF-8

⁠Quick Start

docker pull malan5/malan2_asterisk:latest

docker run -d \
  --name asterisk \
  -p 5060:5060/tcp \
  -p 5060:5060/udp \
  -p 10000-20000:10000-20000/udp \
  malan5/malan2_asterisk:latest

Tip: For production SIP/RTP use, consider --network host to avoid NAT issues inside Docker.


⁠Exposed Ports

PortProtocolPurpose
5060TCP & UDPSIP signaling
10000–20000UDPRTP media streams

The image explicitly exposes the full 10000–20000 UDP range for RTP media to support concurrent calls without port conflicts.


⁠Persistent Volumes

The following paths are declared as volumes for persistent data:

PathPurpose
/var/lib/asterisk/soundsAudio/sound files
/var/lib/asterisk/keysTLS/encryption keys
/var/lib/asterisk/phoneprovPhone provisioning files
/var/spool/asteriskCall spooling (voicemail, etc.)
/var/log/asteriskAsterisk logs

Mount these to preserve data across container restarts:

-v /path/to/sounds:/var/lib/asterisk/sounds \
-v /path/to/logs:/var/log/asterisk \
-v /path/to/spool:/var/spool/asterisk

⁠Configuration

To customize your dial plan or SIP peers, mount your own config files:

-v $(pwd)/extensions.conf:/etc/asterisk/extensions.conf \
-v $(pwd)/pjsip_local.conf:/etc/asterisk/pjsip_local.conf

The image appends #include pjsip_local.conf into pjsip.conf at build time, so your local PJSIP overrides are automatically picked up.


⁠Environment

VariableValue
LANGC.UTF-8
LC_ALLC.UTF-8

⁠Entrypoint & CMD

The container starts with /entrypoint.sh and runs Asterisk in foreground mode (asterisk -f) by default.

Tag summary

Content type

Image

Digest

sha256:91212ed91…

Size

16.4 MB

Last updated

6 months ago

docker pull malan5/malan2_asterisk