Kamailio Linux VoIP

RTPengine – Installation & Configuration

Installation & basic configuration of the Sipwise NGCP rtpengine

This post was updated December 2021 and updated for Debian 11.

There’s a few RTP Proxies out there (rtpproxy/mediaproxy) but rtpengine from Sipwise has simplicity and flexibility that makes you wonder how you ever used the others.

Some of it’s more impressive features:

  • Bridge Encrypted (SRTP) & Plaintext RTP Sessions
  • ICE Bridge
  • Farmable loads (Can have a pool of RTPengine instances)
  • Recording of Media Streams (In a not stupid – accidentally-fill-up-the-disk way)
  • Transcoding
  • Media repacketization


This package isn’t in the default Ubuntu/Debian repos, so we’ll get it from the git repo:

git clone
cd rtpengine 

Next we’ll need to install some dependencies:

apt-get install debhelper default-libmysqlclient-dev gperf iptables-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbencode-perl libcrypt-openssl-rsa-perl libcrypt-rijndael-perl libhiredis-dev libio-multiplex-perl libio-socket-inet6-perl libjson-glib-dev libdigest-crc-perl libdigest-hmac-perl libnet-interface-perl libnet-interface-perl libssl-dev libsystemd-dev libxmlrpc-core-c3-dev libcurl4-openssl-dev libevent-dev libpcap0.8-dev markdown unzip nfs-common dkms libspandsp-dev libiptc-dev libmosquitto-dev python3-websockets

The dependency you’ll get stuck on will be the G.729 library, which we have to manually compile.


curl$VER >bcg729_$VER.orig.tar.gz

tar zxf bcg729_$VER.orig.tar.gz 

cd bcg729-$VER 

git clone debian 

dpkg-buildpackage -us -uc -sa -b -rfakeroot

cd ../

dpkg -i libbcg729-*.deb

Now let’s check the RTPengine dependencies again:


If you get an empty output you’re good to start building the packages:

dpkg-buildpackage  --no-sign

If that completed sucessfully in the directory above you should have a bunch of .deb files:

cd ../

dpkg -i ngcp-rtpengine-daemon_*.deb ngcp-rtpengine-iptables_*.deb ngcp-rtpengine-kernel-dkms_*.deb

Getting it Running

Now we’ve got RTPengine installed let’s setup the basics,

There’s an example config file we’ll copy and edit:

mv /etc/rtpengine/rtpengine.sample.conf /etc/rtpengine/rtpengine.conf

vi /etc/rtpengine/rtpengine.conf

We’ll uncomment the interface line and set the IP to the IP we’ll be listening on:

Once we’ve set this to our IP we can start the service:

/etc/init.d/ngcp-rtpengine-daemon start

All going well it’ll start and rtpengine will be running.

You can learn about all the startup parameters and what everything in the config means in the readme.

Want more RTP info?

If you want to integrate RTPengine with Kamailio take a look at my post on how to set up RTPengine with Kamailio.

For more in-depth info on the workings of RTP check out my post RTP – More than you wanted to Know

10 replies on “RTPengine – Installation & Configuration”

Excellent, still good in 2021 with one slight change, there is now a dependancy of libwebsockets-dev


Hi Nick,

thanks a lot for all your posts and this interesting website.
I am a newbie with Kamailio and would be thankful for a post about integrating Kamailio with a media relay (asterisk).

I am not sure if the article at “” is the right one for me. I only want Kamailio to query my Database (not asterisk) to authenticate the users and engage asterisk as a B2BUA in the middle of RTP Dialouge between caller and callee.

Unfortunately, I could not install the rtpengine on my ubuntu machine or centos. This is why I would like to use asterisk as a Media Relay.

Best regards

Hi Abdul,
Truth is if you’re struggling to get RTPengine running you may find Kamailio to be an uphill battle,
Asterisk isn’t a media relay, it’s got to be in the signaling path as well, which may lead to more headaches in the future, keep that in mind,
Good luck!

Hi Nick,

(Maybe you want to check the link “how to set up RTPengine with Kamailio”) Besides that great posts! Keep it up!

Hi Nick ,

I am getting the following errors when i try to install RTP Engine and execute the step dpkg-buildpackage -us -uc -sa -b -rfakeroot . Any thoughts ?

make[1]: Leaving directory ‘/root/bcg729-1.0.4/obj-x86_64-linux-gnu’
dh_install -O–buildsystem=cmake
dh_install: Cannot find (any matches for) “usr/lib/*/pkgconfig/*” (tried in ., debian/tmp)

dh_install: libbcg729-dev missing files: usr/lib/*/pkgconfig/*
dh_install: missing files, aborting
make: *** [debian/rules:13: binary] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2

Thanks and regards
Abdul Rasheed

Same thing here. The thing is iptables-dev are not available for ubuntu 20 and higher, no way to install it either. This prolly gives error “/usr/libexec/rtpengine/rtpengine-get-table: not found”.
Can’t find a way around it yet

Leave a Reply

Your email address will not be published. Required fields are marked *