Asterisk in Docker: Difference between revisions
Brian Wilson (talk | contribs) mNo edit summary |
Brian Wilson (talk | contribs) |
||
Line 24: | Line 24: | ||
== Configuration == | == Configuration == | ||
Put environment settings into Dockerfile and | Put environment settings into Dockerfile and add j2 config files that I created for [[Fogg]]. | ||
add j2 config files that I created for [[Fogg]]. | |||
The configuration is entirely file based because my home phone system is relatively static. | |||
The docker-asterisk container configures Asterisk based on templates | The docker-asterisk container configures Asterisk based on templates | ||
Line 31: | Line 32: | ||
cd source/docker/docker-asterisk | cd source/docker/docker-asterisk | ||
''edit Dockerfile to adjust environment'' | |||
cd etc_asterisk | cd etc_asterisk | ||
''edit files'' | ''edit files'' | ||
Line 36: | Line 38: | ||
docker rm -f asterisk | docker rm -f asterisk | ||
docker build -t asterisk . | docker build -t asterisk . | ||
== Launch server == | |||
docker run -it --net=host --expose=10000-10101 --name=asterisk asterisk | docker run -it --net=host --expose=10000-10101 --name=asterisk asterisk | ||
Revision as of 04:48, 6 November 2018
Read the Docker page if you don't know what Docker is.
Notes on building a current executable, the old way: Building Asterisk
Building a docker container
I used with the github respoke/asterisk image as my starting point.
git clone [email protected]:respoke/asterisk-docker.git
Then I broke respoke's image out into two parts, so that it would build faster.
Currently I work logged into Bellman.
I have a Debian Stretch container wildsong/build that has all the tools in it, when the container builds it downloads sources and configures and compiles them.
cd source/docker/docker-build
Once the 'build' container is working, check in changes to github and a new copy will build at hub.docker.com.
Configuration
Put environment settings into Dockerfile and add j2 config files that I created for Fogg.
The configuration is entirely file based because my home phone system is relatively static.
The docker-asterisk container configures Asterisk based on templates in etc_asterisk.
cd source/docker/docker-asterisk edit Dockerfile to adjust environment cd etc_asterisk edit files cd .. docker rm -f asterisk docker build -t asterisk .
Launch server
docker run -it --net=host --expose=10000-10101 --name=asterisk asterisk
Console
You can connect to the Asterisk console directly with this command
docker exec -it asterisk asterisk -r
Or you can connect the usual way via a bash shell
docker exec -it asterisk bash
tcpdump -n not port 22 and not arp and not host 192.168.123.159
Connected phones
I don't know how to see what phones are registered with pjsip!??
I started a separate page for it, PJSIP.