This Document covers asterisk basic installation on docker. Since till now there is no official asterisk image on Docker hub we will use Debian core to install the asterisk.
Prerequisites Linux host to install docker, Internet connectivity and docker account to download docker images.
1. Installing Docker (Ensure your Internet connectivity)
- Centos 7
#wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm#rpm -ivh epel-release-latest-7.noarch.rpm
#yum install docker
- Install Docker on RHEL and CentOS 6
# yum install epel-release
# yum install docker-io
# systemctl start docker
# systemctl status docker
# systemctl enable docker
# service docker start
# service docker status
# chkconfig docker on
# yum install docker-io
2. Start Docker
- Centos 7
# systemctl start docker# systemctl status docker
# systemctl enable docker
- On RHEL/CentOS 6
# service docker start
# service docker status
# chkconfig docker on
Our Asterisk PBX will reside on Debain, So first we must set our Debian container to install asterisk. (Please ensure that you docker is up running without any issue, If you wish to verify you docker engine please use hello world application "# docker run hello-world" )
If everything went well as we expected, you will see something like this.
This might take some time.
4. Now Lets run our New Debian container using pulled image
First we shall get the Debian image ID by using# docker images
You will get someting like this (This will show your all docker images),
Now we shall Start our container using Our Debian image (My Debian image ID appears to be a20fd0d59cf1 )
# docker run -it --name=<Container Name> --network=host <Image ID>
After creating your Debian container you will be inside the Container.
5. Install Asterisk
Update your Debain distribution# apt-get update
Install asterisk
# apt-get -y install asterisk
This will take some time to install the packages.
Now After completion of the installation, we might configure the asterisk.
6. Asterisk Configuration
Configure the asterisk RTP Port Limitation.#vim /etc/asterisk/rtp.conf
(Use #apt-get install vim-nox To Install VIM)
Change rtpstart and rtpend parameters.
Save and Exit
This will help us wo bind the ports when we running our Asterisk container.
Now We shall start the asterisk.
Use # rasterisk to check if you can access the Asterisk CLI.
Type exit and Hit Enter to exit Asterisk CLI
Now we shall commit our changes to keep our container configuration.
7. Committing the Container configuration
use Ctrl + p + q to detach from the container
Now issue # docker ps command to see running containers.
# docker commit -m "<Commit Message>" -a "<author's name>" <ContainerID or Name to commit> <Repository>:<tag>
Now you can check your committed Docker images by using # docker images
8. Run our Committed Image
docker run -itd --name=PBX-Asterisk --network=host -p 5060:5060/tcp -p 5060:5060/udp -p 10010:10010/udp -p 10011:10011/udp -p 10012:10012/udp -p 10013:10013/udp -p 10014:10014/udp -p 10015:10015/udp -p 10016:10016/udp -p 10017:10017/udp -p 10018:10018/udp -p 10019:10019/udp -p 10020:10020/udp <Commited Docker ImageID to run>I've used the --name option to assign a name to my container, and use -p to map the container port with host port.
9. Configure the sip peers
Lets jump in to our asterisk container
You can use
or
Let's configure our sip peers in # vim /etc/asterisk/sip.conf
[100]
secrete=abc123
context=home
type=friend
allow=ulaw,alaw
host=dynamic
10. Dialplan configuration
11. Complete Asterisk configuration
Now we shall start the asterisk if we already haven't,
Jump to Asterisk CLI
# rasterisk
Reload the sip and dialplans
localhost*CLI> sip reload
localhost*CLI> dialplan reload
You can connect youe sip phones now.....
Note that, If you have iptables service aka firewalls up on your host machine you may need to do some changes accordance.
Excellent Blog! I would Thanks for sharing this wonderful content.its very useful to us.
ReplyDeleteI gained many unknown information, the way you have clearly explained is really fantastic.keep posting such useful information.
Full Stack Training in Chennai | Certification | Online Training Course
Full Stack Training in Bangalore | Certification | Online Training Course
Full Stack Training in Hyderabad | Certification | Online Training Course
Full Stack Developer Training in Chennai | Mean Stack Developer Training in Chennai
Full Stack Training
Full Stack Online Training
I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! asterisk pbx download
ReplyDeleteAsterisk On Docker >>>>> Download Now
ReplyDelete>>>>> Download Full
Asterisk On Docker >>>>> Download LINK
>>>>> Download Now
Asterisk On Docker >>>>> Download Full
>>>>> Download LINK UL