{"id":625,"date":"2014-06-30T14:39:05","date_gmt":"2014-06-30T12:39:05","guid":{"rendered":""},"modified":"2018-10-31T22:36:32","modified_gmt":"2018-10-31T21:36:32","slug":"installing-webrtc2sip-gateway-tutorial","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/installing-webrtc2sip-gateway-tutorial\/","title":{"rendered":"Installing WebRTC2SIP gateway &#8211; tutorial"},"content":{"rendered":"<h1>\n\t<strong>System preparation <\/strong><\/h1>\n<pre>\r\n<em>apt-get update<\/em>\r\n<em>apt-get upgrade<\/em><\/pre>\n<p>\n\tAs the first step we need to install packages necessary to build the main webrtc2sip gateway:<\/p>\n<pre>\r\n<em>apt-get install build essential libtool<\/em> <em>automake<\/em> <em>subversion<\/em> <em>git<\/em> <em>pkg-config<\/em> <em>screen<\/em> <em>libxml2-dev<\/em> \/ \r\n<em>libssl-dev<\/em> <em>libsrtp0-dev<\/em><\/pre>\n<p>\n\tto support for libspeex (audio codec) and libspeexdsp (audio processing and jitter buffer) add<\/p>\n<pre>\r\n<em>apt-get install libspeexdsp-dev<\/em><\/pre>\n<p>\n\tadding support for VP8<\/p>\n<pre>\r\n<em>apt-get install libvpx-dev<\/em><\/pre>\n<p>\n\tadds support for H.264 video codec (requires FFmpeg)<\/p>\n<pre>\r\n<em>apt-get install libx264-dev<\/em><\/pre>\n<p>\n\tadding support for GSM audio codec<\/p>\n<pre>\r\n<em>apt-get install libgsm1-dev<\/em><\/pre>\n<h1>\n\tOther software components<\/h1>\n<h2>\n\t<strong>OpenSSL<\/strong><\/h2>\n<p>\n\tIf we are planning to support for DTLS, we need at least 1.0.1 version of OpenSSL, which supports for DTLS.<\/p>\n<p>\n\tWe can check our installed version with:<\/p>\n<pre>\r\n                <em>openssl version<\/em><\/pre>\n<p>\n\t&nbsp;<\/p>\n<h2>\n\t<strong>YASM<\/strong><\/h2>\n<p>\n\t<strong>YASM <\/strong>is required if we are planning to support VP8 or H.264 codecs. To do that we need:<\/p>\n<pre>\r\n<em>wget http:\/\/www.tortall.net\/projects\/yasm\/releases\/yasm-1.2.0.tar.gz<\/em>\r\n<em>tar -xvzf yasm-1.2.0.tar.gz<\/em>\r\n<em>cd yasm-1.2.0<\/em>\r\n<em>.\/configure &amp;&amp; make &amp;&amp; make install<\/em><\/pre>\n<h2>\n\tOpus<\/h2>\n<p>\n\t<strong>Opus<\/strong> is MTI codec for WebRTC. It adds support for Opus audio codec.<\/p>\n<pre>\r\n<em>wget http:\/\/downloads.xiph.org\/releases\/opus\/opus-1.1.tar.gz<\/em>\r\n<em>tar -xvzf opus-1.1.tar.gz<\/em>\r\n<em>cd opus-1.1<\/em>\r\n<em>.\/configure --with-pic --enable-float-approx &amp;&amp; make &amp;&amp; make install<\/em><\/pre>\n<h2>\n\t<strong>ffmpeg<\/strong><\/h2>\n<p>\n\tDoubango needs the original development headers and libraries. Some distributions of Linux have library named <em>libav<\/em>. It is something like ffmpeg but Doubango won&rsquo;t build against this library therefore we need unninstall it:<\/p>\n<pre>\r\n                <em>apt-get remove libavutil51<\/em><\/pre>\n<p>\n\tThen we should continue with installing ffmpeg. We recommend to install the version of 1.0.2, because using a newer version (march 2014) there are some errors during the building of Doubango.<\/p>\n<pre>\r\n<em>cd \/usr\/local\/src<\/em>\r\n<em>wget -c http:\/\/ffmpeg.org\/releases\/ffmpeg-1.0.2.tar.gz<\/em>\r\n<em>tar zxvf ffmpeg-1.0.2.tar.gz<\/em>\r\n<em>cd ffmpeg<\/em>\r\n<em>.\/configure --extra-cflags=&quot;-fPIC&quot; --extra-ldflags=&quot;-lpthread&quot; --enable-pic \\<\/em>\r\n<em>--enable-memalign-hack --enable-shared --disable-static --disable-network \\<\/em>\r\n<em>--disable-protocols --disable-pthreads --disable-devices --disable-filters \\<\/em>\r\n<em>--disable-bsfs --disable-muxers --disable-demuxers --disable-parsers \\<\/em>\r\n<em>--disable-hwaccels --disable-ffmpeg --disable-ffplay --disable-ffserver \\<\/em>\r\n<em>--disable-encoders --disable-decoders --disable-zlib --enable-gpl --disable-debug \\<\/em>\r\n<em>--enable-encoder=h263 --enable-encoder=h263p --enable-decoder=h263 \\<\/em>\r\n<em>--enable-encoder=mpeg4 --enable-decoder=mpeg4 --enable-libx264 \\<\/em>\r\n<em>--enable-encoder=libx264 --enable-decoder=h264<\/em>\r\n<em>make <\/em>\r\n<em>make install<\/em>\r\n<em>ldconfig<\/em><\/pre>\n<p>\n\t&nbsp;<\/p>\n<h2>\n\t<strong>Doubango<\/strong><\/h2>\n<p>\n\tWe use svn to pull in a&nbsp;recent checkout and then install.<\/p>\n<pre>\r\n<em>cd \/usr\/local\/src<\/em>\r\n<em>svn co http:\/\/doubango.googlecode.com\/svn\/branches\/2.0\/doubango doubango<\/em>\r\n<em>cd doubango<\/em>\r\n<em>sed -i &#39;1,\/==\/s\/==\/=\/&#39; autogen.sh<\/em>\r\n<em>.\/autogen.sh<\/em>\r\n<em>.\/configure --with-ssl --with-srtp --with-vpx --with-speex --with-speexdsp \\<\/em>\r\n<em>--enable-speexresampler --enable-speexjb --enable-speexdenoiser --with-gsm \\<\/em>\r\n<em>--with-ffmpeg --with-opus --with-h264 --prefix=\/usr\/local<\/em>\r\n<em>make <\/em>\r\n<em>make install<\/em>\r\n<em>ldconfig<\/em><\/pre>\n<p>\n\t&nbsp;<\/p>\n<h2>\n\t<strong>Webrtc2sip<\/strong><\/h2>\n<p>\n\tIf we have successfully installed doubango then we can build an install webrtc2sip.<\/p>\n<pre>\r\n<em>cd \/usr\/local\/src<\/em>\r\n<em>svn co http:\/\/webrtc2sip.googlecode.com\/svn\/trunk\/ webrtc2sip<\/em>\r\n<em>cd webrtc2sip<\/em>\r\n<em>sed -i &#39;1,\/==\/s\/==\/=\/&#39; autogen.sh<\/em>\r\n<em>.\/autogen.sh<\/em>\r\n<em>.\/configure --with-doubango=\/usr\/local --prefix=\/usr\/local<\/em>\r\n<em>make<\/em>\r\n<em>make install<\/em>\r\n<em>mkdir -p \/usr\/local\/etc\/webrtc2sip<\/em>\r\n<em>cp config.xml \/usr\/local\/etc\/webrtc2sip\/<\/em><\/pre>\n<p>\n\tThen we have to customize confug file. It is located within directory <em>\/usr\/local\/etc\/webrtc2sip\/<\/em><\/p>\n<p>\n\tFor better understanding of all options we recommend to read technical guide, which is available on link:<\/p>\n<p>\n\t<a href=\"http:\/\/webrtc2sip.org\/technical-guide-1.0.pdf\">http:\/\/webrtc2sip.org\/technical-guide-1.0.pdf<\/a><\/p>\n<p>\n\tOnce we have finished with editing of the config file we may start webrtc2sip as daemon using the command:<\/p>\n<pre>\r\n<em>screen -dmS webrtc2sip webrtc2sip --config=\/usr\/local\/etc\/webrtc2sip\/config.xml<\/em><\/pre>\n<p>\n\tIf we want see terminal of webrtc2sip:<\/p>\n<pre>\r\n<em>screen -r webrtc2sip<\/em><\/pre>\n<p>\n\tTo be sure that webrtc2sip is listening on defined port we can check it with command:<\/p>\n<pre>\r\n<em>netstat &ndash;tupln<\/em><\/pre>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tTo add support webrtc2sip for DTLS we need SSL certificates. To get needed self signed certs you can follow this guides:<\/p>\n<p>\n\t<a href=\"http:\/\/codeghar.wordpress.com\/2013\/04\/16\/create-private-certificate-authority-on-linux\/\">http:\/\/codeghar.wordpress.com\/2013\/04\/16\/create-private-certificate-authority-on-linux\/<\/a><\/p>\n<p>\n\t<a href=\"http:\/\/codeghar.wordpress.com\/2013\/04\/16\/generate-certificate-signing-request-on-linux\/\">http:\/\/codeghar.wordpress.com\/2013\/04\/16\/generate-certificate-signing-request-on-linux\/<\/a><\/p>\n<p>\n\t<a href=\"http:\/\/codeghar.wordpress.com\/2013\/04\/16\/use-private-certificate-authority-to-sign-certificate-signing-request-on-linux\/\">http:\/\/codeghar.wordpress.com\/2013\/04\/16\/use-private-certificate-authority-to-sign-certificate-signing-request-on-linux\/<\/a><\/p>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tFrom things which you created in previous steps, configuration for the ssl-certificates in config.xml can look like this:<\/p>\n<pre>\r\n<em>&lt;ssl-certificates&gt;<\/em>\r\n<em>                              \/home\/user\/mycert\/private\/key.csr.server1.pem; &lt;!-- private key --&gt;<\/em>\r\n<em>                               \/home\/user\/myca\/certs\/crt.server1.pem; &lt;!-- self signed certificate --&gt;<\/em>\r\n<em>                               *; &lt;!--or  \/home\/user\/myca\/certs\/crt.ca.cg.pem; --&gt;<\/em>\r\n<em>                               no                 <\/em>\r\n<em>&lt;\/ssl-certificates&gt;<\/em><\/pre>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tAuthor: Patrik Formanek 2014<\/p>\n<p>\n\t&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<h1>\n\t<strong>System preparation <\/strong><\/h1>\n<pre>\r\n<em>apt-get update<\/em>\r\n<em>apt-get upgrade<\/em><\/pre>\n<p>\n\tAs the first step we need to install packages necessary to build the main webrtc2sip gateway:<\/p>\n<pre>\r\n<em>apt-get install build essential libtool<\/em> <em>automake<\/em> <em>subversion<\/em> <em>git<\/em> <em>pkg-config<\/em> <em>screen<\/em> <em>libxml2-dev<\/em> \/ \r\n<em>libssl-dev<\/em> <em>libsrtp0-dev<\/em><\/pre>\n<p>\n\tto support for libspeex (audio codec) and libspeexdsp (audio processing and jitter buffer) add<\/p>","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[771],"tags":[],"class_list":["post-625","post","type-post","status-publish","format-standard","hentry","category-sip-en"],"taxonomy_info":{"category":[{"value":771,"label":"SIP"}]},"featured_image_src_large":false,"author_info":{"display_name":"admin","author_link":"https:\/\/nil.uniza.sk\/en\/author\/admin\/"},"comment_info":8,"category_info":[{"term_id":771,"name":"SIP","slug":"sip-en","term_group":0,"term_taxonomy_id":769,"taxonomy":"category","description":"","parent":0,"count":23,"filter":"raw","cat_ID":771,"category_count":23,"category_description":"","cat_name":"SIP","category_nicename":"sip-en","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=625"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/625\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}