Deploying a Kamailio solution with RTPengine in Docker with automation can be achieved using Docker Compose, a tool for defining and running multi-container Docker applications.
Here are the general steps to deploy this solution:
- Create a directory for your Docker Compose project and navigate into it.
- Create a
docker-compose.yml
file in this directory with the following content:
codeversion: '3'
services:
kamailio:
image: kamailio/kamailio:latest
ports:
- "5060:5060/udp"
volumes:
- ./kamailio:/etc/kamailio
environment:
- DBENGINE=MYSQL
- DBHOST=db
- DBNAME=kamailio
- DBRWUSER=kamailio
- DBRWPW=kamailiorw
- DBROOTUSER=root
- DBROOTPW=rootpw
- DBUSER=kamailio
- DBPW=kamailiopw
- RTPENGINE=udp:127.0.0.1:22222
- RTPPROXY_SOCK=/var/run/rtpengine/rtpengine.sock
- RTPEXTRAS=--no-log
depends_on:
- db
- rtpengine
rtpengine:
image: bluetelecomsolutions/rtpengine:latest
privileged: true
ports:
- "22222:22222/udp"
- "22223:22223/tcp"
volumes:
- ./rtpengine:/etc/rtpengine
command: rtpengine --interface=eth0 --listen-ng=127.0.0.1:22222 --listen-tcp=127.0.0.1:22223 --foreground
db:
image: mariadb:latest
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=rootpw
- MYSQL_DATABASE=kamailio
- MYSQL_USER=kamailio
- MYSQL_PASSWORD=kamailiopw
This file defines three services: Kamailio, RTPengine, and a MariaDB database for Kamailio to use. Kamailio will use RTPengine for media processing.
- Create the necessary directories for the
volumes
in thedocker-compose.yml
file:
$ mkdir kamailio rtpengine db
- Create the Kamailio configuration file
kamailio.cfg
in thekamailio
directory. You can find an example configuration file in the Kamailio documentation. - Create the RTPengine configuration file
rtpengine.conf
in thertpengine
directory. You can find an example configuration file in the RTPengine documentation. - Run the following command to start the Kamailio, RTPengine, and database containers:
$ docker-compose up -d
This will start the containers in the background.
- Check the status of the containers:
$ docker-compose ps
This should show that all three containers are running.
You now have a Kamailio solution with RTPengine running in Docker with automation. You can test the solution by sending SIP traffic to Kamailio and verifying that RTP traffic is processed by RTPengine.