See the Dockerfile.
At build time, example sip.conf and extensions.conf files are copied into the container; at run time, the secret is replaced with the contents of the SECRET file (if not empty) and Asterisk is started.
docker run --rm -it --network=host deanturpin/asterisk
Using the CLI tool rasterisk.
docker exec -it <containerid> rasterisk
> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
101 (Unspecified) D Auto (No) No 0 UNKNOWN
102 (Unspecified) D Auto (No) No 0 UNKNOWN
103 (Unspecified) D Auto (No) No 0 UNKNOWN
104 (Unspecified) D Auto (No) No 0 UNKNOWN
4 sip peers [Monitored: 0 online, 4 offline Unmonitored: 0 online, 0 offline]
To reveal the secrets.
!cat /etc/asterisk/sip.conf
Clearly leaving the password as default is a bit of a security hole so you can override it a run time with something unique to your host.
docker run --rm -it --network=host -v /etc/machine-id:/app/SECRET asterisk
Equally, you could just map in your own sip.conf and extensions.conf files at run time.
Clone the repo, then just type make to build and run and container locally.
To assist with your network discovery.
# Start the container but just run bash
make bash
# Dump the network interfaces of the container without running Asterisk
make ip
# Find your endpoints
docker run -it --rm --network=host deanturpin/shh
# Check your ports are open
ss -an | grep 5060
Content type
Image
Digest
sha256:cc70143ac…
Size
140.9 MB
Last updated
5 months ago
docker pull deanturpin/asterisk