Tuesday, June 9, 2020

Janus Audio/Video plays around

WebRTC got to me. I can't say it was the first time, but most deep at the moment.

Small disclaimer. I'm not a web developer and only now got, that browser is OS by itself.

And the way to get media from the browser is WebRTC. So, let's make one more bicycle to have WebRTC - VoIP bridge.

There are many projects around to fill this gap. FreeSwitch (mode_verto or mod_sofia), Kamailio + RTPEngine are just to mention some.

And Janus was chosen. To try something new and get some skills in bright'n'shiny world of web development. And I like, that Janus has already built-in SIP plugin.

The idea of this small proof of concept - get audio and video streams separated and treated separately. Why - to have audio part handled by SIP (passed to Asterisk, more precisely) and video (or screen sharing part in the future) - by Janus SFU unit (VideoRoom plugin)

Project is just a set of 3 docker containers running in network host mode (just don't want to play around with NAT and all this stuff) and glued together with docker-compose. Nginx as a web server, Janus as Janus WebRTC server, and Asterisk as SIP application server.


Web part is just reworked and gloriously copy-pasted from original Janus demos.


This project is intended to be used as a playground for future experiments and donor of code for other projects.


Repo with project on GitHub.

Some of the pictures not to be so boring:


Audio is passed to Asterisk via SIP plugin, and Video is handled by EchoTest plugin.




Audio is mixing by Asterisk (SIP plugin as well), Video is handled by VideoRoom plugin.


Point, this one is tested on a VPS with a Let'sEncrypt certs to test it mostly "in the wild" and also there are many restrictions in modern browsers about WebRTC and security, which means even over LAN you need to have pure HTTPS.



2 comments:

  1. Hello Igor,
    I would like to reach you - with a project proposal. How can we establish contact?

    ReplyDelete
  2. > Kamailio + RTPEngine are just to mention some....

    JFYI, modern RTPEngine support drop-in replacement for Janus VideoRoom plugin, see https://github.com/sipwise/rtpengine/commit/2130e2f62b7dcc579497bdfd21d54f9b8c14a773

    ;-)

    ReplyDelete