Compiling and Installing WebRTC2SIP.Tweet
What is WebRTC2SIP and how to use it with the Asterisk PBX in the Amazon AWS EC2 service
NOTE: If you are trying or want to get rid of webrtc2sip and use a plain asterisk installation, see "WebRTC with Asterisk and Amazon AWS".
A lot of sources around the Internet explain how to compile and install Webrtc2sip so one can have SIP as the signaling protocol in a webrtc application, mostly in conjunction with Asterisk and/or FreeSWITCH.
Most of the time those instructions are outdated or incomplete, so here is the updated way of installing webrtc2sip and its dependencies, using Amazon Linux in an EC2 instance inside AWS, altough I'm pretty sure this could also be used for any CentOS like OS.
The original instructions for installing webrtc2sip are located here and this article is a "small" update for it. We try to build webrtc2sip and doubango with as many options as possible, so feel free to skip any dependencies (like codecs) that you are sure will be of no use for you.
NOTE:This will end up with an environment with a mixed license style, so you are warned to check if your product or installation or use of these different pieces of software will violate or not each one the licenses. A good starting point is the Licensing page in the Doubango website.
webrtcsip is made by Doubango, so a big thanks for them to make this available to everyone!
Installing Base Packages needed to build WebRTC2SIP
We first need to install some basic packages, to compile webrtc2sip, doubango, and Asterisk, later on.
In a similar way, GNU Screen is installed becase I still like to use it, so feel free to also skip it or replace it with another thing.
Install DaemonTools so we can start WebRTC2SIP as a service
It is highly recommended that you manage your asterisk and webrtc2sip installations with daemontools. You can find out how to install them in this article titled: Installing DaemonTools in Amazon Linux (or CentOS like OS).
Install libsrtp as a shared library
Install libvpx (for VP8/9 codecs)
This one is optional but recommended to support video in Chrome or Firefox.
You have to download and apply the following patch so you can build libgsm as a shared library:
The iLBC codec is also optional, but you can enable support for it by installing the iLBC library that comes with Doubango:
Doubango are the guys behind the Doubango Cross-platform 3GPP IMS/LTE framework for embedded systems and it's needed to support all what webrtc2sip does:
If you are building with g.729 support, open up the file configure and locate the following couple of lines:
Just above the line that reads char Init_Decod_ld8a (); add:
This is needed because the symbol bad_lsf is declared as "extern" in the g729 library. Perhaps this changed later on in the g729 library and the doubango framework was not updated to reflect that. Let's move on now with building and installing the framework.
Finally, we can build the webrtc2sip tool!
Doubango has written a guide about how to install and configure webrtc2sip, you can find it here: http://webrtc2sip.org/technical-guide-1.0.pdf. Once you're satisfied with your configuration file, you can use the flag --config when starting it to specify the location of your config file.
Make WebRTC2SIP run as a service
To start webrtc2sip when the system boots, you can refer to the article titled Starting WebRTC2SIP as a service without screen or console.
That's it! Start writing cool HTML5 and VoIP enabled applications using WebRTC and the Asterisk PBX
Phew! That was long and tedious, but hopefully effective as well :) You now have your own webrtc2sip installation, clean and shiny to start playing around with webrtc, a fun topic indeed!