Installing webrtc2sip on Ubuntu 12.04

Note: this page is unmaintened and could contain incorrect information. As I am no longer involved in the telco business I won’t update this article anymore. I will also not respond to any personal e-mail with regard to this article.


  1. Introduction
  2. The hard way: building from source
    2.1 Prerequisites
    2.2 ffmpeg
    2.3 doubango
    2.4 webrtc2sip
  3. The easy way: install the packages
  4. Configuration
  5. Run it!


From the webrtc2sip website:

webrtc2sip is a smart and powerful gateway using RTCWeb and SIP to turn your browser into a phone with audio, video and SMS capabilities. The gateway allows your web browser to make and receive calls from/to any SIP-legacy network or PSTN.

The contents of this tutorial are loosely based on the webrtc2sip Google Code project Wiki entry Building_Source_v2_0. This tutorial assumes a basic knowledge of administering a Linux system, VoIP/SIP and building software from source.

The hard way: building from source


You will need a basic up to date Ubuntu 12.04 server install with the necessary packages to build webrtc2sip. To install those packages the following command will do:

sudo -i
apt-get update
apt-get upgrade
apt-get install build-essential libtool automake subversion git-core libsrtp0-dev \
libssl-dev libspeexdsp-dev yasm libvpx-dev libgsm1-dev libxml2-dev libx264-dev \
screen pkg-config

Before you can start building webrtc2sip itself you will first need to build ffmpeg and doubango from source. doubango is the framework on which relies webrtc2sip and for doubango to be able to do the necessary conversion you will need some libraries from the ffmpeg project.


You will need to build from a recent ffmpeg release because the Doubango framework needs the original ffmpeg development headers and libraries and Ubuntu ships with libav, a slight more conservative fork of ffmpeg. The Doubango framework won’t build against these Ubuntu libav packages. Before building ffmpeg from source make sure your system does not have any libav packages installed. The following command should uninstall all libav related packages:

apt-get remove libavutil51

Build and install ffmpeg with:

cd /usr/local/src
wget -c
tar zxvf ffmpeg-1.0.2.tar.gz
cd ffmpeg
./configure --extra-cflags="-fPIC" --extra-ldflags="-lpthread" --enable-pic \
--enable-memalign-hack --enable-shared --disable-static --disable-network \
--disable-protocols --disable-pthreads --disable-devices --disable-filters \
--disable-bsfs --disable-muxers --disable-demuxers --disable-parsers \
--disable-hwaccels --disable-ffmpeg --disable-ffplay --disable-ffserver \
--disable-encoders --disable-decoders --disable-zlib --enable-gpl --disable-debug \
--enable-encoder=h263 --enable-encoder=h263p --enable-decoder=h263 \
--enable-encoder=mpeg4 --enable-decoder=mpeg4 --enable-libx264 \
--enable-encoder=libx264 --enable-decoder=h264
make -j `getconf _NPROCESSORS_ONLN`
make install


Now you can build doubango from source. Use svn to pull in a recent checkout.

cd /usr/local/src
svn co doubango
cd doubango
sed -i '1,/==/s/==/=/'
./configure --with-ssl --with-srtp --with-vpx --with-speex --with-speexdsp \
--enable-speexresampler --enable-speexjb --enable-speexdenoiser --with-gsm \
--with-ffmpeg --with-h264 --prefix=/usr/local
make -j `getconf _NPROCESSORS_ONLN`
make install

If you want to use Linphone clients with VP8 you will have to disable VP8 extensions otherwise Linphone won’t show any video:



With doubango successfully installed you can now pull in the source of webrtc2sip from svn and build it from source.

cd /usr/local/src
svn co webrtc2sip
cd webrtc2sip
sed -i '1,/==/s/==/=/'
./configure --with-doubango=/usr/local --prefix=/usr/local
make -j `getconf _NPROCESSORS_ONLN`
make install
mkdir -p /usr/local/etc/webrtc2sip
cp config.xml /usr/local/etc/webrtc2sip/

If you want webrtc2sip to look for /usr/local/etc/webrtc2sip/config.xml on startup you can modify before building webrtc2sip:

sed -i '1,/NULL/s/NULL/"\/usr\/local\/etc\/webrtc2sip\/config.xml"/'

After that you can build webrtc2sip as described above. This step is optional as webrtc2sip now has the --config=/path/to/config.xml command line option that allows you to have webrtc2sip look for the designated config.xml file on startup.

The easy way: install the packages

sudo -i
apt-get install python-software-properties
add-apt-repository ppa:autostatic/doubango
apt-get update
apt-get install webrtc2sip

This will install the Doubango framework, webrtc2sip and all the necessary dependencies. By default webrtc2sip will not run, you will have to edit the file /etc/default/webrtc2sip first and change the following line:





Configuration of webrtc2sip is done in /usr/local/etc/webrtc2sip/config.xml when built locally and /etc/webrtc2sip/config.xml when installed from the packages. Edit it to your needs with the help of the webrtc2sip Technical Guide. A sample configuration could look like this:

<?xml version="1.0" encoding="utf-8" ?>
<!-- Please check the technical guide ( for more information on how to adjust this file -->








Run it!

If you build everything from source:

screen -dmS webrtc2sip webrtc2sip --config=/usr/local/etc/webrtc2sip/config.xml && \
screen -r webrtc2sip

If you installed the packages:

service webrtc2sip start
screen -r webrtc2sip/webrtc2sip