开源 janus(webrtc gateway) 在centos7上的安装及使用

参考
https://blog.csdn.net/u012231640/article/details/83618274#Webrtc_Server_289
(感谢作者)

主要步骤

  1. 安装必要插件及Janus,运行

以下为安装脚本

#!/bin/sh
yum install -y epel-release && \
yum update -y && \
yum install -y deltarpm && \
yum install -y openssh-server sudo which file curl zip unzip wget && \
yum install -y libmicrohttpd-devel jansson-devel libnice-devel glib22-devel opus-devel libogg-devel pkgconfig  gengetopt libtool autoconf automake make gcc gcc-c++ git cmake libconfig-devel openssl-devel

#upgrade libsrtp 1.5.4
wget https://github.com/cisco/libsrtp/archive/v1.5.4.tar.gz
tar xfv v1.5.4.tar.gz
cd libsrtp-1.5.4
./configure --prefix=/usr --enable-openssl
make shared_library && sudo make install

cd -

wget https://github.com/cisco/libsrtp/archive/v2.0.0.tar.gz
tar xfv v2.0.0.tar.gz
cd libsrtp-2.0.0
./configure --prefix=/usr --enable-openssl
make shared_library && sudo make install

cd -

#install sofia-sip for sip-gateway plugin
wget https://sourceforge.net/projects/sofia-sip/files/sofia-sip/1.12.11/sofia-sip-1.12.11.tar.gz
tar zxf sofia-sip-1.12.11.tar.gz && cd sofia-sip-1.12.11 && ./configure --prefix=/usr CFLAGS=-fno-aggressive-loop-optimizations && make && make install

cd -

#install usrsctp for Data channel support
git clone https://github.com/sctplab/usrsctp && cd usrsctp && \
./bootstrap && \
./configure --prefix=/usr && make && make install

cd -

#install libwebsocket for android or ios instead of http/https
git clone https://github.com/warmcat/libwebsockets && \
mkdir libwebsockets/build && cd libwebsockets/build && \
cmake -DMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" .. && \
make && make install

cd -

#Janus
#if cannot configure plugin sofia,Perhaps you should add the directory containing `sofia-sip-ua.pc' to the PKG_CONFIG_PATH environment variable,
#for example centos7 :export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig
#if cannot load libsofia-sip-ua.so.0 , try ldconfig -v
git clone https://github.com/meetecho/janus-gateway.git && \
cd janus-gateway &&\
sh autogen.sh && \
./configure --prefix=/opt/janus --disable-rabbitmq --disable-docs --disable-libsrtp2  &&\
make && make install && make configs

执行完安装脚本后
修改janus的配置,如下:
/opt/janus/etc/janus/janus.transport.http.jcfg 里面的https改成true

vim /opt/janus/etc/janus/janus.transport.http.jcfg

开源 janus(webrtc gateway) 在centos7上的安装及使用_第1张图片

  1. 安装及 配置nginx
yum install nginx
vim /etc/nginx/conf.d/default.conf

增加https 访问端口
修改根目录路径
增加安全证书
开源 janus(webrtc gateway) 在centos7上的安装及使用_第2张图片
修改后启动nginx

nginx -s reload
systemctl start nginx
  1. 运行Janus demo

启动 janus

cd /opt/janus/bin
nohup ./janus &
tail -f nohup

访问janus demo 地址 https://本机ip
开源 janus(webrtc gateway) 在centos7上的安装及使用_第3张图片

安装成功
点开demos -> sip gateway 填写配置后即可运行demo

开源 janus(webrtc gateway) 在centos7上的安装及使用_第4张图片

完毕

你可能感兴趣的:(开源 janus(webrtc gateway) 在centos7上的安装及使用)