Installing webrtc2sip on Ubuntu 12.04

http://linux.autostatic.com/installing-webrtc2sip-on-ubuntu-1204

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.

Contents

  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!

Introduction

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 entryBuilding_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

Prerequisites

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.

ffmpeg

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 http://ffmpeg.org/releases/ffmpeg-1.0.2.tar.gz
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 ldconfig

doubango

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

cd /usr/local/src
svn co http://doubango.googlecode.com/svn/branches/2.0/doubango doubango
cd doubango
sed -i '1,/==/s/==/=/' autogen.sh
./autogen.sh
./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 ldconfig

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

sed -i 's/TDAV_VP8_DISABLE_EXTENSION       0/TDAV_VP8_DISABLE_EXTENSION       1/' \
/usr/local/src/doubango/tinyDAV/src/codecs/vpx/tdav_codec_vp8.c

webrtc2sip

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 http://webrtc2sip.googlecode.com/svn/trunk/ webrtc2sip
cd webrtc2sip
sed -i '1,/==/s/==/=/' autogen.sh
./autogen.sh
./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 modifymp_mediaproxy.cc before building webrtc2sip:

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

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 designatedconfig.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:

RUN_WEBRTC2SIP=no

to:

RUN_WEBRTC2SIP=yes

Configuration

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:





  ERROR

  udp;*;10060
  ws;*;10060
  wss;*;10062

  yes
  no
  yes
  yes
  vga
  65535
  100;400
  optional
  sdes;dtls

  pcma;pcmu;gsm;vp8;h264-bp;h264-mp;h263;h263+


  

  



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

Written by: Jeremy



你可能感兴趣的:(其他,Linux应用)