GithubHelp home page GithubHelp logo

meetecho / janus-gateway Goto Github PK

View Code? Open in Web Editor NEW
7.8K 7.8K 2.4K 42.35 MB

Janus WebRTC Server

Home Page: https://janus.conf.meetecho.com

License: GNU General Public License v3.0

C 82.29% Shell 0.20% JavaScript 12.04% HTML 2.72% CSS 0.03% Makefile 0.40% M4 0.75% Emacs Lisp 0.01% Roff 0.29% Lua 1.08% Python 0.18%

janus-gateway's Introduction

Janus WebRTC Server

License: GPL v3 janus-ci Coverity Scan Build Status Fuzzing Status

Janus is an open source, general purpose, WebRTC server designed and developed by Meetecho. This version of the server is tailored for Linux systems, although it can be compiled for, and installed on, MacOS machines as well. Windows is not supported, but if that's a requirement, Janus is known to work in the "Windows Subsystem for Linux" on Windows 10: do NOT trust repos that provide .exe builds of Janus, they are not official and will not be supported.

For some online demos and documentations, make sure you pay the project website a visit!

Note well: this is the main branch for the multistream version of Janus, which is the new version. If you want to check the legacy version of Janus instead (i.e., 0.x, a.k.a. "legacy") click here instead.

If you have questions on Janus, or wish to discuss Janus with us and other users, please join our Community. If you encounter bugs, please submit an issue on GitHub: make sure you read the guidelines before opening an issue or a pull request, though.

Dependencies

To install it, you'll need to satisfy the following dependencies:

  • Jansson
  • libconfig
  • libnice (at least v0.1.16 suggested, v0.1.18 recommended)
  • OpenSSL (at least v1.0.1e)
  • libsrtp (at least v2.x suggested)
  • usrsctp (only needed if you are interested in Data Channels)
  • libmicrohttpd (at least v0.9.59; only needed if you are interested in REST support for the Janus API)
  • libwebsockets (at least v4.x suggested; only needed if you are interested in WebSockets support for the Janus API)
  • cmake (only needed if you are interested in WebSockets and/or BoringSSL support, as they make use of it)
  • rabbitmq-c (only needed if you are interested in RabbitMQ support for the Janus API or events)
  • paho.mqtt.c (only needed if you are interested in MQTT support for the Janus API or events)
  • nanomsg (only needed if you are interested in Nanomsg support for the Janus API)
  • libcurl (only needed if you are interested in the TURN REST API support)

A couple of plugins depend on a few more libraries:

  • Sofia-SIP (only needed for the SIP plugin)
  • libopus (only needed for the AudioBridge plugin)
  • libogg (needed for the VoiceMail plugin and/or post-processor, and optionally AudioBridge and Streaming plugins)
  • libcurl (only needed if you are interested in RTSP support in the Streaming plugin or in the sample Event Handler plugin)
  • Lua (only needed for the Lua plugin)
  • Duktape (only needed for the Duktape plugin)

Additionally, you'll need the following libraries and tools:

All of those libraries are usually available on most of the most common distributions. Installing these libraries on a recent Fedora, for instance, is very simple:

yum install libmicrohttpd-devel jansson-devel \
   openssl-devel libsrtp-devel sofia-sip-devel glib2-devel \
   opus-devel libogg-devel libcurl-devel pkgconfig \
   libconfig-devel libtool autoconf automake

Notice that you may have to yum install epel-release as well if you're attempting an installation on a CentOS machine instead.

On Ubuntu or Debian, it would require something like this:

apt install libmicrohttpd-dev libjansson-dev \
	libssl-dev libsofia-sip-ua-dev libglib2.0-dev \
	libopus-dev libogg-dev libcurl4-openssl-dev liblua5.3-dev \
	libconfig-dev pkg-config libtool automake
  • Note: please notice that libopus may not be available out of the box on your distro. In that case, you'll have to install it manually.

While libnice is typically available in most distros as a package, the version available out of the box in Ubuntu is known to cause problems. As such, we always recommend manually compiling and installing the master version of libnice. To build libnice, you need Python 3, Meson and Ninja:

git clone https://gitlab.freedesktop.org/libnice/libnice
cd libnice
meson --prefix=/usr build && ninja -C build && sudo ninja -C build install
  • Note: Make sure you remove the distro version first, or you'll cause conflicts between the installations. In case you want to keep both for some reason, for custom installations of libnice you can also run pkg-config --cflags --libs nice to make sure Janus can find the right installation. If that fails, you may need to set the PKG_CONFIG_PATH environment variable prior to compiling Janus, e.g., export PKG_CONFIG_PATH=/path/to/libnice/lib/pkgconfig

In case you're interested in compiling the sample Event Handler plugin, you'll need to install the development version of libcurl as well (usually libcurl-devel on Fedora/CentOS, libcurl4-openssl-dev on Ubuntu/Debian).

If your distro ships a pre-1.5 version of libsrtp, you'll have to uninstall that version and install 1.5.x, 1.6.x or 2.x manually. In fact, 1.4.x is known to cause several issues with WebRTC. While 1.5.x is supported, we recommend installing 2.x instead. Notice that the following steps are for version 2.2.0, but there may be more recent versions available:

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

Notice that the --enable-openssl part is important, as it's needed for AES-GCM support. As an alternative, you can also pass --enable-nss to have libsrtp use NSS instead of OpenSSL. A failure to configure libsrtp with either might cause undefined references when starting Janus, as we'd be trying to use methods that aren't there.

The Janus configure script autodetects which one you have installed and links to the correct library automatically, choosing 2.x if both are installed. If you want 1.5 or 1.6 to be picked (which is NOT recommended), pass --disable-libsrtp2 when configuring Janus to force it to use the older version instead.

  • Note: when installing libsrtp, no matter which version, you may need to pass --libdir=/usr/lib64 to the configure script if you're installing on a x86_64 distribution.

If you want to make use of BoringSSL instead of OpenSSL (e.g., because you want to take advantage of --enable-dtls-settimeout), you'll have to manually install it to a specific location. Use the following steps:

git clone https://boringssl.googlesource.com/boringssl
cd boringssl
# Don't barf on errors
sed -i s/" -Werror"//g CMakeLists.txt
# Build
mkdir -p build
cd build
cmake -DCMAKE_CXX_FLAGS="-lrt" ..
make
cd ..
# Install
sudo mkdir -p /opt/boringssl
sudo cp -R include /opt/boringssl/
sudo mkdir -p /opt/boringssl/lib
sudo cp build/ssl/libssl.a /opt/boringssl/lib/
sudo cp build/crypto/libcrypto.a /opt/boringssl/lib/

Once the library is installed, you'll have to pass an additional --enable-boringssl flag to the configure script, as by default Janus will be built assuming OpenSSL will be used. By default, Janus expects BoringSSL to be installed in /opt/boringssl -- if it's installed in another location, pass the path to the configure script as such: --enable-boringssl=/path/to/boringssl If you were using OpenSSL and want to switch to BoringSSL, make sure you also do a make clean in the Janus folder before compiling with the new BoringSSL support. If you enabled BoringSSL support and also want Janus to detect and react to DTLS timeouts with faster retransmissions, then pass --enable-dtls-settimeout to the configure script too.

For what concerns usrsctp, which is needed for Data Channels support, it is usually not available in repositories, so if you're interested in them (support is optional) you'll have to install it manually. It is a pretty easy and standard process:

git clone https://github.com/sctplab/usrsctp
cd usrsctp
./bootstrap
./configure --prefix=/usr --disable-programs --disable-inet --disable-inet6
make && sudo make install
  • Note: you may need to pass --libdir=/usr/lib64 to the configure script if you're installing on a x86_64 distribution.

The same applies for libwebsockets, which is needed for the optional WebSockets support. If you're interested in supporting WebSockets to control Janus, as an alternative (or replacement) to the default plain HTTP REST API, you'll have to install it manually:

git clone https://libwebsockets.org/repo/libwebsockets
cd libwebsockets
# If you want the stable version of libwebsockets, uncomment the next line
# git checkout v4.3-stable
mkdir build
cd build
# See https://github.com/meetecho/janus-gateway/issues/732 re: LWS_MAX_SMP
# See https://github.com/meetecho/janus-gateway/issues/2476 re: LWS_WITHOUT_EXTENSIONS
cmake -DLWS_MAX_SMP=1 -DLWS_WITHOUT_EXTENSIONS=0 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" ..
make && sudo make install

The same applies for Eclipse Paho MQTT C client library, which is needed for the optional MQTT support. If you're interested in integrating MQTT channels as an alternative (or replacement) to HTTP and/or WebSockets to control Janus, or as a carrier of Janus Events, you can install the latest version with the following steps:

git clone https://github.com/eclipse/paho.mqtt.c.git
cd paho.mqtt.c
make && sudo make install
  • Note: you may want to set up a different install path for the library, to achieve that, replace the last command by 'sudo prefix=/usr make install'.

In case you're interested in Nanomsg support, you'll need to install the related C library. It is usually available as an easily installable package in pretty much all repositories. The following is an example on how to install it on Ubuntu:

aptitude install libnanomsg-dev

Finally, the same can be said for rabbitmq-c as well, which is needed for the optional RabbitMQ support. In fact, several different versions of the library can be found, and the versions usually available in most distribution repositories are not up-do-date with respect to the current state of the development. As such, if you're interested in integrating RabbitMQ queues as an alternative (or replacement) to HTTP and/or WebSockets to control Janus, you can install the latest version with the following steps:

git clone https://github.com/alanxz/rabbitmq-c
cd rabbitmq-c
git submodule init
git submodule update
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make && sudo make install
  • Note: you may need to pass --libdir=/usr/lib64 to the configure script if you're installing on a x86_64 distribution.

To conclude, should you be interested in building the Janus documentation as well, you'll need some additional tools too:

On Fedora:

yum install doxygen graphviz

On Ubuntu/Debian:

aptitude install doxygen graphviz

Compile

Once you have installed all the dependencies, get the code:

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

Then just use:

sh autogen.sh

to generate the configure file. After that, configure and compile as usual to start the whole compilation process:

./configure --prefix=/opt/janus
make
make install

Since Janus requires configuration files for both the core and its modules in order to work, you'll probably also want to install the default configuration files to use, which you can do this way:

make configs

Remember to only do this once, or otherwise a subsequent make configs will overwrite any configuration file you may have modified in the meanwhile.

If you've installed the above libraries but are not interested, for instance, in Data Channels, WebSockets, MQTT and/or RabbitMQ, you can disable them when configuring:

./configure --disable-websockets --disable-data-channels --disable-rabbitmq --disable-mqtt

There are configuration flags for pretty much all external modules and many of the features, so you may want to issue a ./configure --help to dig through the available options. A summary of what's going to be built will always appear after you do a configure, allowing you to double check if what you need and don't need is there.

If Doxygen and graphviz are available, the process can also build the documentation for you. By default the compilation process will not try to build the documentation, so if you instead prefer to build it, use the --enable-docs configuration option:

./configure --enable-docs

You can also selectively enable/disable other features (e.g., specific plugins you don't care about, or whether or not you want to build the recordings post-processor). Use the --help option when configuring for more info.

Building on FreeBSD

  • Note: rtp_forward of streams only works streaming to IPv6, because of #2051 and thus the feature is not supported on FreeBSD at the moment.

When building on FreeBSD you can install the depencencies from ports or packages, here only pkg method is used. You also need to use gmake instead of make, since it is a GNU makefile. ./configure can be run without arguments since the default prefix is /usr/local which is your default LOCALBASE. Note that the configure.ac is coded to use openssl in base. If you wish to use openssl from ports or any other ssl you must change configure.ac accordingly.

pkg install libsrtp2 libusrsctp jansson libnice libmicrohttpd libwebsockets curl opus sofia-sip libogg jansson libnice libconfig \
    libtool gmake autoconf autoconf-wrapper glib

Building on MacOS

While most of the above instructions will work when compiling Janus on MacOS as well, there are a few aspects to highlight when doing that.

First of all, you can use brew to install most of the dependencies:

brew install jansson libnice openssl srtp libusrsctp libmicrohttpd \
	libwebsockets cmake rabbitmq-c sofia-sip opus libogg curl glib \
	libconfig pkg-config autoconf automake libtool

For what concerns libwebsockets, though, make sure that the installed version is higher than 2.4.1, or you might encounter the problems described in this post. If brew doesn't provide a more recent version, you'll have to install the library manually.

Notice that you may need to provide a custom prefix and PKG_CONFIG_PATH when configuring Janus as well, e.g.:

./configure --prefix=/usr/local/janus PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig

Everything else works exactly the same way as on Linux.

Configure and start

To start the server, you can use the janus executable. There are several things you can configure, either in a configuration file:

<installdir>/etc/janus/janus.jcfg

or on the command line:

<installdir>/bin/janus --help

Usage: janus [OPTIONS]...

-h, --help                    Print help and exit
-V, --version                 Print version and exit
-b, --daemon                  Launch Janus in background as a daemon
                              (default=off)
-p, --pid-file=path           Open the specified PID file when starting Janus
                              (default=none)
-N, --disable-stdout          Disable stdout based logging  (default=off)
-L, --log-file=path           Log to the specified file (default=stdout only)
-H  --cwd-path                Working directory for Janus daemon process
                              (default=/)
-i, --interface=ipaddress     Interface to use (will be the public IP)
-P, --plugins-folder=path     Plugins folder (default=./plugins)
-C, --config=filename         Configuration file to use
-F, --configs-folder=path     Configuration files folder (default=./conf)
-c, --cert-pem=filename       DTLS certificate
-k, --cert-key=filename       DTLS certificate key
-K, --cert-pwd=text           DTLS certificate key passphrase (if needed)
-S, --stun-server=address:port
                              STUN server(:port) to use, if needed (e.g.,
                              Janus behind NAT, default=none)
-1, --nat-1-1=ip              Public IP to put in all host candidates,
                              assuming a 1:1 NAT is in place (e.g., Amazon
                              EC2 instances, default=none)
-2, --keep-private-host       When nat-1-1 is used (e.g., Amazon EC2
                              instances), don't remove the private host,
                              but keep both to simulate STUN  (default=off)
-E, --ice-enforce-list=list   Comma-separated list of the only interfaces to
                              use for ICE gathering; partial strings are
                              supported (e.g., eth0 or eno1,wlan0,
                              default=none)
-X, --ice-ignore-list=list    Comma-separated list of interfaces or IP
                              addresses to ignore for ICE gathering;
                              partial strings are supported (e.g.,
                              vmnet8,192.168.0.1,10.0.0.1 or
                              vmnet,192.168., default=vmnet)
-6, --ipv6-candidates         Whether to enable IPv6 candidates or not
                              (experimental)  (default=off)
-O, --ipv6-link-local         Whether IPv6 link-local candidates should be
                              gathered as well  (default=off)
-l, --libnice-debug           Whether to enable libnice debugging or not
                              (default=off)
-f, --full-trickle            Do full-trickle instead of half-trickle
                              (default=off)
-I, --ice-lite                Whether to enable the ICE Lite mode or not
                              (default=off)
-T, --ice-tcp                 Whether to enable ICE-TCP or not (warning: only
                              works with ICE Lite)
                              (default=off)
-Q, --min-nack-queue=number   Minimum size of the NACK queue (in ms) per user
                              for retransmissions, no matter the RTT
-t, --no-media-timer=number   Time (in s) that should pass with no media
                              (audio or video) being received before Janus
                              notifies you about this
-W, --slowlink-threshold=number
                              Number of lost packets (per s) that should
                              trigger a 'slowlink' Janus API event to users
                              (default=0, feature disabled)
-r, --rtp-port-range=min-max  Port range to use for RTP/RTCP (only available
							  if the installed libnice supports it)
-B, --twcc-period=number      How often (in ms) to send TWCC feedback back to
                              senders, if negotiated (default=200ms)
-n, --server-name=name        Public name of this Janus instance
                              (default=MyJanusInstance)
-s, --session-timeout=number  Session timeout value, in seconds (default=60)
-m, --reclaim-session-timeout=number
                              Reclaim session timeout value, in seconds
                              (default=0)
-d, --debug-level=1-7         Debug/logging level (0=disable debugging,
                              7=maximum debug level; default=4)
-D, --debug-timestamps        Enable debug/logging timestamps  (default=off)
-o, --disable-colors          Disable color in the logging  (default=off)
-M, --debug-locks             Enable debugging of locks/mutexes (very
                              verbose!)  (default=off)
-a, --apisecret=randomstring  API secret all requests need to pass in order
                              to be accepted by Janus (useful when wrapping
                              Janus API requests in a server, none by
                              default)
-A, --token-auth              Enable token-based authentication for all
                              requests  (default=off)
-e, --event-handlers          Enable event handlers  (default=off)
-w, --no-webrtc-encryption    Disable WebRTC encryption, so no DTLS or SRTP
                              (only for debugging!)  (default=off)

Options passed through the command line have the precedence on those specified in the configuration file. To start the server, simply run:

<installdir>/bin/janus

This will start the server, and have it look at the configuration file.

Make sure you have a look at all of the configuration files, to tailor Janus to your specific needs: each configuration file is documented, so it shouldn't be hard to make changes according to your requirements. The repo comes with some defaults (assuming you issues make configs after installing the server) that tend to make sense for generic deployments, and also includes some sample configurations for all the plugins (e.g., web servers to listen on, conference rooms to create, streaming mountpoints to make available at startup, etc.).

To test whether it's working correctly, you can use the demos provided with this package in the html folder: these are exactly the same demos available online on the project website. Just copy the file it contains in a webserver, or use a userspace webserver to serve the files in the html folder (e.g., with php or python), and open the index.html page in either Chrome or Firefox. A list of demo pages exploiting the different plugins will be available. Remember to edit the transport/port details in the demo JavaScript files if you changed any transport-related configuration from its defaults. Besides, the demos refer to the pre-configured plugin resources, so if you add some new resources (e.g., a new videoconference) you may have to tweak the demo pages to actually use them.

Documentation

Janus is thoroughly documented. You can find the current documentation, automatically generated with Doxygen, on the project website.

Help us!

Any thought, feedback or (hopefully not!) insult is welcome!

Developed by @meetecho

janus-gateway's People

Contributors

adam-briggs avatar agclark27 avatar alexamirante avatar alienpavlov avatar ancorgs avatar andreasg123 avatar atoppi avatar benwtrent avatar chriswiggins avatar cmacq2 avatar davibe avatar dmitryyudin avatar do-not-set-2fa avatar fancycode avatar geigev avatar hasbean avatar ihusejnovic avatar lionelnicolas avatar lminiero avatar mpromonet avatar mtbramo avatar murillo128 avatar oscarvadillog avatar ploxiln avatar rsatom avatar s-ol avatar saghul avatar tgabi333 avatar thehunmonkgroup avatar tmatth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

janus-gateway's Issues

sometimes janus just stops sending long poll responses back

I dont really know why and there is no error output

I realize this is vague, if you tell me what to look out for I will provide more info

As you know, we are using a single session for everything to make the long poll easier to manage

compilation error (invalid session)

when I run the janus gateway script by
./janus
I got the following error

[ERR] [janus.c:janus_ws_handler:488:] Invalid session (null)
[ERR] [janus.c:janus_ws_handler:369:] Invalid url /favicon.ico ((null))

cannot load plugins undefined symbol :log_level

Hi,

I have just updated and recompiled but now encountered this runtime error for plugins

[janus.c:main:1494:] Couldn't load plugin 'janus_voicemail.so': ./plugins/janus_voicemail.so: undefined symbol: log_level

Not sure if it is related but I am getting lots of warnings in compile like

janus_sip.c:726:5: warning: format not a string literal and no format arguments [-Wformat-security]
JANUS_LOG(LOG_VERB, "Setting local video port: %d\n", session->media.local_video_rtp_port);

Segmentation fault on webinar host leave

I modified a little bit the code of the sharescreen example to have a webrtc webinar, no HTTPS required and it's showing the camera+microphone.

Here is how to reproduce:

  • Create one webinar room
  • Connect many clients to the room
  • Close the host tab

Here is the output:

No WebRTC media anymore
[Thread 0x7fffccff9700 (LWP 15466) exited]
Detaching handle from JANUS VideoRoom plugin
No WebRTC media anymore
[Thread 0x7fff86ffd700 (LWP 15472) exited]
Destroying session 616705426
[Thread 0x7fff877fe700 (LWP 15436) exited]
[Thread 0x7fffceffd700 (LWP 15425) exited]
[2396587641] WebRTC resources freed
[2396587641] Handle and related resources freed
[Thread 0x7fff8f7fe700 (LWP 15423) exited]
[New Thread 0x7fffceffd700 (LWP 15501)]
[New Thread 0x7fffccff9700 (LWP 15502)]
No WebRTC media anymore
[New Thread 0x7fff86ffd700 (LWP 15503)]
[Thread 0x7fff86ffd700 (LWP 15503) exited]
[New Thread 0x7fff877fe700 (LWP 15504)]
Detaching handle from JANUS VideoRoom plugin
No WebRTC media anymore
[Thread 0x7fff877fe700 (LWP 15504) exited]
[New Thread 0x7fff86ffd700 (LWP 15505)]
Detaching handle from JANUS VideoRoom plugin
No WebRTC media anymore
[Thread 0x7fff86ffd700 (LWP 15505) exited]
[New Thread 0x7fff877fe700 (LWP 15506)]
Destroying session 3728690222
[Thread 0x7fff8effd700 (LWP 15467) exited]
[Thread 0x7fff8cff9700 (LWP 15435) exited]
[984385855] WebRTC resources freed
[984385855] Handle and related resources freed
[Thread 0x7fff8d7fa700 (LWP 15433) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffcd7fa700 (LWP 15440)]
0x0000000000414699 in janus_ice_relay_rtcp ()
(gdb) backtrace
#0  0x0000000000414699 in janus_ice_relay_rtcp ()
#1  0x0000000000411f2a in janus_ice_cb_nice_recv ()
#2  0x00007ffff7bb5996 in ?? () from /usr/lib/x86_64-linux-gnu/libnice.so.10
#3  0x00007ffff597888b in socket_source_dispatch (source=source@entry=0x7fffdc0e70e0, callback=<optimized out>, user_data=<optimized out>)
    at /build/buildd/glib2.0-2.38.1/./gio/gsocket.c:3264
#4  0x00007ffff76a13b6 in g_main_dispatch (context=0x7fffdc0e7c30) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3065
#5  g_main_context_dispatch (context=context@entry=0x7fffdc0e7c30) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3641
#6  0x00007ffff76a1708 in g_main_context_iterate (context=0x7fffdc0e7c30, block=block@entry=1, dispatch=dispatch@entry=1, 
    self=<optimized out>) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3712
#7  0x00007ffff76a1b0a in g_main_loop_run (loop=0x7fffdc0e5d20) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3906
#8  0x00000000004130cc in janus_ice_thread ()
#9  0x00007ffff76c60f5 in g_thread_proxy (data=0x7fffb8000f20) at /build/buildd/glib2.0-2.38.1/./glib/gthread.c:798
#10 0x00007ffff52e4f6e in start_thread (arg=0x7fffcd7fa700) at pthread_create.c:311
#11 0x00007ffff5d679cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

This seg fault doesn't appear all the time actually. Another race problem I guess.

Use cases and field validations in SIP Gateway test are too tight

Hi Lorenzo,

This is not really a bug but just a request to open up the field validations and uses a bit, to help include more use cases.

I have several SIP provider accounts and find that I cannot use them in the test harness as the . (period) character is forbidden in the username field.

Also the @ character is forbidden in the address, but this looks necessary as you assume extension rather than fully qualified sip address.

It would be good to be able to specify a complete sip uri as an address and let the proxy handle that, rather than just append the proxy domain to an extension.

Again, I know you are not so concerned with application specifics, however your test app assumes too much about the proxy and allowed formats to be able to be tested by more than handful of cases. It is very enterprise internal SIP focussed rather than open Internet capable.

I am also not sure what aspects of this are in the plugin verses the test pages and so would not be very effective at recoding to solve this.

Cheers,

Warren

incorrect error from rest api when resending room join message

Expected message something along the lines, you are already in this room.

perhaps even a 304 not modified??/

received message

{
   "janus": "event",
   "plugindata": {
      "data": {
         "videoroom": "event",
         "error": "Unknown request 'join'"
      },
      "plugin": "janus.plugin.videoroom"
   },
   "sender": 2253383506,
   "transaction": "12345789"
}

Gateway not working behind nat

If the gateway is behind NAT the STUN setting does not seem to be working as all of the returned SDP has the inside address of the server, not the outside of the NAT.

I have tried several know good STUN servers. I also ran tcpdump on the server and there were no requests out to the STUN server to get addresses.

See SDP from Gateway below

v=0
o=- 5052254696594837720 3 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS janus
a=fingerprint:sha-256 C5:5F:DA:7D:84:47:B1:BF:6B:55:16:62:48:31:3E:D3:F1:7B:25:89:92:4A:4B:4D:4D:D9:D5:AF:EA:D8:15:44
m=audio 52898 RTP/SAVPF 111 103 104 0 8 106 105 13 126
c=IN IP4 10.0.0.204
a=sendrecv
a=rtcp:52291 IN IP4 10.0.0.204
a=ice-ufrag:gZ20
a=ice-pwd:Wka5ZcTc5hRM9eTNOw9CwD
a=setup:active
a=connection:new
a=mid:audio
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:12345 cname:janusaudio
a=ssrc:12345 msid:janus janusa0
a=ssrc:12345 mslabel:janus
a=ssrc:12345 label:janusa0
a=candidate:1 1 udp 2013266431 10.0.0.204 52898 typ host
a=candidate:1 2 udp 2013266430 10.0.0.204 52291 typ host
m=video 41486 RTP/SAVPF 100 116 117
c=IN IP4 10.0.0.204
a=sendrecv
a=rtcp:36645 IN IP4 10.0.0.204
a=ice-ufrag:Ys3N
a=ice-pwd:7G1PRxOrMBsghcvCi5A0t0
a=setup:active
a=connection:new
a=mid:video
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 goog-remb
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=ssrc:54321 cname:janusvideo
a=ssrc:54321 msid:janus janusv0
a=ssrc:54321 mslabel:janus
a=ssrc:54321 label:janusv0
a=candidate:2 1 udp 2013266431 10.0.0.204 41486 typ host
a=candidate:2 2 udp 2013266430 10.0.0.204 36645 typ host

Feature Request - Configure Static External Address for behind NAT hosting

It would to good be able to be able to configure a know external, outside of NAT, address so that there is no reliance on STUN to find the server address. This should behave similarly to the -x switch on the rfc5766turnserver project and tell the gateway to provide this address for all connection information, rather than include the real IP address of the server.

Segfaults when error occurs in session creation

Each time a peer connects, the create_session() is called, the parameters are janus_plugin_session *handle and int *error.

Following, the Echo Test, it seems that *error is to be set to some (custom ?) error code when some errors appear. However it segfaults whenever I try to set that *error to a value. I first tried on my plugins, then tried on a fresh Janus fork, on the Echo Test example.

Did this :

void janus_echotest_create_session (janus_plugin_session *handle, int *error) {
*error = -1;
return;
// I left the rest of the code, which doesn't matter because of the 'return'
}

So when client connects, it immediately segfaults.
And when runing with gdb, the bt gives :

Creating new handle in session 3700761429: 3684573026

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb7fff700 (LWP 5488)]
0x000000000042342f in janus_ice_handle_destroy (gateway_session=0x7fffbc000a30, handle_id=3684573026) at ice.c:310
310     JANUS_LOG(LOG_INFO, "Detaching handle from %s\n", plugin_t->get_name());
(gdb) bt
#0  0x000000000042342f in janus_ice_handle_destroy (gateway_session=0x7fffbc000a30, handle_id=3684573026) at ice.c:310
#1  0x000000000040bf21 in janus_process_incoming_request (source=0x7fffb7ffeb80, root=0x7fffb0001700) at janus.c:834
#2  0x000000000040b059 in janus_ws_handler (cls=0x645e50, connection=0x7fffb8008bd0, url=0x7fffb8008d95 "/janus/3700761429", 
    method=0x7fffb8008d90 "POST", version=0x7fffb8008da7 "HTTP/1.1", upload_data=0x0, upload_data_size=0x7fffb7ffed10, ptr=0x7fffb8008c28)
    at janus.c:626
#3  0x00007ffff6ecf001 in ?? () from /usr/lib/libmicrohttpd.so.10
#4  0x00007ffff6ed04b8 in ?? () from /usr/lib/libmicrohttpd.so.10
#5  0x00007ffff6ed3f71 in ?? () from /usr/lib/libmicrohttpd.so.10
#6  0x00007ffff4fc9124 in start_thread () from /usr/lib/libpthread.so.0
#7  0x00007ffff4cfd4bd in clone () from /usr/lib/libc.so.6

The error seems to be coming from the plugin_t->get_name() call (I had the same last instruction when trying on my own plugin) but I did not investigate much yet.

Hope it helps !

Segmentation fault when using SIP Plugin (but can receive call from a softphone)

I have a default-setup freeswitch and tried calling default sample number and experienced the error below.

[3544671760] No stream, wait a bit in case this trickle got here before the SDP...
[3544671760] There's a message for JANUS SIP plugin
[3544671760] Creating ICE agent (controlled mode)
[3544671760] WebRTC resources freed
No WebRTC media anymore
[3544671760] No stream, wait a bit in case this trickle got here before the SDP...
[3544671760] No stream, wait a bit in case this trickle got here before the SDP...
[3544671760] No stream, wait a bit in case this trickle got here before the SDP...
[3544671760] No stream, wait a bit in case this trickle got here before the SDP...
[3544671760] No stream, wait a bit in case this trickle got here before the SDP...
Segmentation fault (core dumped)

I do not know if I was able to register successfully via Janus as I got this error message

outbound(0x7ffd800016a0): FAILED to validate sip:[email protected]:47157;transport=udp
outbound(0x7ffd800016a0): FAILED with 481 Call/Transaction Does Not Exist

I used a softphone(xlite) registered to the same freeswitch and was able to call the account I registered via Janus SIP plugin. Calling in a different direction (browser->Janus->SIP Plugin->Freeswitch->xlite) caused the same segmentation error above.

HOWTO / Feature Request: Dynamic Room Creation

I can see that for the plugins that have a concept of rooms that rooms are configured in relevant plugin configuration file, with the room id being identified in an INI file section.

Is there any plans to support dynamic room creation through the API. Or alternatively something similar to the way nginx uses the HUP signal to trigger a reload of configuration files?

I'm fine with either way :)

Feature Request - Ability to define port range for Media

Providing a way to define a smaller port range for server media ports would assist in dealing with IT security groups who do not want to open the whole 49152-65536 range on UDP to a server.

We have had good success on other media servers restricting to a range of just 1000 ports for low concurrency applications.

select() premature fail with STUN settings

Hi Lorenzo
Thank you for sharing this great project.
While making first steps with it, I tried to install it behind NAT and use my own turnserver

All is well when opening the firewall and configuring a public IP.
When trying the STUN configuration , I get the following on the console;
.....

Sent 20 bytes 173.194.70.127:19302, waiting for reply...
[FATAL] [ice.c:janus_ice_init:167:] No response to our STUN BINDING test
[FATAL] [janus.c:main:1613:] Invalid STUN address stun.l.google.com:19302

I tried to change the timeout on the select() call from 5 sec to 50, but without effect. It exists immediately. Seems select() doesn't wait for reception/timeout at all.

Hope to be more helpful in the future, but i'm just starting the learning curve right now.
Best regards
Yossi

libweb sock has not installed properly

I got the following error when I run the install.sh script.

/usr/bin/ld: cannot find -lwebsock
collect2: error: ld returned 1 exit status
make[1]: *** [test] Error 1
make[1]: Leaving directory `/home/gayan/MyDetails/MyApplications/virtualClassRoomTest/janus-gateway/wstest'
make: *** [wstest] Error 2

The installer couldn't find the libwebsock lib, which is needed for WebSockets
You can install version 1.0.4 (required!) with the following steps:
wget http://paydensutherland.com/libwebsock-1.0.4.tar.gz
tar xfv libwebsock-1.0.4.tar.gz
cd libwebsock-1.0.4
./configure --prefix=/usr && make && sudo make install

I have installed the libwebsock using above steps. can anyone help me with this . Thanks

Variable name "new" in utils.h and utils.c conflicts with g++

In a recent commit, new functions (particularly janus_string_replace()) were introduced. It uses a variable names new (both in the .h and the .c files). While this is fine for compiling in C with gcc it fails when compiling c++ plugins with g++.

I edited the files and replaced new with another name to make it compile. Not a critical error, but since there is (for now) a small number of occurences, I think it should be fixed for those who write g++ plugins.

Communicating with both internal and external users

I am getting error
[ERR] [ice.c:janus_ice_cb_component_state_changed:554:] ICE failed for handle 4111273152...

This is happening when trying to use the echo test hosted on my own webserver and pointed via WebSockets to my local installation of the Janus Gateway. The Webserver and the gateway are not on the same machine but they are on the same network. I have enabled NAT traversal however and pointed it to googles open stun server(stun.l.google.com over port 19302). I have also enabled the rtp-port-range configuration attribute.

I have not finished testing with other pages yet but since I ran into this right out of the box, I figured I would post to see what is up :). Let me know if you need more info. I will continue to post my progress.

Stress and crash

After stressing the Bridge with 9 users (on 3 computers) in the same conference room, the server crashes with the following error:
(process:9240): GLib-ERROR **: Creating pipes for GWakeup: Too many open files

I don't remember that janus is opening files.

I also see this error message popping intensively:

[ERR] [ice.c:janus_ice_cb_nice_recv:526:] Still waiting for the DTLS stack for component 1 in stream 2...
[ERR] [ice.c:janus_ice_cb_nice_recv:526:] Still waiting for the DTLS stack for component 1 in stream 2...
[ERR] [ice.c:janus_ice_cb_nice_recv:526:] Still waiting for the DTLS stack for component 2 in stream 2...
[ERR] [ice.c:janus_ice_cb_nice_recv:526:] Still waiting for the DTLS stack for component 2 in stream 2...
[ERR] [ice.c:janus_ice_cb_nice_recv:526:] Still waiting for the DTLS stack for component 1 in stream 2...
[ERR] [ice.c:janus_ice_cb_nice_recv:526:] Still waiting for the DTLS stack for component 1 in stream 2...

transaction ids not necesary on synchronous http requests

as session and handle creation are synchronous there is no apparent need to specify a unique transaction id

Im only looking at this from the http api level so please advise if/why im wrong/misinformed

may also clarify which requests on the API are synchronous and which are asynchronous up a bit. I.E specify globally in the docs that am async request needs a UUID and just label each request as sync/async

SIP testing - Issues??

I am posting this here. It should be more a mailing list post, but for the time....
I tested Janus-gateway, siptest.html. Any comments or questions, I will try to answer.

Configuration:
Asterisk-11.8.rc2
(with opus/vp8 patch applied)
Janus-gateway
(current svn as of 3/10/2014)
ATA Sip phones
Browser: Chrome Version 33.0.1750.146 m (windows 7)
Chromium ersion 30.0.1599.114 Ubuntu 12.04

Testing the Janus-gateway sip plug-in.

Test #1
All components on the save private network
(192.168.1.xxx)

PSTN -> Siptest.html
    RESULT:  Webpage answers but NO AUDIO in either
         direction.  Disconnect by PSTN, NO
         segmentation fault.........

Test #2
siptest.html -> PSTN (Hangup webpage)
RESULT: Good two way audio, using HANGUP button
on webpage disconnects the call.

siptest.html -> PSTN    (Hangup PSTN)
    RESULT:  Good two way audio. Hanging up the
         sip phone, Janus produces a segmentation
         fault.
         [nua_l_bye]: 200 Session Terminated
         Pushing event: [
            "sip:": "event",
            "result": [
               "event": "hangup",
               "username": sip:[email protected]:5060",
               "reason": "200 Session Terminated"
            ]
        ]
        Segmentation fault [core dumped)

Test #3
Chrome -> Chromium
RESULT: Call Connected - Asterisk shows call active with
two channels in use. NO AUDIO in either direction.
Hangup button on either browser has NO affect.
Closing Chromium broswer, Janus segmemtation fault....

Chromium -> Chrome
    RESULT: Call Connected - Asterisk shows call active with
        two channels in use.  NO AUDIO in either direction
        Hangup button on either broswer returns the browser to
        start-up state, but Asterisk still show call active.
        In this test, Janus DID NOT segmentation fault.

Asterisk SIP.conf

[2250] ;ATA sip phone
type=friend
secret=1234
host=dynamic
context=local
qualify=yes
transport=udp
directmedia=no
videosupport=no
disallow=all
allow=ulaw

[8000] ;Chrome browser
secret=1234
context=local
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
qualify=yes
transport=udp,ws
callcounter=yes
icesupport=yes
directmedia=no
disallow=all
allow=ulaw,vp8

[8001] ;Chromium browser
secret=1234
context=local
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
qualify=yes
transport=ws
callcounter=yes
icesupport=yes
directmedia=no
transport=udp,ws
disallow=all
allow=ulaw,vp8

Hope this helps, I will continue to test..

Tom C

setup_media function not called in plugin

While I was "debugging" with some JANUS_LOGs and sprintfs I found out no output from the code that was inside the setup_media function.

Then I went back to the echotest plugin to test : I tried altering the inside of the function, adding sprintf output, deliberately causing segfaults, but it did not produce any output nor did it fail.

I even went to the plugin structure and bound .setup_media to another function (like janus_echotest_handle_message), it produced a warning upon compilation (which is normal), but then I could use the echotest plugin normally.

I understand that in the case of the echotest, this setup_media function doesn't do anything, but in my case I need to setup environement things when the peer connection becomes available.

Can anybody confirm that the setup_media is not called ?

EDIT :
I have just "confirmed" that the function was not called by trying to cause a voluntary segfaults at the top of the setup_media function using :

char *p = (char *)0;
*p = 'c';

And it did not segfaulted.

Room Name/Description has to be unique

In our use case several different companies may create separate rooms

for example
Super Dev Co
Awesome Software Inc

may both want rooms called developers, testers, management etc.

I dont think it makes sense for this field to need to be unique

Segfault when creating offer with "audio: false" from CHROME

How to reproduce the error :
In the attach success callback, use createOffer with media: { audio: false } and try with Chrome.

It works well with Firefox (30.0) but makes Janus segfaults with Chrome (35.0.xxxx), I am using Archlinux 64 bits.

It doesnt make Janus segfault when using media: {recvAudio: false, sendAudio: false}.

One can reproduce the bug easily by editing the echotest javascript file.

Last lines of console for info :

HTTP webserver started (port 8088, /janus path listener)...
[WARN] HTTPS webserver disabled
Creating new session: 1928089637
Creating new handle in session 1928089637: 4037210781
There's a message for JANUS EchoTest plugin
There's a message for JANUS EchoTest plugin
[4037210781] Creating ICE agent (controlled mode)
zsh: segmentation fault (core dumped)  ./janus

404 after receiving call and not accepting it

Hi,

I found a bug in the SIP plugin. To reproduce this bug do the following:

  1. register in the plugin
  2. call to the plugin from another sip account, but don't answer it in the plugin
  3. end call from other sip account
  4. try to call to the other sip account from the plugin

It will give you a 404. In my SIP log, I found that it was transforming the URI sent to the PBX.

My accounts have the following structure: sip:-@host
In their context I have a extension that listens to the code part and generates the unique identifier and then dials that account. Perhaps somewhere it is caching that number and transforms the URI sent to my PBX.

The weird part is that the "To:" part in my SIP log is pointing to the correct URI, and in the "Authorization:" part the "uri=" is transformed.

an overview endpoint would be swell

long story short, I want to load balance between multiple janus instances.
Keeping track on my end of state isnt a big deal, but the state is already there in janus

the main thing that would be useful is number of peer connections,

thoughts?

Empty JSEP in json causing validation error when jsep not required

Our JSON encoder was sending an empty JSEP when subscribing to a stream

We have made our encoder smarter andnot included the empty key but I imagine people will have a generic janus Message type that has a jsep

There is no need to validate the jsep if it is not used

OR

document that you MUST not send it

cheers

Segfault on second party joining MCU

I am testing the MCU and finding a get segfault immediately on second party joining or after several seconds.

Running under gdb I get these details:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc97fa700 (LWP 3594)]
0x000000000041704e in janus_ice_cb_nice_recv (agent=0x7fffd0049620, stream_id=2, component_id=2, len=92,
buf=0x7fffc97e9bf0 "\001\001", ice=0x7fffd00d7560) at ice.c:479
479 janus_ice_handle *handle = stream->handle;

(gdb) bt
#0 0x000000000041704e in janus_ice_cb_nice_recv (agent=0x7fffd0049620, stream_id=2, component_id=2, len=92,

buf=0x7fffc97e9bf0 "\001\001", ice=0x7fffd00d7560) at ice.c:479

#1 0x00007ffff7bb5996 in ?? () from /usr/lib/x86_64-linux-gnu/libnice.so.10
#2 0x00007ffff575b88b in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#3 0x00007ffff76a13b6 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007ffff76a1708 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff76a1b0a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00000000004176cd in janus_ice_thread (data=0x7fffdc002040) at ice.c:553
#7 0x00007ffff76c60f5 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff5e1ff6e in start_thread (arg=0x7fffc97fa700) at pthread_create.c:311
#9 0x00007ffff5b4a9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Environment:
AWS m1.medium
Ubuntu 13.10 (GNU/Linux 3.11.0-15-generic x86_64)

libnice10: A 0.1.4-1

Segmentation fault (core dumped)

Hi,
I get new issue why trying test janus gateway more times. Somtimes, gateway down as soon as I click stop button of SIP GATEWAY features to unregister an user. Here is output console.

...
...
Referer: http://192.168.16.64/janus/siptest.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: vi,fr-FR;q=0.8,fr;q=0.6,en-US;q=0.4,en;q=0.2,ko;q=0.2,af;q=0.2
Request completed, freeing data
Got a HTTP POST request on /janus/2508622990/1529760948...
... Just parsing headers for now...
Host: 192.168.16.64:8088
Connection: keep-alive
Content-Length: 47
Accept: application/json, text/javascript, /; q=0.01
Origin: http://192.168.16.64
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.92 Safari/537.36
Content-Type: application/json
Referer: http://192.168.16.64/janus/siptest.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: vi,fr-FR;q=0.8,fr;q=0.6,en-US;q=0.4,en;q=0.2,ko;q=0.2,af;q=0.2
Got a HTTP POST request on /janus/2508622990/1529760948...
... parsing request...
Session: 2508622990
Handle: 1529760948
Processing POST data (application/json)...
-- Uploaded data (47 bytes)
-- Data we have now (47 bytes)
Got a HTTP POST request on /janus/2508622990/1529760948...
... parsing request...
Session: 2508622990
Handle: 1529760948
Processing POST data (application/json)...
Done getting payload, we can answer
[janus.c:janus_ws_handler:315:] {"janus":"detach","transaction":"F1VwmiIYL9wz"}
Detaching handle from JANUS SIP plugin
No WebRTC media anymore
Destroying SIP session (1001)...
[nua_r_shutdown]: 100 Shutdown started
Request completed, freeing data
Got a HTTP OPTIONS request on /janus/2508622990...
... Just parsing headers for now...
Host: 192.168.16.64:8088
Connection: keep-alive
Access-Control-Request-Method: POST
Origin: http://192.168.16.64
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.92 Safari/537.36
Access-Control-Request-Headers: accept, content-type
Accept: /
Referer: http://192.168.16.64/janus/siptest.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: vi,fr-FR;q=0.8,fr;q=0.6,en-US;q=0.4,en;q=0.2,ko;q=0.2,af;q=0.2
Request completed, freeing data
Got a HTTP POST request on /janus/2508622990...
... Just parsing headers for now...
Host: 192.168.16.64:8088
Connection: keep-alive
Content-Length: 48
Accept: application/json, text/javascript, /; q=0.01
Origin: http://192.168.16.64
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.92 Safari/537.36
Content-Type: application/json
Referer: http://192.168.16.64/janus/siptest.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: vi,fr-FR;q=0.8,fr;q=0.6,en-US;q=0.4,en;q=0.2,ko;q=0.2,af;q=0.2
Got a HTTP POST request on /janus/2508622990...
... parsing request...
Session: 2508622990
Processing POST data (application/json)...
-- Uploaded data (48 bytes)
-- Data we have now (48 bytes)
Got a HTTP POST request on /janus/2508622990...
... parsing request...
Session: 2508622990
Processing POST data (application/json)...
Done getting payload, we can answer
[janus.c:janus_ws_handler:315:] {"janus":"destroy","transaction":"BAUDXIz52l2t"}
Request completed, freeing data
[nua_r_shutdown]: 200 Shutdown successful
Segmentation fault (core dumped)

transaction as integer returns strange error

Hey there,

When Im creating a session over the rest api, i was setting the transaction param as an int rather then a string in the json

My Bad

The error I was getting back was missing param transaction, which was confusing

It would be great to hear your thoughts on this.
Ps we are gonna be consuming the API a lot over the next few weeks so how would you like feedback to be submitted?

Cant get past usrsctp compile error

Hi,

I wonder if anyone else has solved this compile error?

"sctp_asconf.c:216: error: dereferencing pointer 'sin6' does break strict-aliasing rules"

I have tried setting -fno-strict-aliasing in CFLAGS but it still raises the error.

OS is Centos 6.4 with gcc 4.4.7

I dont really need Datachannel can I exclude this from the janus build config?

add event type to janus event messages

This is more a request then an issue but I think its important to get to these issues early

the below event is from documentation.
It is the initial answer to a WebRTC offer, however without knowledge of the transaction this event could be in response to a reconfiguration/renegotiation e.t.c

I think it would be useful to have named event types?

{
   "janus": "event",
   "plugindata": {
      "data": {
         "videoroom": "event",
         "room": 1234,
         "result": "ok"
},
      "plugin": "janus.plugin.videoroom"
   },
   "sender": 947803651,
   "transaction": "CJpyI7KMASVs",
   "jsep": {
      "sdp": "v=0 [..]",
      "type": "answer"
   }
}

REST endpoints documentation

First - thanks for releasing this. Of all the WebRTC gateways that have been released this is the most exciting so far IMO (modular architecture, lightweight implementation, etc). At least from my early look...

I was just wondering whether there was anywhere that the actual REST endpoints for the /janus services are documented. While I think having the JS library is a good idea, I'm pretty keen to drive janus from node so will be manually triggering a lot of stuff there.

If the documentation doesn't exist already, I'm probably going to be compiling some of this information from monitoring network traffic and looking through the source so if you would like me to include this in the wiki or something then I'd be more than happy to do that.

Cheers,
Damon.

Freeswitch

Nice work guys,
Can Janus be used in front of Freeswitch to provide SIP-to-WebRTC gateway to operate with web clients?

Is janus supporting big room?

I mean that in a room, thousands of people are attending a webinar. I think that one server can't host so many peers at the same time, so maybe need a load balancer.

So is janus supporting sync stream in more than one server?

[ SIP Gateway ] register failed.

Hi,
I got demo Video Call, Video MCU successfully but I still stucked at SIP Gateway feature. I can't register a sip user to Asterisk Sip Server. Log of Janus gives thounsand of lines and It doesn't stop unless I quit janus.

tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 9303, trying 12032
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 12032, trying 14761
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 14761, trying 17490
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 17490, trying 20219
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 20219, trying 22948
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 22948, trying 25677
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 25677, trying 28406
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 28406, trying 31135
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 31135, trying 33864
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 33864, trying 36593
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 36593, trying 39322
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 39322, trying 42051
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 42051, trying 44780
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 44780, trying 47509
tport_bind_server(0x7f7b842ad0d0): cannot bind all transports to port 47509, trying 50238
............................................

What should I do to resolve this issue ? Thanks !

Janus Build

I tried to compile the latest janus gateway and the first think that I saw was that it don't complains about I don't have usrsctp. The binaries of sctptest seems commited in git. Please remove them.
After I tried compile and it complains, but following the instructions I tried to run bootstrap script but it complains configure.ac:35: error: required file '../../ltmain.sh' not found

I have to checkout svn 2 directories before to this script run fine.

Connection times are generally long, but very quick from a tightly coupled client

I had observed that connection set up times were much longer than I am used to with WebRTC, so I decided to setup a local VM without NAT to see how this improved connection setup speed.

On first test I was impressed as I saw very quick connection in the echo test and video call. So I though this may require more investigation on the NAT scenarios. However, I soon discovered that the fast connection setup times were only observed on the host for the VM. I tested from other machines on the same subnet as the VM and they had the same long setup times as I had experienced over Internet and AWS NAT hosted. The VM host, Virtual Box on Windows 7, and other machines are all on 1Gb ethernet, so I could not see how that would introduce any significant latency, but it definitely increases connection time by over 5 times in some cases. Using echo test, on the VM host in Canary, I see remote video in about 3 seconds. On all the other clients, also using Canary, it can take up to 15 seconds before I see remote video.

I am about to capture some logs to see what is occurring on the server side. Will post soon.

Troubles shutting Janus down

When trying to stop Janus with CTRL + C, it often gets stuck on this :

^CStopping gateway, please wait...
Sessions watchdog stopped
Closing webserver...

A second CTRL + C gives the ^CIn a hurry? I'm trying to free resources cleanly, here! but still stays stuck, until a last CTRL + C gives ^COk, leaving immediately...

I know signal is caught in the code, but there is obviously something preventing Janus from shutting down.

But sometimes it all happens just fine. I haven't been able to identify when that happens.

Janus errors when deployed on the root path

Reproduction steps:

  1. set base_path = / in janus.cfg
  2. boot the server
  3. run curl -X POST localhost:8088/janus -v -d '{"janus":"create", "transaction":"sadf"}'
  4. Empty response is returned with this error:
    (process:21118): GLib-CRITICAL **: g_strsplit: assertion 'delimiter[0] != '\0'' failed

The only plugin active was the video rooms plugin.

Let me know if there's anything else I can do to help debug!

"ice" error while installing

I followed installation guide but I got the following error :
$sh install.sh
...
ice.c: In function ‘janus_ice_setup_local’:
ice.c:504: warning: implicit declaration of function ‘g_thread_new’
ice.c:504: warning: assignment makes pointer from integer without a cast
ice.c:505: error: ‘NICE_COMPATIBILITY_RFC5245’ undeclared (first use in this function)
ice.c:505: error: (Each undeclared identifier is reported only once
ice.c:505: error: for each function it appears in.)
make: *** [ice.o] Error 1
Error compiling, giving up...

My machine is running on Centos 6.3 32bit and i get source from github.com/meetecho/janus-gateway.

Segmentation fault on Video Conference Leaving

Hi,

I did a test on having 6 clients in the conference room, when they quit the room I ended having a seg fault that I traced with gdb:

[1814209404]  Got an RTCP packet (video stream)!
Got REMB bitrate 334206, need to cap it to 128000
  >> 167103 * 2^1 = 334206
new brexp:      0
new brmantissa: 128000

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff6d7fa700 (LWP 27643)]
0x0000000000409182 in janus_relay_rtcp (handle=0x7fff500ce690, video=1, buf=0x7fff6d7e9bf0 "\201", <incomplete sequence \311>, len=56)
    at janus.c:1073
1073        if(!session || session->stop)
(gdb) backtrace
#0  0x0000000000409182 in janus_relay_rtcp (handle=0x7fff500ce690, video=1, buf=0x7fff6d7e9bf0 "\201", <incomplete sequence \311>, len=56)
    at janus.c:1073
#1  0x00007ffff1034c08 in janus_videoroom_incoming_rtcp (handle=0x7fff4c156b80, video=1, 
    buf=0x7fff6d7e9bf0 "\201", <incomplete sequence \311>, len=56) at janus_videoroom.c:481
#2  0x00000000004132cd in janus_ice_cb_nice_recv (agent=0x7fffe44bc2d0, stream_id=2, component_id=2, len=70, 
    buf=0x7fff6d7e9bf0 "\201", <incomplete sequence \311>, ice=0x7fffe4501450) at ice.c:392
#3  0x00007ffff7bb5996 in ?? () from /usr/lib/x86_64-linux-gnu/libnice.so.10
#4  0x00007ffff575b88b in socket_source_dispatch (source=source@entry=0x7fffe4501760, callback=<optimized out>, user_data=<optimized out>)
    at /build/buildd/glib2.0-2.38.1/./gio/gsocket.c:3264
#5  0x00007ffff76a13b6 in g_main_dispatch (context=0x7fffe44bc210) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3065
#6  g_main_context_dispatch (context=context@entry=0x7fffe44bc210) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3641
#7  0x00007ffff76a1708 in g_main_context_iterate (context=0x7fffe44bc210, block=block@entry=1, dispatch=dispatch@entry=1, 
    self=<optimized out>) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3712
#8  0x00007ffff76a1b0a in g_main_loop_run (loop=0x7fffe44ba650) at /build/buildd/glib2.0-2.38.1/./glib/gmain.c:3906
#9  0x0000000000413333 in janus_ice_thread (data=0x7fff4c156be0) at ice.c:404
#10 0x00007ffff76c60f5 in g_thread_proxy (data=0x7fffbc0079e0) at /build/buildd/glib2.0-2.38.1/./glib/gthread.c:798
#11 0x00007ffff5e1ff6e in start_thread (arg=0x7fff6d7fa700) at pthread_create.c:311
#12 0x00007ffff5b4a9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

For information the everything was run locally: Gateway + Clients + Webserver, so you can imagine how stressed the machine was.

I would guess that the session is being release between if !session and session->stop in another thread

Video MCU doesn't work, stream freezing..

Hi guys, when I want to talk with my friends over Video MCU example, after a few seconds, remote video screens of my friends doesn't work, it freezing..

So anyone knows what the problem is?

Audio delay

First of all, great work on the gateway, it looks very promising.

There's a consistent delay - several 100 milliseconds (around 600ms, disregarding the latency of the connection itself which is < 10ms) - between sending and receiving audio once a connection is established. Do you have a clue where this delay is coming from?

Newbie Trying Janus...Fails!

So, I installed all of the dependencies and built the lipopus for Ubuntu 12.04.
I then built janus and all appeared well.
Then I started janus and attempted to browse to one of the html files. Nothing happens in the browser. I try to browse: http://192.168.122.215:8088//home/ray/meetecho/janus-gateway/html/index.html and I get this from janus:

Got a HTTP GET request on /home/ray/meetecho/janus-gateway/html/index.html...
... Just parsing headers for now...
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.5
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0
Host: 192.168.122.215:8088
Got a HTTP GET request on /home/ray/meetecho/janus-gateway/html/index.html...
... parsing request...
Session: index.html
[janus.c:janus_ws_handler:369:] Invalid session index.html
Request completed, freeing data
Rewind! (./plugins/streams/radio.alaw)
Rewind! (./plugins/streams/radio.alaw)

Any ideas?

Ray

Video MCU test segfault

Hi,
I'm getting a segfault running the video MCU test example. Here is my testing environment:

  • using latest janus code
  • same result with and without nodatachansinstall option
  • HTML pages served locally from a node.js server
  • janus server running on a cloud platform with public IP redirected to private IP

My NAT configuration section in janus.cfg:
[nat]
public_ip = 1.2.3.4
stun_server = stun.voip.eutelia.it
stun_port = 3478

The echo test works perfect, but the video MCU test makes janus crash right after the second participant enters the room during ICE negotiation (line 536 in ice.c). Here is the backtrace:

(gdb) bt
#0  0x000000000041a74f in janus_ice_cb_nice_recv (agent=0x7fe3d0036620, stream_id=2, component_id=1, len=88, buf=0x7fe39a1ebbd0 "\001\001", ice=0x7fe3d007dde0) at ice.c:536
#1  0x00007fe3e81a499e in component_emit_io_callback (component=0x7fe3d00a2640, buf=0x7fe39a1ebbd0 "\001\001", buf_len=88) at component.c:813
#2  0x00007fe3e81a9ada in component_io_cb (gsocket=<value optimized out>, condition=<value optimized out>, user_data=0x7fe39c002f40) at agent.c:3923
#3  0x00007fe3e7aabb06 in socket_source_dispatch (source=0x7fe3d007def0, callback=<value optimized out>, user_data=<value optimized out>) at gsocket.c:3165
#4  0x00007fe3e750f1c3 in g_main_dispatch (context=0x7fe3d0002a60) at gmain.c:3054
#5  g_main_context_dispatch (context=0x7fe3d0002a60) at gmain.c:3630
#6  0x00007fe3e75110c8 in g_main_context_iterate (context=0x7fe3d0002a60, block=1, dispatch=1, self=<value optimized out>) at gmain.c:3701
#7  0x00007fe3e7512295 in g_main_loop_run (loop=0x7fe3d0002100) at gmain.c:3895
#8  0x000000000041b180 in janus_ice_thread (data=0x7fe3a8002550) at ice.c:662
#9  0x00007fe3e7534b55 in g_thread_proxy (data=0x7fe39c0046d0) at gthread.c:798
#10 0x00007fe3e5c919d1 in start_thread () from /lib64/libpthread.so.0
#11 0x00007fe3e59deb5d in clone () from /lib64/libc.so.6
(gdb)

Let me know if you need more information, and congrats for the great work Lorenzo !

Philippe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.