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:

  1. Create a directory for your Docker Compose project and navigate into it.
  2. 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.

  1. Create the necessary directories for the volumes in the docker-compose.yml file:
$ mkdir kamailio rtpengine db
  1. Create the Kamailio configuration file kamailio.cfg in the kamailio directory. You can find an example configuration file in the Kamailio documentation.
  2. Create the RTPengine configuration file rtpengine.conf in the rtpengine directory. You can find an example configuration file in the RTPengine documentation.
  3. Run the following command to start the Kamailio, RTPengine, and database containers:
$ docker-compose up -d

This will start the containers in the background.

  1. 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.