Kamailio NATS VoIP

kamailio: nats module

I recently published a new module for kamailio which allows it to connect to NATS and consume messages using queue groups NATS is a very cool distributed messaging system. One of my favorite things about NATS is, there are no brokers and it’s extremely easy to setup. You can setup a nats-server cluster in about […]


freeswitch container from scratch using DIND

In this post, I’m going to demonstrate how to build a docker container from a scratch image that will run FreeSWITCH. I’ve always liked scratch because it’s the most minimal docker image available, and in my mind, that really meshes well with the entire concept of docker containers. But I’ll give a bit of my […]

Kamailio SIP VoIP

kamailio: controlling presence with new module `pua_json`

I recently submitted a new module to the kamailio project which adds an interface to update/control presence records using json. Effectively, you can turn on/off a phone’s Busy Lamp Field (BLF) by sending an http request containing json body to kamailio. The following is a quick guide on how to set up kamailio to accept […]

High-Availability Kamailio keepalived SIP VoIP

kamailio high availability using keepalived

This is a quick post on how to use keepalived to setup high-availability on two kamailio machines. In this setup there will be a “primary” and “secondary” node. Each node will be running kamailio and keepalived with a “shared” or sometimes referred to as a “floating” IP address. The idea is that each node will […]


Kamailio and FreeSWITCH on the same server with NSQ and JANSSON-RPC

This post will demonstrate how to run FreeSWITCH and Kamailio on a single server. FreeSWITCH will handle authentication and act as registrar while Kamailio will handle presence updates using the NSQ module. You might be wondering why this setup would be useful. The reason we found, is that FreeSWITCH is not so great at handling […]

Dovecot Email Postfix SMTP

Setup an SMTP server with user authentication using postgres, postfix, and dovecot on Debian 8

Please note: this tutorial assumes postgres is already setup and configured on the machine. Install & configure the dovecot and postfix: apt-get install dovecot-core dovecot-pgsql postfix -y Provision the smtp database in postgres: su -c “psql -c \”CREATE USER smtp WITH PASSWORD ‘smtp’;\”” postgres su -c “psql -c \”CREATE DATABASE smtp WITH OWNER=smtp;\”” postgres Encrypt […]

Asterisk High-Availability Kamailio Load Balancer RTP RTPEngine SIP VoIP

RTPEngine with Kamailio as Load-balancer and IP Gateway

This post explains how to setup Kamailio as an SBC and IP Gateway. We are using Debian 8 in this example. It uses Kamailio’s dispatcher module to distribute calls to Asterisk. It uses RTPEngine to proxy media to & from the public internet across the LAN to Asterisk. This is a powerful setup as you […]

Corosync Failover High-Availability Kamailio Pacemaker SIP VoIP

Kamailio: High-Availability/Failover with Corosync and Pacemaker on Debian 7

In this setup, we will have 2 Kamailio servers, referred to as ‘nodes’. One will be active and one will standby. There is a 3rd ‘floating’ IP that is moved to which ever node is active. Kamailio should be configured to use the floating IP. In this example, the nodes are: kam01: kam02: […]

Kamailio RTP RTPProxy SIP VoIP

RTPProxy: Compiling & Installing on Debian 8

cd /usr/src/ git clone cd rtpproxy ./configure make make install cp scripts/rtpproxy.init.debian /etc/init.d/rtpproxy chmod +x /etc/init.d/rtpproxy sed -i “s/DAEMON=\/usr\/bin\/rtpproxy/DAEMON=\/usr\/local\/bin\/rtpproxy/g” /etc/init.d/rtpproxy cat > /etc/default/rtpproxy <<EOT # Defaults for rtpproxy # I like to use same user as Kamailio when running on Kamailio box USER=”kamailio” GROUP=”kamailio” PIDFILE=”/var/run/” # replace with your network interface IP address LISTEN_ADDR= […]


FreeSWITCH: High call volume alert script

I was tasked to come up with a way to monitor for high call volume in FreeSWITCH. I came up with this here is a simple script that will check the channel count and email me if it’s greater than $MAX_CALLS   #!/bin/bash MAX_CALLS=100 CHANNEL_COUNT=$(/usr/bin/fs_cli -x “show channels count” | awk ‘/total/ {print $1}’) if […]