We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install RTPProxy from source on Ubuntu 20.04/18.04/16.04

Learn how to – Install RTPProxy from source on Ubuntu 20.04/18.04/16.04.

RTPProxy is an open source high-performance proxy which helps you bring control to your VoIP network and optimize traffic flow. RTPProxy is designed to be used in conjunction with any other SIP proxy like Kamailio. This tool was originally developed by Maxim Sobolyev in 2003 for the purpose of enabling VoIP calls to/from SIP User Agents located behind NAT firewalls, and now is being actively maintained by the Sippy Software, Inc.

Features of RTPProxy

Some of the features provided by RTPProxy include:

  • VoIP calls to traverse NAT firewalls systems
  • Packet flow optimization
  • Relaying of voice, video or any RTP stream of data
  • Playing of pre-encoded in-band announcements
  • Re-framing of RTP payload
  • Routing VoIP to VPN links routing
  • Real-time stream copying

Install RTPProxy from Source on Ubuntu 20.04/18.04/16.04

This section is for the installation of RTPProxy from Source on Ubuntu 18.04 server. We’re going to download and build RTPProxy from source code. Pre-requisites for this build are git and build-essential packages.

sudo apt update
sudo apt install build-essential git cmake

Download the project from Github.

$ cd ~/
$ git clone -b master https://github.com/sippy/rtpproxy.git
Cloning into 'rtpproxy'...
remote: Enumerating objects: 14035, done.
remote: Total 14035 (delta 0), reused 0 (delta 0), pack-reused 14035
Receiving objects: 100% (14035/14035), 6.48 MiB | 274.00 KiB/s, done.
Resolving deltas: 100% (10178/10178), done.

$ git -C rtpproxy submodule update --init --recursive
Submodule 'libucl' (https://github.com/sippy/libucl.git) registered for path 'external/libucl'
Submodule 'hepconnector' (https://github.com/sippy/hepconnector.git) registered for path 'hepconnector'
Submodule 'libelperiodic' (https://github.com/sobomax/libelperiodic.git) registered for path 'libelperiodic'
Cloning into '/srv/rtpproxy/external/libucl'...
Cloning into '/srv/rtpproxy/hepconnector'...
Cloning into '/srv/rtpproxy/libelperiodic'...
Submodule path 'external/libucl': checked out '498117715660a1228b739d52903b246d11bbccef'
Submodule path 'hepconnector': checked out '85696e9915396068955e656695e5b1287b5b7bbd'
Submodule path 'libelperiodic': checked out '6f203173baece64c145a374928c9016878518abb'

Once downloaded, cdinto directoryrtpproxy and build the software.

cd rtpproxy
./configure

Type make to compile the package.

make

Finally, type make install to install the programs and any data files and
documentation.

sudo make install

On running,make install command, rtppoxy binary is generated and copied to /usr/local/bin/rtpproxy

Add rtpproxy system user and group:

sudo groupadd --system rtpproxy
sudo useradd -s /sbin/nologin --system -g rtpproxy rtpproxy

Create init script:

sudo vim /etc/init.d/rtpproxy

Add the following content:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          rtpproxy
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: RTP Proxy
# Description:       Relay for VoIP media streams
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpproxy
DESC="RTP relay"
DAEMON=/usr/bin/$NAME
USER=$NAME
GROUP=$USER
PIDFILE="/var/run/$NAME/$NAME.pid"
PIDFILE_DIR=`dirname $PIDFILE`
CONTROL_SOCK="unix:$PIDFILE_DIR/$NAME.sock"

test -x $DAEMON || exit 0
umask 002

. /lib/lsb/init-functions

# Include defaults if available
if [ -f /etc/default/$NAME ] ; then
	. /etc/default/$NAME
fi

DAEMON_OPTS="-s $CONTROL_SOCK -u $USER:$GROUP -p $PIDFILE $EXTRA_OPTS"

if [ ! -d "$PIDFILE_DIR" ];then
	mkdir "$PIDFILE_DIR"
    chown $USER:$GROUP "$PIDFILE_DIR"
fi

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
	echo "$NAME."
	;;
  stop)
	echo -n "Stopping $DESC: "
	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
	echo "$NAME."
	;;
  status)
	echo -n "Status $DESC: "
	PID=$(cat $PIDFILE)
	kill -0 $PID
	rc=$?
	# Check exit code
	if [ "$rc" -ne 0 ]
	then
		echo "$NAME is NOT running."
		exit 7
	else
		echo "$NAME is running with PID: $PID"
	fi
	;;
  restart|force-reload)
	echo -n "Restarting $DESC: "
	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
	sleep 1
	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
	echo "$NAME."
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0

Make the script executable:

sudo chmod +x /etc/init.d/rtpproxy

Create sock directory:

sudo mkdir -p /var/run/rtpproxy
sudo chown -R rtpproxy:rtpproxy -R /var/run/rtpproxy/

Start rtpproxy service and enable it to start on boot:

sudo systemctl daemon-reload
sudo systemctl start rtpproxy.service
sudo systemctl enable rtpproxy.service

Check service status to confirm that it is running:

$ systemctl status rtpproxy
● rtpproxy.service - LSB: RTP Proxy
     Loaded: loaded (/etc/init.d/rtpproxy; generated)
     Active: active (exited) since Sun 2020-05-03 14:55:46 UTC; 23s ago
       Docs: man:systemd-sysv-generator(8)
      Tasks: 0 (limit: 2344)
     Memory: 0B
     CGroup: /system.slice/rtpproxy.service

May 03 14:55:46 ubuntu20 systemd[1]: Starting LSB: RTP Proxy...
May 03 14:55:46 ubuntu20 systemd[1]: Started LSB: RTP Proxy.

Kudos!, you have successfully installed RTPProxy on Ubuntu 20.04/18.04/16.04 Linux machine.

Cart

Your Cart is Empty

Back To Shop