Ubuntu中安装部署Janus

1. 环境

Ubuntu 16.4.5 TLS 版本中编译和测试通过。
(CentOS下的部署可以参考《Janus部署总结》一文)

下载最新的源代码需要git,若没有安装git可以使用下面命令进行安装:

sudo apt-get install git -y

使用下面命令进行安装lua库:

sudo apt-get install liblua5.3-dev

编译运行 Janus Server 需要依赖较多的一些第三方库,而这些依赖库在 Ubuntu 下主要通过 aptitude 进行安装,首先通过安装 aptitude:

sudo apt-get install aptitude

另外,还有一些编译的aptitude依赖库,相关安装命令如下:

sudo aptitude install libmicrohttpd-dev libjansson-dev libnice-dev 
sudo aptitude install libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev
sudo aptitude install libopus-dev libogg-dev libcurl4-openssl-dev pkg-config gengetopt libtool automake

2. 编译安装最新libsrtp

详细步骤可参考《最新libsrtp库的编译与测试方法》

3. 编译安装最新libwebsockets

详细步骤可参考《最新libwebsockets库的编译与测试方法》

4. 编译及安装Janus

4.1 下载源码

git clone https://github.com/meetecho/janus-gateway.git

4.2 进入源码目录

cd janus-gateway

4.3 生成配置文件并配置

生成配置文件,相关命令如下:

sh autogen.sh

配置命令如下:

./configure --prefix=/opt/janus --enable-websockets --disable-plugin-lua

执行结果,如下所示:

cgs@ubuntu:~/janus-gateway$ ./configure --prefix=/opt/janus --enable-websockets --disable-plugin-lua
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for JANUS... yes
checking for library containing tls_config_set_ca_mem... no
checking for nice_agent_set_port_range in -lnice... yes
checking for nice_address_equal_no_port in -lnice... yes
checking for dlopen in -ldl... yes
checking for srtp_init in -lsrtp2... yes
checking srtp2/srtp.h usability... yes
checking srtp2/srtp.h presence... yes
checking for srtp2/srtp.h... yes
checking for srtp_crypto_policy_set_aes_gcm_256_16_auth in -lsrtp2... no
configure: libsrtp2 does not have support for AES-GCM profiles
checking for usrsctp_finish in -lusrsctp... no
checking for LIBCURL... yes
checking for doxygen... no
checking for dot... no
checking for gengetopt... yes
checking for TRANSPORTS... yes
checking for MHD... yes
checking for lws_create_vhost in -lwebsockets... yes
checking for lws_get_peer_simple in -lwebsockets... yes
checking for amqp_error_string2 in -lrabbitmq... no
checking for MQTTAsync_create in -lpaho-mqtt3a... no
checking for nn_socket in -lnanomsg... no
checking for PLUGINS... yes
checking for SOFIA... yes
checking for LIBRE... no
checking for LIBRE... no
checking for OPUS... yes
checking for OGG... yes
checking for LUA... no
checking for LUA... yes
checking for EVENTS... yes
checking for npm... /usr/local/bin/npm
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating html/Makefile
config.status: creating docs/Makefile
config.status: executing depfiles commands
config.status: executing libtool commands

Compiler:                  gcc
libsrtp version:           2.x
SSL/crypto library:        OpenSSL
DTLS set-timeout:          not available
Mutex implementation:      GMutex (native futex on Linux)
DataChannels support:      no
Recordings post-processor: no
TURN REST API client:      yes
Doxygen documentation:     no
Transports:
    REST (HTTP/HTTPS):     yes
    WebSockets:            yes
    RabbitMQ:              no
    MQTT:                  no
    Unix Sockets:          yes
    Nanomsg:               no
Plugins:
    Echo Test:             yes
    Streaming:             yes
    Video Call:            yes
    SIP Gateway (Sofia):   yes
    SIP Gateway (libre):   no
    NoSIP (RTP Bridge):    yes
    Audio Bridge:          yes
    Video Room:            yes
    Voice Mail:            yes
    Record&Play:           yes
    Text Room:             yes
    Lua Interpreter:       no
    Duktape Interpreter:   no
Event handlers:
    Sample event handler:  yes
    RabbitMQ event handler:no
    MQTT event handler:    no
JavaScript modules:        no

If this configuration is ok for you, do a 'make' to start building Janus. A 'make install' will install Janus and its plugins to the specified prefix. Finally, a 'make configs' will install some sample configuration files too (something you'll only want to do the first time, though).

4.4 编译

编译命令如下:

make

执行结果,如下所示:

cgs@ubuntu:~/janus-gateway$ make
gengetopt --set-package="janus" --set-version="0.6.2" < janus.ggo
`which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $0"\";"} END {}' > version.c
echo "Tue Feb 19 18:19:52 CST 2019" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$0"\";"} END {} ' >> version.c
echo "62" | awk 'BEGIN {} {print "int janus_version = "$0";"} END {} ' >> version.c
echo "0.6.2" | awk 'BEGIN {} {print "const char *janus_version_string = \""$0"\";"} END {} ' >> version.c
make  all-recursive
make[1]: Entering directory '/home/cgs/janus-gateway'
Making all in html
make[2]: Entering directory '/home/cgs/janus-gateway/html'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/cgs/janus-gateway/html'
make[2]: Entering directory '/home/cgs/janus-gateway'
  CC       events/events_libjanus_sampleevh_la-janus_sampleevh.lo
  CCLD     events/libjanus_sampleevh.la
  CC       plugins/plugins_libjanus_audiobridge_la-janus_audiobridge.lo
  CCLD     plugins/libjanus_audiobridge.la
  CC       plugins/plugins_libjanus_echotest_la-janus_echotest.lo
  CCLD     plugins/libjanus_echotest.la
  CC       plugins/plugins_libjanus_recordplay_la-janus_recordplay.lo
  CCLD     plugins/libjanus_recordplay.la
  CC       plugins/plugins_libjanus_sip_la-janus_sip.lo
plugins/janus_sip.c: In function ‘janus_sip_sofia_logger’:
plugins/janus_sip.c:1151:2: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
  g_vsnprintf(line, sizeof(line), fmt, ap);
  ^
plugins/janus_sip.c: In function ‘janus_sip_relay_thread’:
plugins/janus_sip.c:4543:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
      (void)read(pipe_fd, &code, sizeof(int));
      ^
plugins/janus_sip.c: In function ‘janus_sip_allocate_local_ports’:
plugins/janus_sip.c:4304:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
  pipe(session->media.pipefd);
  ^
  CCLD     plugins/libjanus_sip.la
  CC       plugins/plugins_libjanus_nosip_la-janus_nosip.lo
plugins/janus_nosip.c: In function ‘janus_nosip_relay_thread’:
plugins/janus_nosip.c:2194:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
      (void)read(pipe_fd, &code, sizeof(int));
      ^
plugins/janus_nosip.c: In function ‘janus_nosip_allocate_local_ports’:
plugins/janus_nosip.c:1956:3: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
   pipe(session->media.pipefd);
   ^
  CCLD     plugins/libjanus_nosip.la
  CC       plugins/plugins_libjanus_streaming_la-janus_streaming.lo
plugins/janus_streaming.c: In function ‘janus_streaming_create_rtp_source’:
plugins/janus_streaming.c:4812:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
  pipe(live_rtp_source->pipefd);
  ^
plugins/janus_streaming.c: In function ‘janus_streaming_create_rtsp_source’:
plugins/janus_streaming.c:5495:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
  pipe(live_rtsp_source->pipefd);
  ^
  CCLD     plugins/libjanus_streaming.la
  CC       plugins/plugins_libjanus_videocall_la-janus_videocall.lo
  CCLD     plugins/libjanus_videocall.la
  CC       plugins/plugins_libjanus_videoroom_la-janus_videoroom.lo
  CCLD     plugins/libjanus_videoroom.la
  CC       plugins/plugins_libjanus_voicemail_la-janus_voicemail.lo
  CCLD     plugins/libjanus_voicemail.la
  CC       plugins/plugins_libjanus_textroom_la-janus_textroom.lo
  CCLD     plugins/libjanus_textroom.la
  CC       transports/transports_libjanus_http_la-janus_http.lo
  CCLD     transports/libjanus_http.la
  CC       transports/transports_libjanus_websockets_la-janus_websockets.lo
  CCLD     transports/libjanus_websockets.la
  CC       transports/transports_libjanus_pfunix_la-janus_pfunix.lo
transports/janus_pfunix.c: In function ‘janus_pfunix_thread’:
transports/janus_pfunix.c:643:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
      (void)read(poll_fds[i].fd, buffer, BUFFER_SIZE);
      ^
  CCLD     transports/libjanus_pfunix.la
  CC       janus-apierror.o
  CC       janus-auth.o
  CC       janus-cmdline.o
cmdline.c: In function ‘cmdline_parser_internal’:
cmdline.c:694:7: warning: variable ‘check_required’ set but not used [-Wunused-but-set-variable]
   int check_required;
       ^
  CC       janus-config.o
  CC       janus-dtls.o
In file included from dtls.h:25:0,
                 from ice.h:24,
                 from janus.h:32,
                 from dtls.c:15:
dtls-bio.h:24:38: warning: ‘struct janus_dtls_srtp’ declared inside parameter list
 BIO *BIO_janus_dtls_agent_new(struct janus_dtls_srtp *dtls);
                                      ^
dtls-bio.h:24:38: warning: its scope is only this definition or declaration, which is probably not what you want
dtls.c: In function ‘janus_dtls_srtp_create’:
dtls.c:519:45: warning: passing argument 1 of ‘BIO_janus_dtls_agent_new’ from incompatible pointer type [-Wincompatible-pointer-types]
  dtls->write_bio = BIO_janus_dtls_agent_new(dtls);
                                             ^
In file included from dtls.h:25:0,
                 from ice.h:24,
                 from janus.h:32,
                 from dtls.c:15:
dtls-bio.h:24:6: note: expected ‘struct janus_dtls_srtp *’ but argument is of type ‘janus_dtls_srtp * {aka struct janus_dtls_srtp *}’
 BIO *BIO_janus_dtls_agent_new(struct janus_dtls_srtp *dtls);
      ^
  CC       janus-dtls-bio.o
  CC       janus-events.o
  CC       janus-ice.o
In file included from dtls.h:25:0,
                 from ice.h:24,
                 from janus.h:32,
                 from ice.c:27:
dtls-bio.h:24:38: warning: ‘struct janus_dtls_srtp’ declared inside parameter list
 BIO *BIO_janus_dtls_agent_new(struct janus_dtls_srtp *dtls);
                                      ^
dtls-bio.h:24:38: warning: its scope is only this definition or declaration, which is probably not what you want
ice.c: In function ‘janus_ice_outgoing_traffic_handle’:
ice.c:418:20: warning: inlining failed in call to ‘janus_ice_free_queued_packet’: call is unlikely and code size would grow [-Winline]
 static inline void janus_ice_free_queued_packet(janus_ice_queued_packet *pkt) {
                    ^
ice.c:4053:8: warning: called from here [-Winline]
        janus_ice_free_queued_packet(pkt);
        ^
ice.c:418:20: warning: inlining failed in call to ‘janus_ice_free_queued_packet’: call is unlikely and code size would grow [-Winline]
 static inline void janus_ice_free_queued_packet(janus_ice_queued_packet *pkt) {
                    ^
ice.c:4092:5: warning: called from here [-Winline]
     janus_ice_free_queued_packet(pkt);
     ^
ice.c:418:20: warning: inlining failed in call to ‘janus_ice_free_queued_packet’: call is unlikely and code size would grow [-Winline]
 static inline void janus_ice_free_queued_packet(janus_ice_queued_packet *pkt) {
                    ^
ice.c:4110:5: warning: called from here [-Winline]
     janus_ice_free_queued_packet(pkt);
     ^
  CC       janus-janus.o
In file included from dtls.h:25:0,
                 from ice.h:24,
                 from janus.h:32,
                 from janus.c:29:
dtls-bio.h:24:38: warning: ‘struct janus_dtls_srtp’ declared inside parameter list
 BIO *BIO_janus_dtls_agent_new(struct janus_dtls_srtp *dtls);
                                      ^
dtls-bio.h:24:38: warning: its scope is only this definition or declaration, which is probably not what you want
  CC       janus-log.o
  CC       janus-record.o
  CC       janus-rtcp.o
  CC       janus-rtp.o
  CC       janus-sctp.o
  CC       janus-sdp.o
In file included from dtls.h:25:0,
                 from ice.h:24,
                 from janus.h:32,
                 from sdp.c:21:
dtls-bio.h:24:38: warning: ‘struct janus_dtls_srtp’ declared inside parameter list
 BIO *BIO_janus_dtls_agent_new(struct janus_dtls_srtp *dtls);
                                      ^
dtls-bio.h:24:38: warning: its scope is only this definition or declaration, which is probably not what you want
  CC       janus-sdp-utils.o
  CC       janus-ip-utils.o
  CC       janus-turnrest.o
  CC       janus-utils.o
`which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $0"\";"} END {}' > version.c
echo "Tue Feb 19 18:20:37 CST 2019" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$0"\";"} END {} ' >> version.c
echo "62" | awk 'BEGIN {} {print "int janus_version = "$0";"} END {} ' >> version.c
echo "0.6.2" | awk 'BEGIN {} {print "const char *janus_version_string = \""$0"\";"} END {} ' >> version.c
  CC       janus-version.o
  CC       janus-text2pcap.o
  CC       plugins/janus-plugin.o
  CC       transports/janus-transport.o
In file included from ./mutex.h:16:0,
                 from ./refcount.h:61,
                 from transports/transport.h:96,
                 from transports/transport.c:14:
./debug.h:58:20: warning: ‘janus_log_prefix’ defined but not used [-Wunused-variable]
 static const char *janus_log_prefix[] = {
                    ^
  CCLD     janus
  CC       janus_cfgconv-janus-cfgconv.o
  CC       janus_cfgconv-config.o
  CC       janus_cfgconv-log.o
  CC       janus_cfgconv-utils.o
  CC       janus_cfgconv-version.o
  CCLD     janus-cfgconv
/bin/mkdir -p conf
  GEN      conf/janus.jcfg.sample
/bin/mkdir -p conf
  GEN      conf/janus.transport.http.jcfg.sample
/bin/mkdir -p conf
  GEN      conf/janus.transport.websockets.jcfg.sample
/bin/mkdir -p conf
  GEN      conf/janus.plugin.recordplay.jcfg.sample
/bin/mkdir -p conf
  GEN      conf/janus.plugin.streaming.jcfg.sample
/bin/mkdir -p conf
  GEN      conf/janus.plugin.voicemail.jcfg.sample
make[2]: Leaving directory '/home/cgs/janus-gateway'
make[1]: Leaving directory '/home/cgs/janus-gateway'

4.5 安装

安装命令如下(特别需要注意前面的 sudo,否则会出现安装错误):

sudo make install

执行结果,如下所示:

cgs@ubuntu:~/janus-gateway$ sudo make install
[sudo] password for cgs: 
`which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $0"\";"} END {}' > version.c
echo "Tue Feb 19 18:24:47 CST 2019" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$0"\";"} END {} ' >> version.c
echo "62" | awk 'BEGIN {} {print "int janus_version = "$0";"} END {} ' >> version.c
echo "0.6.2" | awk 'BEGIN {} {print "const char *janus_version_string = \""$0"\";"} END {} ' >> version.c
make  install-recursive
make[1]: Entering directory '/home/cgs/janus-gateway'
Making install in html
make[2]: Entering directory '/home/cgs/janus-gateway/html'
make[3]: Entering directory '/home/cgs/janus-gateway/html'
make[3]: Nothing to be done for 'install-exec-am'.
true
/bin/mkdir -p /opt/janus/share/janus/demos
cp -r * /opt/janus/share/janus/demos
rm /opt/janus/share/janus/demos/Makefile*
make[3]: Leaving directory '/home/cgs/janus-gateway/html'
make[2]: Leaving directory '/home/cgs/janus-gateway/html'
make[2]: Entering directory '/home/cgs/janus-gateway'
`which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $0"\";"} END {}' > version.c
echo "Tue Feb 19 18:24:48 CST 2019" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$0"\";"} END {} ' >> version.c
echo "62" | awk 'BEGIN {} {print "int janus_version = "$0";"} END {} ' >> version.c
echo "0.6.2" | awk 'BEGIN {} {print "const char *janus_version_string = \""$0"\";"} END {} ' >> version.c
  CC       janus-version.o
  CCLD     janus
  CC       janus_cfgconv-version.o
  CCLD     janus-cfgconv
make[3]: Entering directory '/home/cgs/janus-gateway'
`which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $0"\";"} END {}' > version.c
echo "Tue Feb 19 18:24:49 CST 2019" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$0"\";"} END {} ' >> version.c
echo "62" | awk 'BEGIN {} {print "int janus_version = "$0";"} END {} ' >> version.c
echo "0.6.2" | awk 'BEGIN {} {print "const char *janus_version_string = \""$0"\";"} END {} ' >> version.c
  CC       janus-version.o
  CCLD     janus
  CC       janus_cfgconv-version.o
  CCLD     janus-cfgconv
 /bin/mkdir -p '/opt/janus/bin'
  /bin/bash ./libtool   --mode=install /usr/bin/install -c janus janus-cfgconv '/opt/janus/bin'
libtool: install: /usr/bin/install -c janus /opt/janus/bin/janus
libtool: install: /usr/bin/install -c janus-cfgconv /opt/janus/bin/janus-cfgconv
 /bin/mkdir -p '/opt/janus/etc/janus'
 /usr/bin/install -c -m 644 conf/janus.jcfg.sample conf/janus.transport.http.jcfg.sample conf/janus.transport.websockets.jcfg.sample conf/janus.transport.pfunix.jcfg.sample conf/janus.eventhandler.sampleevh.jcfg.sample conf/janus.plugin.audiobridge.jcfg.sample conf/janus.plugin.echotest.jcfg.sample conf/janus.plugin.recordplay.jcfg.sample conf/janus.plugin.sip.jcfg.sample conf/janus.plugin.nosip.jcfg.sample conf/janus.plugin.streaming.jcfg.sample conf/janus.plugin.videocall.jcfg.sample conf/janus.plugin.videoroom.jcfg.sample conf/janus.plugin.voicemail.jcfg.sample conf/janus.plugin.textroom.jcfg.sample '/opt/janus/etc/janus'
 /bin/mkdir -p '/opt/janus/share/janus/certs'
 /usr/bin/install -c -m 644 certs/mycert.key certs/mycert.pem '/opt/janus/share/janus/certs'
 /bin/mkdir -p '/opt/janus/share/doc/janus-gateway'
 /usr/bin/install -c -m 644 README.md '/opt/janus/share/doc/janus-gateway'
 /bin/mkdir -p '/opt/janus/share/janus/duktape'
 /bin/mkdir -p '/opt/janus/lib/janus/events'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   events/libjanus_sampleevh.la '/opt/janus/lib/janus/events'
libtool: install: /usr/bin/install -c events/.libs/libjanus_sampleevh.so.0.0.0 /opt/janus/lib/janus/events/libjanus_sampleevh.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/events && { ln -s -f libjanus_sampleevh.so.0.0.0 libjanus_sampleevh.so.0 || { rm -f libjanus_sampleevh.so.0 && ln -s libjanus_sampleevh.so.0.0.0 libjanus_sampleevh.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/events && { ln -s -f libjanus_sampleevh.so.0.0.0 libjanus_sampleevh.so || { rm -f libjanus_sampleevh.so && ln -s libjanus_sampleevh.so.0.0.0 libjanus_sampleevh.so; }; })
libtool: install: /usr/bin/install -c events/.libs/libjanus_sampleevh.lai /opt/janus/lib/janus/events/libjanus_sampleevh.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /opt/janus/lib/janus/events
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/janus/lib/janus/events

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/opt/janus/include/janus/events'
 /usr/bin/install -c -m 644 events/eventhandler.h '/opt/janus/include/janus/events'
 /bin/mkdir -p '/opt/janus/include/janus'
 /usr/bin/install -c -m 644 apierror.h config.h log.h debug.h mutex.h record.h rtcp.h rtp.h rtpsrtp.h sdp-utils.h ip-utils.h utils.h refcount.h text2pcap.h '/opt/janus/include/janus'
 /bin/mkdir -p '/opt/janus/share/janus/javascript'
 /usr/bin/install -c -m 644 html/janus.js '/opt/janus/share/janus/javascript'
 /bin/mkdir -p '/opt/janus/share/janus/lua'
 /bin/mkdir -p '/opt/janus/share/man/man1'
 /usr/bin/install -c -m 644 janus.1 janus-cfgconv.1 postprocessing/janus-pp-rec.1 '/opt/janus/share/man/man1'
 /bin/mkdir -p '/opt/janus/lib/janus/plugins'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   plugins/libjanus_audiobridge.la plugins/libjanus_echotest.la plugins/libjanus_recordplay.la plugins/libjanus_sip.la plugins/libjanus_nosip.la plugins/libjanus_streaming.la plugins/libjanus_videocall.la plugins/libjanus_videoroom.la plugins/libjanus_voicemail.la plugins/libjanus_textroom.la '/opt/janus/lib/janus/plugins'
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_audiobridge.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_audiobridge.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_audiobridge.so.0.0.0 libjanus_audiobridge.so.0 || { rm -f libjanus_audiobridge.so.0 && ln -s libjanus_audiobridge.so.0.0.0 libjanus_audiobridge.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_audiobridge.so.0.0.0 libjanus_audiobridge.so || { rm -f libjanus_audiobridge.so && ln -s libjanus_audiobridge.so.0.0.0 libjanus_audiobridge.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_audiobridge.lai /opt/janus/lib/janus/plugins/libjanus_audiobridge.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_echotest.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_echotest.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_echotest.so.0.0.0 libjanus_echotest.so.0 || { rm -f libjanus_echotest.so.0 && ln -s libjanus_echotest.so.0.0.0 libjanus_echotest.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_echotest.so.0.0.0 libjanus_echotest.so || { rm -f libjanus_echotest.so && ln -s libjanus_echotest.so.0.0.0 libjanus_echotest.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_echotest.lai /opt/janus/lib/janus/plugins/libjanus_echotest.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_recordplay.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_recordplay.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_recordplay.so.0.0.0 libjanus_recordplay.so.0 || { rm -f libjanus_recordplay.so.0 && ln -s libjanus_recordplay.so.0.0.0 libjanus_recordplay.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_recordplay.so.0.0.0 libjanus_recordplay.so || { rm -f libjanus_recordplay.so && ln -s libjanus_recordplay.so.0.0.0 libjanus_recordplay.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_recordplay.lai /opt/janus/lib/janus/plugins/libjanus_recordplay.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_sip.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_sip.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_sip.so.0.0.0 libjanus_sip.so.0 || { rm -f libjanus_sip.so.0 && ln -s libjanus_sip.so.0.0.0 libjanus_sip.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_sip.so.0.0.0 libjanus_sip.so || { rm -f libjanus_sip.so && ln -s libjanus_sip.so.0.0.0 libjanus_sip.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_sip.lai /opt/janus/lib/janus/plugins/libjanus_sip.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_nosip.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_nosip.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_nosip.so.0.0.0 libjanus_nosip.so.0 || { rm -f libjanus_nosip.so.0 && ln -s libjanus_nosip.so.0.0.0 libjanus_nosip.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_nosip.so.0.0.0 libjanus_nosip.so || { rm -f libjanus_nosip.so && ln -s libjanus_nosip.so.0.0.0 libjanus_nosip.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_nosip.lai /opt/janus/lib/janus/plugins/libjanus_nosip.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_streaming.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_streaming.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_streaming.so.0.0.0 libjanus_streaming.so.0 || { rm -f libjanus_streaming.so.0 && ln -s libjanus_streaming.so.0.0.0 libjanus_streaming.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_streaming.so.0.0.0 libjanus_streaming.so || { rm -f libjanus_streaming.so && ln -s libjanus_streaming.so.0.0.0 libjanus_streaming.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_streaming.lai /opt/janus/lib/janus/plugins/libjanus_streaming.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_videocall.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_videocall.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_videocall.so.0.0.0 libjanus_videocall.so.0 || { rm -f libjanus_videocall.so.0 && ln -s libjanus_videocall.so.0.0.0 libjanus_videocall.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_videocall.so.0.0.0 libjanus_videocall.so || { rm -f libjanus_videocall.so && ln -s libjanus_videocall.so.0.0.0 libjanus_videocall.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_videocall.lai /opt/janus/lib/janus/plugins/libjanus_videocall.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_videoroom.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_videoroom.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_videoroom.so.0.0.0 libjanus_videoroom.so.0 || { rm -f libjanus_videoroom.so.0 && ln -s libjanus_videoroom.so.0.0.0 libjanus_videoroom.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_videoroom.so.0.0.0 libjanus_videoroom.so || { rm -f libjanus_videoroom.so && ln -s libjanus_videoroom.so.0.0.0 libjanus_videoroom.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_videoroom.lai /opt/janus/lib/janus/plugins/libjanus_videoroom.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_voicemail.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_voicemail.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_voicemail.so.0.0.0 libjanus_voicemail.so.0 || { rm -f libjanus_voicemail.so.0 && ln -s libjanus_voicemail.so.0.0.0 libjanus_voicemail.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_voicemail.so.0.0.0 libjanus_voicemail.so || { rm -f libjanus_voicemail.so && ln -s libjanus_voicemail.so.0.0.0 libjanus_voicemail.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_voicemail.lai /opt/janus/lib/janus/plugins/libjanus_voicemail.la
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_textroom.so.0.0.0 /opt/janus/lib/janus/plugins/libjanus_textroom.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_textroom.so.0.0.0 libjanus_textroom.so.0 || { rm -f libjanus_textroom.so.0 && ln -s libjanus_textroom.so.0.0.0 libjanus_textroom.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/plugins && { ln -s -f libjanus_textroom.so.0.0.0 libjanus_textroom.so || { rm -f libjanus_textroom.so && ln -s libjanus_textroom.so.0.0.0 libjanus_textroom.so; }; })
libtool: install: /usr/bin/install -c plugins/.libs/libjanus_textroom.lai /opt/janus/lib/janus/plugins/libjanus_textroom.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /opt/janus/lib/janus/plugins
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/janus/lib/janus/plugins

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/opt/janus/include/janus/plugins'
 /usr/bin/install -c -m 644 plugins/plugin.h '/opt/janus/include/janus/plugins'
 /bin/mkdir -p '/opt/janus/share/janus/recordings'
 /usr/bin/install -c -m 644 plugins/recordings/1234.nfo plugins/recordings/rec-sample-audio.mjr plugins/recordings/rec-sample-video.mjr '/opt/janus/share/janus/recordings'
 /bin/mkdir -p '/opt/janus/share/janus/streams'
 /usr/bin/install -c -m 644 plugins/streams/music.mulaw plugins/streams/radio.alaw plugins/streams/test_gstreamer.sh plugins/streams/test_gstreamer_1.sh '/opt/janus/share/janus/streams'
 /bin/mkdir -p '/opt/janus/lib/janus/transports'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   transports/libjanus_http.la transports/libjanus_websockets.la transports/libjanus_pfunix.la '/opt/janus/lib/janus/transports'
libtool: install: /usr/bin/install -c transports/.libs/libjanus_http.so.0.0.0 /opt/janus/lib/janus/transports/libjanus_http.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/transports && { ln -s -f libjanus_http.so.0.0.0 libjanus_http.so.0 || { rm -f libjanus_http.so.0 && ln -s libjanus_http.so.0.0.0 libjanus_http.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/transports && { ln -s -f libjanus_http.so.0.0.0 libjanus_http.so || { rm -f libjanus_http.so && ln -s libjanus_http.so.0.0.0 libjanus_http.so; }; })
libtool: install: /usr/bin/install -c transports/.libs/libjanus_http.lai /opt/janus/lib/janus/transports/libjanus_http.la
libtool: install: /usr/bin/install -c transports/.libs/libjanus_websockets.so.0.0.0 /opt/janus/lib/janus/transports/libjanus_websockets.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/transports && { ln -s -f libjanus_websockets.so.0.0.0 libjanus_websockets.so.0 || { rm -f libjanus_websockets.so.0 && ln -s libjanus_websockets.so.0.0.0 libjanus_websockets.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/transports && { ln -s -f libjanus_websockets.so.0.0.0 libjanus_websockets.so || { rm -f libjanus_websockets.so && ln -s libjanus_websockets.so.0.0.0 libjanus_websockets.so; }; })
libtool: install: /usr/bin/install -c transports/.libs/libjanus_websockets.lai /opt/janus/lib/janus/transports/libjanus_websockets.la
libtool: install: /usr/bin/install -c transports/.libs/libjanus_pfunix.so.0.0.0 /opt/janus/lib/janus/transports/libjanus_pfunix.so.0.0.0
libtool: install: (cd /opt/janus/lib/janus/transports && { ln -s -f libjanus_pfunix.so.0.0.0 libjanus_pfunix.so.0 || { rm -f libjanus_pfunix.so.0 && ln -s libjanus_pfunix.so.0.0.0 libjanus_pfunix.so.0; }; })
libtool: install: (cd /opt/janus/lib/janus/transports && { ln -s -f libjanus_pfunix.so.0.0.0 libjanus_pfunix.so || { rm -f libjanus_pfunix.so && ln -s libjanus_pfunix.so.0.0.0 libjanus_pfunix.so; }; })
libtool: install: /usr/bin/install -c transports/.libs/libjanus_pfunix.lai /opt/janus/lib/janus/transports/libjanus_pfunix.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /opt/janus/lib/janus/transports
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/janus/lib/janus/transports

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/opt/janus/include/janus/transports'
 /usr/bin/install -c -m 644 transports/transport.h '/opt/janus/include/janus/transports'
make[3]: Leaving directory '/home/cgs/janus-gateway'
make[2]: Leaving directory '/home/cgs/janus-gateway'
make[1]: Leaving directory '/home/cgs/janus-gateway'

至此,编译安装完成。

5. 配置及运行

5.1 查看Janus帮助

安装后使用下面命名查看Janus的帮助

/opt/janus/bin/janus --help

5.2 拷贝配置文件

WebSocket 的配置文件在源码中的位置./janus-gateway/conf/janus.transport.websockets.jcfg.sample,可以使用下面命令进行编辑:

vim ./janus-gateway/conf/janus.transport.websockets.jcfg.sample

配置插件,打开jcfg配置文件所在的目录,命令如下:

cd /opt/janus/etc/janus/

启动时需要配置文件,可以手工拷贝:

cp janus.jcfg.sample janus.jcfg

也可以使用脚本全部一次性拷贝,命令如下:

sudo make configs

如果不执行此命令,可能会报找不到插件。

5.3 启动 Janus

启动Janus的命令(不带打洞功能)如下:

/opt/janus/bin/janus --configs-folder=/opt/janus/etc/janus/

注意:上面的启动是不带打洞功能的。那么如果两个异地视频聊天,那么需要配置对应的turn服务器。而且必须在此配置,如何搭建coturn服务器,可以参考另一篇文章《Ubuntu中搭建ICE服务器(Coturn)》

启动Janus的命令(带打洞功能)如下:

/opt/janus/bin/janus --configs-folder=/opt/janus/etc/janus/ --stun-server=1.1.1.1:3478

可以通过如下命令,查看janus已经起来

# netstat -anp | grep janus
tcp        0      0 0.0.0.0:8188            0.0.0.0:*               LISTEN      3946/janus
tcp6       0      0 :::18000                :::*                    LISTEN      3946/janus
tcp6       0      0 :::18001                :::*                    LISTEN      3946/janus
tcp6       0      0 172.19.129.176:18001    117.136.8.142:58763     ESTABLISHED 3946/janus
tcp6       0      0 172.19.129.176:18001    117.136.8.142:58762     ESTABLISHED 3946/janus
tcp6       0      0 172.19.129.176:18001    117.136.8.142:58761     ESTABLISHED 3946/janus
udp        0      0 0.0.0.0:5002            0.0.0.0:*                           3946/janus
udp        0      0 0.0.0.0:5004            0.0.0.0:*                           3946/janus
udp        0      0 0.0.0.0:47277           0.0.0.0:*                           3946/janus
udp6       0      0 :::36906                :::*                                3946/janus
raw        0      0 0.0.0.0:132             0.0.0.0:*               7           3946/janus
raw6       0      0 :::132                  :::*                    7           3946/janus

5.4 运行Demo

访问Janus的demo,其安装位置是:/opt/janus/share/janus/demos
cd到这个目录后,使用以下命令用python搭个临时的web服务:

python -m SimpleHTTPServer 8080

5.5 效果

使用firefox浏览器,打开网址:http://localhost:8080/ ,下图为两台电脑进行视频会议的效果
在这里插入图片描述

6. 常见问题

6.1 安装失败

Q: 执行安装命令 make install ,出现安装失败,错误信息如下:

cgs@ubuntu:~/janus-gateway$ make install
`which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $0"\";"} END {}' > version.c
echo "Tue Feb 19 18:23:04 CST 2019" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$0"\";"} END {} ' >> version.c
echo "62" | awk 'BEGIN {} {print "int janus_version = "$0";"} END {} ' >> version.c
echo "0.6.2" | awk 'BEGIN {} {print "const char *janus_version_string = \""$0"\";"} END {} ' >> version.c
make  install-recursive
make[1]: Entering directory '/home/cgs/janus-gateway'
Making install in html
make[2]: Entering directory '/home/cgs/janus-gateway/html'
make[3]: Entering directory '/home/cgs/janus-gateway/html'
make[3]: Nothing to be done for 'install-exec-am'.
true
/bin/mkdir -p /opt/janus/share/janus/demos
/bin/mkdir: cannot create directory ‘/opt/janus’: Permission denied
Makefile:479: recipe for target 'install-data-local' failed
make[3]: *** [install-data-local] Error 1
make[3]: Leaving directory '/home/cgs/janus-gateway/html'
Makefile:367: recipe for target 'install-am' failed
make[2]: *** [install-am] Error 2
make[2]: Leaving directory '/home/cgs/janus-gateway/html'
Makefile:2807: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/cgs/janus-gateway'
Makefile:3104: recipe for target 'install' failed
make: *** [install] Error 2

A: 由于安装需要向 /usr/bin/opt/janus等目录拷贝文件,需要su权限,所以需要调整安装命令为 sudo make install ,即命令前面增加 sudo ,并根据提示输入su密码即可安装成功。

6.2 拷贝配置文件失败

Q: 执行拷贝配置文件命令 make configs ,出现没权限操作失败,错误信息如下:

cgs@ubuntu:~/janus-gateway$ make configs
/bin/mkdir -p /opt/janus/etc/janus
cp "/home/cgs/janus-gateway/conf/janus.jcfg.sample" "/opt/janus/etc/janus/janus.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.transport.http.jcfg.sample" "/opt/janus/etc/janus/janus.transport.http.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.transport.websockets.jcfg.sample" "/opt/janus/etc/janus/janus.transport.websockets.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.transport.pfunix.jcfg.sample" "/opt/janus/etc/janus/janus.transport.pfunix.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.eventhandler.sampleevh.jcfg.sample" "/opt/janus/etc/janus/janus.eventhandler.sampleevh.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.audiobridge.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.audiobridge.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.echotest.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.echotest.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.recordplay.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.recordplay.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.sip.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.sip.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.nosip.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.nosip.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.streaming.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.streaming.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.videocall.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.videocall.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.videoroom.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.videoroom.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.voicemail.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.voicemail.jcfg"; cp "/home/cgs/janus-gateway/conf/janus.plugin.textroom.jcfg.sample" "/opt/janus/etc/janus/janus.plugin.textroom.jcfg";
cp: cannot create regular file '/opt/janus/etc/janus/janus.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.transport.http.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.transport.websockets.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.transport.pfunix.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.eventhandler.sampleevh.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.audiobridge.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.echotest.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.recordplay.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.sip.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.nosip.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.streaming.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.videocall.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.videoroom.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.voicemail.jcfg': Permission denied
cp: cannot create regular file '/opt/janus/etc/janus/janus.plugin.textroom.jcfg': Permission denied
Makefile:3323: recipe for target 'configs' failed
make: *** [configs] Error 1

A: 由于拷贝配置文件需要向 /opt/janus/etc/janus目录拷贝文件,需要su权限,所以需要调整命令为 sudo make configs ,即命令前面增加 sudo ,并根据提示输入su密码即可成功。

6.3 Chrome浏览器访问问题

Q: 只能用Firefox浏览器进行测试,Chrome浏览器会报错。

A: Chrome浏览器的安全策略限制只能通过HTTPS访问摄像头等信息,若要支持Chrome浏览器的使用,则搭建的环境必须提供HTTPS访问,详细请查阅《搭建Janus的HTTPS环境》一文。

7. 参考资料

Janus开源项目说明
https://github.com/meetecho/janus-gateway

webrtc开源服务器janus安装
https://blog.csdn.net/bvngh3247/article/details/80648584

Janus部署总结
https://blog.csdn.net/u012231640/article/details/83618274

猜你喜欢

转载自blog.csdn.net/cgs1999/article/details/89881401
今日推荐