SlideShare a Scribd company logo
1 of 116
Download to read offline
Janus and WebRTC: a practical journey
Lorenzo Miniero
Who am I?
Lorenzo Miniero
• Ph.D @ UniNA
• Chairman @ Meetecho
• Main author of Janus®
Contacts and info
• rtcexpo@meetecho.com
• https://twitter.com/elminiero
• https://www.slideshare.net/LorenzoMiniero
Just a few words on Meetecho
• Co-founded in 2009 as an academic spin-off
• University research efforts brought to the market
• Completely independent from the University
• Focus on real-time multimedia applications
• Strong perspective on standardization and open source
• Several activities
• Consulting services
• Commercial support and Janus licenses
• Streaming of live events (IETF, ACM, etc.)
• Proudly brewed in sunny Napoli, Italy
Home Sweet Home!
We just met in Napoli for JanusCon!
https://januscon.it
We just met in Napoli for JanusCon!
https://januscon.it
WebRTC reference architecture: peer-to-peer
WebRTC reference architecture: peer-to-peer
Involving a server as a peer (and applications)
Involving a server as a peer (and applications)
Involving a server as a peer (and applications)
Involving a server as a peer (and applications)
Involving different technologies as well
Involving different technologies as well
Involving different technologies as well
What’s Janus?
Janus
General purpose, open source WebRTC server
• https://github.com/meetecho/janus-gateway
• Demos and documentation: https://janus.conf.meetecho.com
• Community: https://groups.google.com/forum/#!forum/meetecho-janus
A vibrant community
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Modular architecture
• The core only implements the WebRTC stack
• JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ...
• Plugins expose Janus API over different “transports”
• Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg
• “Application” logic implemented in plugins too
• Users attach to plugins via the Janus core
• The core handles the WebRTC stuff
• Plugins route/manipulate the media/data
• Plugins can be combined on client side as “bricks”
• Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
Extensible Architecture and API
Extensible Architecture and API
Configuring Janus
• Janus and plugins can be configured via .jcfg files (libconfig format)
• Old INI format still supported, though
• Some (core-only) properties can be set via command-line as well
• Several options to configure the server’s behaviour
• Logging, transport, media settings, etc.
• Format of libconfig files is quite simple to understand and use
# This is a comment
name0 = value0
category1: {
name1 = number
name2 = "string"
name3 = boolean
...
}
category2: {
name2 = [ array ]
...
}
Configuring Janus
• Janus and plugins can be configured via .jcfg files (libconfig format)
• Old INI format still supported, though
• Some (core-only) properties can be set via command-line as well
• Several options to configure the server’s behaviour
• Logging, transport, media settings, etc.
• Format of libconfig files is quite simple to understand and use
# This is a comment
name0 = value0
category1: {
name1 = number
name2 = "string"
name3 = boolean
...
}
category2: {
name2 = [ array ]
...
}
Configuring Janus
• Janus and plugins can be configured via .jcfg files (libconfig format)
• Old INI format still supported, though
• Some (core-only) properties can be set via command-line as well
• Several options to configure the server’s behaviour
• Logging, transport, media settings, etc.
• Format of libconfig files is quite simple to understand and use
# This is a comment
name0 = value0
category1: {
name1 = number
name2 = "string"
name3 = boolean
...
}
category2: {
name2 = [ array ]
...
}
Example of configuration file
# This is a comment
general: {
configs_folder = "/opt/janus/etc/janus"
plugins_folder = "/opt/janus/lib/janus/plugins"
transports_folder = "/opt/janus/lib/janus/transports"
events_folder = "/opt/janus/lib/janus/events"
debug_level = 5
admin_secret = "janusoverlord"
}
certificates: {
}
media: {
rfc_4588 = true
rtp_port_range = "20000-40000"
}
nat: {
nice_debug = false
ice_ignore_list = "vmnet"
}
plugins: {
}
transports: {
}
events: {
}
Configuring the core
• The Janus core is configured in janus.jcfg
• As anticipated, some properties can be overridden via command-line too
• Different categories that can be configured
• general
• General settings (logging, daemonization, etc.)
• certificates
• Certificate and key to use (DTLS only, autogenerated if missing)
• media
• Media related stuff (RTP range, DTLS mtu, etc.)
• nat
• ICE related settings (ICE Lite/TCP, STUN/TURN, etc.)
• plugins, transports
• Media and transport plugins NOT to load
• events
• Event handlers settings
Configuring the core
• The Janus core is configured in janus.jcfg
• As anticipated, some properties can be overridden via command-line too
• Different categories that can be configured
• general
• General settings (logging, daemonization, etc.)
• certificates
• Certificate and key to use (DTLS only, autogenerated if missing)
• media
• Media related stuff (RTP range, DTLS mtu, etc.)
• nat
• ICE related settings (ICE Lite/TCP, STUN/TURN, etc.)
• plugins, transports
• Media and transport plugins NOT to load
• events
• Event handlers settings
Configuring the core
• The Janus core is configured in janus.jcfg
• As anticipated, some properties can be overridden via command-line too
• Different categories that can be configured
• general
• General settings (logging, daemonization, etc.)
• certificates
• Certificate and key to use (DTLS only, autogenerated if missing)
• media
• Media related stuff (RTP range, DTLS mtu, etc.)
• nat
• ICE related settings (ICE Lite/TCP, STUN/TURN, etc.)
• plugins, transports
• Media and transport plugins NOT to load
• events
• Event handlers settings
Configuring the core
• The Janus core is configured in janus.jcfg
• As anticipated, some properties can be overridden via command-line too
• Different categories that can be configured
• general
• General settings (logging, daemonization, etc.)
• certificates
• Certificate and key to use (DTLS only, autogenerated if missing)
• media
• Media related stuff (RTP range, DTLS mtu, etc.)
• nat
• ICE related settings (ICE Lite/TCP, STUN/TURN, etc.)
• plugins, transports
• Media and transport plugins NOT to load
• events
• Event handlers settings
Configuring the core
• The Janus core is configured in janus.jcfg
• As anticipated, some properties can be overridden via command-line too
• Different categories that can be configured
• general
• General settings (logging, daemonization, etc.)
• certificates
• Certificate and key to use (DTLS only, autogenerated if missing)
• media
• Media related stuff (RTP range, DTLS mtu, etc.)
• nat
• ICE related settings (ICE Lite/TCP, STUN/TURN, etc.)
• plugins, transports
• Media and transport plugins NOT to load
• events
• Event handlers settings
Configuring the core
• The Janus core is configured in janus.jcfg
• As anticipated, some properties can be overridden via command-line too
• Different categories that can be configured
• general
• General settings (logging, daemonization, etc.)
• certificates
• Certificate and key to use (DTLS only, autogenerated if missing)
• media
• Media related stuff (RTP range, DTLS mtu, etc.)
• nat
• ICE related settings (ICE Lite/TCP, STUN/TURN, etc.)
• plugins, transports
• Media and transport plugins NOT to load
• events
• Event handlers settings
Configuring the core
• The Janus core is configured in janus.jcfg
• As anticipated, some properties can be overridden via command-line too
• Different categories that can be configured
• general
• General settings (logging, daemonization, etc.)
• certificates
• Certificate and key to use (DTLS only, autogenerated if missing)
• media
• Media related stuff (RTP range, DTLS mtu, etc.)
• nat
• ICE related settings (ICE Lite/TCP, STUN/TURN, etc.)
• plugins, transports
• Media and transport plugins NOT to load
• events
• Event handlers settings
Media/IP settings (media)
Name Value Description
ipv6 true/false Enable IPv6 for media or not
dtls_mtu int Maximum size of DTLS packets
dtls_timeout int Retransmission step in ms (BoringSSL only)
rtp_port_range min-max Range of ports to bind to for RTP/RTCP
rfc_4588 true/false Whether rtx should be supported
max_nack_queue int How many packets (window size in ms) to store for
retransmissions
no_media_timer int How long to wait (in seconds) before detecting no
incoming media
Considerations
• dtls_mtu and dtls_timeout can have an impact on DTLS handshake
• Make sure rtp_port_range reflects the server firewall, if any
Generic ICE settings (nat)
Name Value Description
ice_lite true/false Whether to use ICE Lite or not
ice_tcp true/false Whether to use ICE TCP or not (needs ICE Lite)
full_trickle true/false Whether Janus should do full-trickle or not
nat_1_1_mapping ip IP to replace host addresses with (e.g., AWS)
ice_enforce_list list List of interfaces/IPs (even partial) to gather on
ice_ignore_list list List of interfaces/IPs (even partial) NOT to gather on
nice_debug true/false Enable libnice debugging or not
Considerations
• ice_lite can be quicker, if the server has a public address
• Don’t mix nat_1_1_mapping and STUN, and only use it on AWS
• ice_enforce_list and ice_ignore_list can make gathering faster
STUN settings (nat)
Most of the times you won’t need STUN in Janus (only for users), but if you do...
Name Value Description
stun_server address Address of the STUN server
stun_port port Port of the STUN server
Considerations
• If Janus has a public address (common) or NAT-1-1, STUN makes things slower
• If Janus is NATted, check the type of NAT first
• STUN would most likely NOT work if it’s behind a symmetric NATs
TURN settings (nat)
Most of the times you won’t need TURN in Janus (only for users), but if you do...
Name Value Description
turn_server address Address of the TURN server
turn_port port Port of the TURN server
turn_type udp/tcp/tls Protocol to use to connect to the TURN server
turn_user string Username to authenticate, if needed
turn_pwd string Password to authenticate, if needed
Considerations
• 99% of the times, it’s users that need TURN, NOT Janus
• If Janus can work with host or STUN, TURN makes things MUCH slower
• Connections are much less efficient when TURN is used in Janus
TURN REST API settings (nat)
In case TURN credentials are not static, but ephemeral...
Name Value Description
turn_rest_api address Backend to contact for ephemeral credentials
turn_rest_api_key string API key to authenticate at the backend
turn_rest_api_method GET/POST HTTP method to use
Considerations
• As for TURN, plus the overhead of a new GET/POST per each PeerConnection
• Explicit TURN info and TURN REST API are mutually exclusive
A ton of scenarios done today with Janus!
• SIP and RTSP gatewaying
• WebRTC-based call/contact centers
• Conferencing & collaboration
• E-learning & webinars
• Cloud platforms
• Media production
• Broadcasting & Gaming
• Identity verification
• Internet of Things
• Augmented/Virtual Reality
• ...and more!
A quick look at plugins: EchoTest
https://janus.conf.meetecho.com/docs/echotest
A quick look at plugins: Record & Play
https://janus.conf.meetecho.com/docs/recordplay
A quick look at plugins: Record & Play
https://janus.conf.meetecho.com/docs/recordplay
A quick look at plugins: SIP gateway
https://janus.conf.meetecho.com/docs/sipsofia
A quick look at plugins: Audio MCU
https://janus.conf.meetecho.com/docs/audiobridge
A quick look at plugins: Video SFU
https://janus.conf.meetecho.com/docs/videoroom
A quick look at plugins: Streaming
https://janus.conf.meetecho.com/docs/streaming
Writing your own plugin in C (1)
• Plugin initialization and information
• init(): called when plugin is loaded
• destroy(): called when Janus is shutting down
• get_api_compatibility(): must return JANUS_PLUGIN_API_VERSION
• get_version(): numeric version identifier (e.g., 3)
• get_version_string(): verbose version identifier (e.g., “v1.0.1”)
• get_description(): verbose description of the plugin (e.g., “This is my awesome plugin
that does this and that”)
• get_name(): short display name for your plugin (e.g., “My Awesome Plugin”)
• get_author(): author of the plugin (e.g., “Meetecho s.r.l.”)
• get_package(): unique package identifier for your plugin (e.g., “janus.plugin.myplugin”)
Writing your own plugin in C (2)
• Sessions management (callbacks invoked by the core)
• create_session(): a user (session+handle) just attached to the plugin
• handle_message(): incoming message/request (with or without a JSEP/SDP)
• handle_admin_message(): incoming message/request from Admin API
• setup_media(): PeerConnection is now ready to be used
• incoming_rtp(): incoming RTP packet
• incoming_rtcp(): incoming RTCP message
• incoming_data(): incoming DataChannel message
• slow_link(): notification of problems on media path
• hangup_media(): PeerConnection has been closed (e.g., DTLS alert)
• query_session(): called to get plugin-specific info on a user session
• destroy_session(): existing user gone (handle detached)
Writing your own plugin in C (3)
• Interaction with the core (methods invoked by the plugin)
• push_event(): send the user a JSON message/event (with or without a JSEP/SDP)
• relay_rtp(): send/relay the user an RTP packet
• relay_rtcp(): send/relay the user an RTCP message
• relay_data(): send/relay the user a DataChannel message
• close_pc(): close the user’s PeerConnection
• end_session(): close a user session (force-detach core handle)
• events_is_enabled(): check whether the event handlers mechanism is enabled
• notify_event(): notify an event to the registered and subscribed event handlers
Sequence diagrams (core↔plugin interaction)
Sequence diagrams (core↔plugin interaction)
Sequence diagrams (core↔plugin interaction)
Sequence diagrams (core↔plugin interaction)
Sequence diagrams (core↔plugin interaction)
Sequence diagrams (core↔plugin interaction)
Beyond C: plugins in Lua or JavaScript
https://janus.conf.meetecho.com/docs/lua
https://janus.conf.meetecho.com/docs/duktape
Sequence diagrams (Lua/Duktape)
Sequence diagrams (Lua/Duktape)
Sequence diagrams (Lua/Duktape)
Sequence diagrams (Lua/Duktape)
Combining plugins: Webinar example
Combining plugins: SocialTV example
Recording streams
MJR00002 (8 bytes)
LEN (2 bytes) JSON header (variable length)
MEETECHO (8 bytes)
LEN (2 bytes) RTP packet (variable length)
MEETECHO (8 bytes)
LEN (2 bytes) RTP packet (variable length)
MEETECHO (8 bytes)
LEN (2 bytes) RTP packet (variable length)
...
Table: Old Janus MJR format
https://janus.conf.meetecho.com/docs/recordings
Recording streams
MJR00002 (8 bytes)
LEN (2 bytes) JSON header (variable length)
MEET (4 bytes) + Timestamp (4 bytes)
LEN (2 bytes) RTP packet (variable length)
MEET (4 bytes) + Timestamp (4 bytes)
LEN (2 bytes) RTP packet (variable length)
MEET (4 bytes) + Timestamp (4 bytes)
LEN (2 bytes) RTP packet (variable length)
...
Table: New Janus MJR format
https://janus.conf.meetecho.com/docs/recordings
Processing a Janus recording
janus-pp-rec /path/to/file.mjr /path/to/video.webm
Processing Janus recordings (IETF example)
Converting a Janus recording to pcap
mjr2pcap /path/to/file.mjr /path/to/file.pcap
Retransmissions (no rtx)
Retransmissions (using rtx)
Capping the bandwidth (REMB)
https://tools.ietf.org/id/draft-alvestrand-rmcat-remb-03.html
Client-side bandwidth estimation (BWE)
https://github.com/meetecho/janus-gateway/pull/1118 (merged)
Simulcasting & SVC
https://www.slideshare.net/LorenzoMiniero/simulcastsvc-iitrtc-2019
Native data channels support
https://www.meetecho.com/blog/data-channels-broadcasting-with-janus/
RTP forwarding functionality
RTP forwarding functionality
Implementing large-scale broadcasting
https://www.slideshare.net/LorenzoMiniero/scaling-webrtc-applications-with-janus
Implementing large-scale broadcasting
https://www.slideshare.net/LorenzoMiniero/scaling-webrtc-applications-with-janus
Implementing geo-distributed access
https://www.slideshare.net/LorenzoMiniero/scaling-webrtc-applications-with-janus
Implementing geo-distributed access
https://www.slideshare.net/LorenzoMiniero/scaling-webrtc-applications-with-janus
Deploying Janus: a few possible topologies
Deploying Janus: a few possible topologies
Deploying Janus: a few possible topologies
Deploying Janus: a few possible topologies
Deploying Janus: a few possible topologies
Deploying Janus: a few possible topologies
Deploying Janus: a few possible topologies
Anything wrong? Check the Admin API first!
• One option is the requests/response API to interrogate Janus
• Query server capabilities
• Control some aspects (e.g., enable/disable debugging)
• Inspect handles and WebRTC “internals”
https://www.meetecho.com/blog/understanding-the-janus-admin-api/
Admin API features: WebRTC internals
Admin API features: detecting NAT types
{
"janus": "test_stun",
"transaction": "123",
"admin_secret": "janusoverlord",
"address": "stun.l.google.com",
"port": 19302,
"localport": 7000
}
{
"janus": "test_stun",
"transaction": "456",
"admin_secret": "janusoverlord",
"address":"stun.voip.eutelia.it",
"port": 3478,
"localport": 7000
}
https://janus.conf.meetecho.com/docs/admin
Admin API features: detecting NAT types
{
"janus": "success",
"transaction": "123",
"public_ip": "93.44 .. ",
"public_port": 50819,
"elapsed": 114808
}
{
"janus": "success",
"transaction": "456",
"public_ip": "93.44 .. ",
"public_port": 65492,
"elapsed": 127515
}
https://janus.conf.meetecho.com/docs/admin
Admin API features: capturing traffic
https://www.meetecho.com/blog/capturing-webrtc-traffic-in-janus/
An asynchronous approach
• Admin API is cool, but is request/response...
• Needs constant polling, and data is unavailable after the session ends
• What about an asynchronous approach?
• A new mechanism: Event Handlers
• Core and plugins generate events
• Custom modules can subscribe to and handle them
• e.g., save to DB, send to external service, CDR, etc.
• Multiple handlers available out of the box
• HTTP, WebSockets, RabbitMQ, MQTT, Nanomsg
An asynchronous approach
• Admin API is cool, but is request/response...
• Needs constant polling, and data is unavailable after the session ends
• What about an asynchronous approach?
• A new mechanism: Event Handlers
• Core and plugins generate events
• Custom modules can subscribe to and handle them
• e.g., save to DB, send to external service, CDR, etc.
• Multiple handlers available out of the box
• HTTP, WebSockets, RabbitMQ, MQTT, Nanomsg
An asynchronous approach
• Admin API is cool, but is request/response...
• Needs constant polling, and data is unavailable after the session ends
• What about an asynchronous approach?
• A new mechanism: Event Handlers
• Core and plugins generate events
• Custom modules can subscribe to and handle them
• e.g., save to DB, send to external service, CDR, etc.
• Multiple handlers available out of the box
• HTTP, WebSockets, RabbitMQ, MQTT, Nanomsg
Event Handlers overview
Type of events
• Different events handlers can subscribe to
• Core events (e.g., startup/shutdown)
• Session related events (e.g., session created/destroyed)
• Handle related events (e.g., handle attached/detached)
• JSEP related events (e.g., got/sent offer/answer)
• WebRTC related events (e.g., ICE/DTLS state changes)
• Media related events (e.g., stats on packets/bytes)
• Plugin-originated events (specific to the application)
• Transport-originated (specific to the transport)
• External events (originated via Admin API)
• Correlation possible on different identifiers
• Transport instances that originate specific session
• Opaque ID applications can set on handles of same “user”
• Plugin-specific identifiers (e.g., in VideoRoom)
Type of events
• Different events handlers can subscribe to
• Core events (e.g., startup/shutdown)
• Session related events (e.g., session created/destroyed)
• Handle related events (e.g., handle attached/detached)
• JSEP related events (e.g., got/sent offer/answer)
• WebRTC related events (e.g., ICE/DTLS state changes)
• Media related events (e.g., stats on packets/bytes)
• Plugin-originated events (specific to the application)
• Transport-originated (specific to the transport)
• External events (originated via Admin API)
• Correlation possible on different identifiers
• Transport instances that originate specific session
• Opaque ID applications can set on handles of same “user”
• Plugin-specific identifiers (e.g., in VideoRoom)
Why is correlation important?
Why is correlation important?
Why is correlation important?
“Sample Event Handler”: HTTP as a notifier
• Simply forwards all events as JSON to an HTTP backend
• Supports basic authentication
• Can group events (i.e., JSON array vs. multiple JSON objects)
• Implements basic retransmissions (exponential back-off)
• Does nothing more than that: logic needs to be elsewhere
• HTTP backend decides what to do with events, if anything
• Behaviour can be tweaked via Admin API calls
Need something else? Check the alternatives or write your own!
A few other event handlers also available
• Other transports (in repo), SQLite (by Mozilla)
“Sample Event Handler”: HTTP as a notifier
• Simply forwards all events as JSON to an HTTP backend
• Supports basic authentication
• Can group events (i.e., JSON array vs. multiple JSON objects)
• Implements basic retransmissions (exponential back-off)
• Does nothing more than that: logic needs to be elsewhere
• HTTP backend decides what to do with events, if anything
• Behaviour can be tweaked via Admin API calls
Need something else? Check the alternatives or write your own!
A few other event handlers also available
• Other transports (in repo), SQLite (by Mozilla)
“Sample Event Handler”: HTTP as a notifier
• Simply forwards all events as JSON to an HTTP backend
• Supports basic authentication
• Can group events (i.e., JSON array vs. multiple JSON objects)
• Implements basic retransmissions (exponential back-off)
• Does nothing more than that: logic needs to be elsewhere
• HTTP backend decides what to do with events, if anything
• Behaviour can be tweaked via Admin API calls
Need something else? Check the alternatives or write your own!
A few other event handlers also available
• Other transports (in repo), SQLite (by Mozilla)
Sample Event Handler example
Sample Event Handler example
Writing your own event handler in C (1)
• Plugin initialization and information
• init(): called when event handler is loaded
• destroy(): called when Janus is shutting down
• get_api_compatibility(): must return JANUS_EVENTHANDLER_API_VERSION
• get_version(): numeric version identifier (e.g., 3)
• get_version_string(): verbose version identifier (e.g., “v1.0.1”)
• get_description(): verbose description of the plugin (e.g., “This is my awesome event
handler that does this and that”)
• get_name(): short display name for your plugin (e.g., “My Awesome Event Handler”)
• get_author(): author of the plugin (e.g., “Meetecho s.r.l.”)
• get_package(): unique package identifier for your plugin (e.g.,
“janus.eventhandler.myhandler”)
Writing your own event handler in C (2)
• Events management (callbacks invoked by the core)
• incoming_event(): incoming event to manage (queue and process in your thread)
• handle_request(): incoming request from Admin API to tweak the plugin
How can you handle events?
• Generating events is easy, evaluating them is another matter...
• Event Handlers typically just relay events, and don’t do processing themselves
• Analyzing and correlating tons of events is complicated
• A few different approaches, from easiest to trickiest
1 https://github.com/stirlab/janus-event-server (dumping events to file)
2 https://github.com/mozilla/janus-eventhandler-sqlite (dumping events to SQLite)
3 Write your own backend, e.g.,
https://www.meetecho.com/blog/event-handlers-a-practical-example/
https://www.meetecho.com/blog/correlating-janus-event-handlers/
• A much better approach: trust the smart guys!
• https://github.com/sipcapture/homer
• https://hepic.tel/
How can you handle events?
• Generating events is easy, evaluating them is another matter...
• Event Handlers typically just relay events, and don’t do processing themselves
• Analyzing and correlating tons of events is complicated
• A few different approaches, from easiest to trickiest
1 https://github.com/stirlab/janus-event-server (dumping events to file)
2 https://github.com/mozilla/janus-eventhandler-sqlite (dumping events to SQLite)
3 Write your own backend, e.g.,
https://www.meetecho.com/blog/event-handlers-a-practical-example/
https://www.meetecho.com/blog/correlating-janus-event-handlers/
• A much better approach: trust the smart guys!
• https://github.com/sipcapture/homer
• https://hepic.tel/
How can you handle events?
• Generating events is easy, evaluating them is another matter...
• Event Handlers typically just relay events, and don’t do processing themselves
• Analyzing and correlating tons of events is complicated
• A few different approaches, from easiest to trickiest
1 https://github.com/stirlab/janus-event-server (dumping events to file)
2 https://github.com/mozilla/janus-eventhandler-sqlite (dumping events to SQLite)
3 Write your own backend, e.g.,
https://www.meetecho.com/blog/event-handlers-a-practical-example/
https://www.meetecho.com/blog/correlating-janus-event-handlers/
• A much better approach: trust the smart guys!
• https://github.com/sipcapture/homer
• https://hepic.tel/
Event Handlers in HOMER since “day one”
Presentations from JanusCon
https://www.youtube.com/watch?v=bR3CoeXF-Mo
Presentations from JanusCon
https://www.youtube.com/watch?v=auutg9cou4I
WIP: Modular logging
https://github.com/meetecho/janus-gateway/pull/1814
Thanks! Questions? Comments?
Get in touch!
https://www.meetecho.com
rtcexpo@meetecho.com

More Related Content

What's hot

Tomcat 마이그레이션 도전하기 (Jins Choi)
Tomcat 마이그레이션 도전하기 (Jins Choi)Tomcat 마이그레이션 도전하기 (Jins Choi)
Tomcat 마이그레이션 도전하기 (Jins Choi)삵 (sarc.io)
 
MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)Lucas Jellema
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and TuningNGINX, Inc.
 
Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Lorenzo Miniero
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to PrometheusJulien Pivotto
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaSyah Dwi Prihatmoko
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaArvind Kumar G.S
 
Grafana optimization for Prometheus
Grafana optimization for PrometheusGrafana optimization for Prometheus
Grafana optimization for PrometheusMitsuhiro Tanda
 
[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How ToJi-Woong Choi
 
Improving GStreamer performance on large pipelines: from profiling to optimiz...
Improving GStreamer performance on large pipelines: from profiling to optimiz...Improving GStreamer performance on large pipelines: from profiling to optimiz...
Improving GStreamer performance on large pipelines: from profiling to optimiz...Luis Lopez
 
Server monitoring using grafana and prometheus
Server monitoring using grafana and prometheusServer monitoring using grafana and prometheus
Server monitoring using grafana and prometheusCeline George
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to NginxKnoldus Inc.
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data IngestionAlvaro Videla
 
Introduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQIntroduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQDmitriy Samovskiy
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraFormWesley Charles Blake
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaJiangjie Qin
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21Lorenzo Miniero
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX, Inc.
 

What's hot (20)

Tomcat 마이그레이션 도전하기 (Jins Choi)
Tomcat 마이그레이션 도전하기 (Jins Choi)Tomcat 마이그레이션 도전하기 (Jins Choi)
Tomcat 마이그레이션 도전하기 (Jins Choi)
 
MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
 
Grafana
GrafanaGrafana
Grafana
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and Grafana
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
 
Grafana optimization for Prometheus
Grafana optimization for PrometheusGrafana optimization for Prometheus
Grafana optimization for Prometheus
 
[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To[오픈소스컨설팅]Tomcat6&7 How To
[오픈소스컨설팅]Tomcat6&7 How To
 
Improving GStreamer performance on large pipelines: from profiling to optimiz...
Improving GStreamer performance on large pipelines: from profiling to optimiz...Improving GStreamer performance on large pipelines: from profiling to optimiz...
Improving GStreamer performance on large pipelines: from profiling to optimiz...
 
Server monitoring using grafana and prometheus
Server monitoring using grafana and prometheusServer monitoring using grafana and prometheus
Server monitoring using grafana and prometheus
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to Nginx
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
 
Introduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQIntroduction to AMQP Messaging with RabbitMQ
Introduction to AMQP Messaging with RabbitMQ
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraForm
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best Practices
 
Prometheus monitoring
Prometheus monitoringPrometheus monitoring
Prometheus monitoring
 

Similar to Janus workshop @ RTC2019 Beijing

Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Lorenzo Miniero
 
Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Lorenzo Miniero
 
Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Lorenzo Miniero
 
Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019Lorenzo Miniero
 
PEARC17: Live Integrated Visualization Environment: An Experiment in General...
PEARC17: Live Integrated Visualization Environment: An Experiment in General...PEARC17: Live Integrated Visualization Environment: An Experiment in General...
PEARC17: Live Integrated Visualization Environment: An Experiment in General...moneyjh
 
Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applicationsSerge Huber
 
Janus + Audio @ Open Source World
Janus + Audio @ Open Source WorldJanus + Audio @ Open Source World
Janus + Audio @ Open Source WorldLorenzo Miniero
 
Janus: an open source and general purpose WebRTC (gateway) server
Janus: an open source and general purpose WebRTC (gateway) serverJanus: an open source and general purpose WebRTC (gateway) server
Janus: an open source and general purpose WebRTC (gateway) serverDevDay
 
Sutol How To Be A Lion Tamer
Sutol How To Be A Lion TamerSutol How To Be A Lion Tamer
Sutol How To Be A Lion TamerSharon James
 
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...Ruby Meditation
 
WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017Lorenzo Miniero
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamerWannes Rams
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamerSharon James
 
ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...
ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...
ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...Altinity Ltd
 
Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Lorenzo Miniero
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Anthony Dahanne
 

Similar to Janus workshop @ RTC2019 Beijing (20)

Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020
 
Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019
 
Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017
 
Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019
 
Convergence Best Poster Award
Convergence Best Poster AwardConvergence Best Poster Award
Convergence Best Poster Award
 
PEARC17: Live Integrated Visualization Environment: An Experiment in General...
PEARC17: Live Integrated Visualization Environment: An Experiment in General...PEARC17: Live Integrated Visualization Environment: An Experiment in General...
PEARC17: Live Integrated Visualization Environment: An Experiment in General...
 
Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applications
 
Janus + Audio @ Open Source World
Janus + Audio @ Open Source WorldJanus + Audio @ Open Source World
Janus + Audio @ Open Source World
 
Janus @ DevDay Napoli
Janus @ DevDay NapoliJanus @ DevDay Napoli
Janus @ DevDay Napoli
 
Janus: an open source and general purpose WebRTC (gateway) server
Janus: an open source and general purpose WebRTC (gateway) serverJanus: an open source and general purpose WebRTC (gateway) server
Janus: an open source and general purpose WebRTC (gateway) server
 
Janus @ RTC2017 Beijing
Janus @ RTC2017 BeijingJanus @ RTC2017 Beijing
Janus @ RTC2017 Beijing
 
DPFManager workshop
DPFManager workshopDPFManager workshop
DPFManager workshop
 
Sutol How To Be A Lion Tamer
Sutol How To Be A Lion TamerSutol How To Be A Lion Tamer
Sutol How To Be A Lion Tamer
 
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
 
WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamer
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamer
 
ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...
ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...
ClickHouse Paris Meetup. Pragma Analytics Software Suite w/ClickHouse, by Mat...
 
Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018
 

More from Lorenzo Miniero

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Getting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC ServerGetting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC ServerLorenzo Miniero
 
WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023Lorenzo Miniero
 
The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023Lorenzo Miniero
 
Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023Lorenzo Miniero
 
Become a rockstar using FOSS!
Become a rockstar using FOSS!Become a rockstar using FOSS!
Become a rockstar using FOSS!Lorenzo Miniero
 
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022Lorenzo Miniero
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022Lorenzo Miniero
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021Lorenzo Miniero
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceLorenzo Miniero
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Lorenzo Miniero
 
Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021Lorenzo Miniero
 
Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Lorenzo Miniero
 
Virtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPSVirtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPSLorenzo Miniero
 
Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020Lorenzo Miniero
 
Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Lorenzo Miniero
 
Turning live events to virtual with Janus
Turning live events to virtual with JanusTurning live events to virtual with Janus
Turning live events to virtual with JanusLorenzo Miniero
 
Welcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of JanusWelcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of JanusLorenzo Miniero
 

More from Lorenzo Miniero (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Getting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC ServerGetting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC Server
 
WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023
 
BWE in Janus
BWE in JanusBWE in Janus
BWE in Janus
 
The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023
 
Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023
 
Become a rockstar using FOSS!
Become a rockstar using FOSS!Become a rockstar using FOSS!
Become a rockstar using FOSS!
 
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConference
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021
 
Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021
 
Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021
 
Virtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPSVirtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPS
 
Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020
 
Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020
 
Turning live events to virtual with Janus
Turning live events to virtual with JanusTurning live events to virtual with Janus
Turning live events to virtual with Janus
 
Welcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of JanusWelcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of Janus
 
Janus @ ClueCon 2019
Janus @ ClueCon 2019Janus @ ClueCon 2019
Janus @ ClueCon 2019
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

Janus workshop @ RTC2019 Beijing

  • 1. Janus and WebRTC: a practical journey Lorenzo Miniero
  • 2. Who am I? Lorenzo Miniero • Ph.D @ UniNA • Chairman @ Meetecho • Main author of Janus® Contacts and info • rtcexpo@meetecho.com • https://twitter.com/elminiero • https://www.slideshare.net/LorenzoMiniero
  • 3. Just a few words on Meetecho • Co-founded in 2009 as an academic spin-off • University research efforts brought to the market • Completely independent from the University • Focus on real-time multimedia applications • Strong perspective on standardization and open source • Several activities • Consulting services • Commercial support and Janus licenses • Streaming of live events (IETF, ACM, etc.) • Proudly brewed in sunny Napoli, Italy
  • 5. We just met in Napoli for JanusCon! https://januscon.it
  • 6. We just met in Napoli for JanusCon! https://januscon.it
  • 9. Involving a server as a peer (and applications)
  • 10. Involving a server as a peer (and applications)
  • 11. Involving a server as a peer (and applications)
  • 12. Involving a server as a peer (and applications)
  • 16. What’s Janus? Janus General purpose, open source WebRTC server • https://github.com/meetecho/janus-gateway • Demos and documentation: https://janus.conf.meetecho.com • Community: https://groups.google.com/forum/#!forum/meetecho-janus
  • 18. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 19. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 20. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 21. Modular architecture • The core only implements the WebRTC stack • JSEP/SDP, ICE, DTLS-SRTP, Data Channels, Simulcast, VP9-SVC, ... • Plugins expose Janus API over different “transports” • Currently HTTP / WebSockets / RabbitMQ / Unix Sockets / MQTT / Nanomsg • “Application” logic implemented in plugins too • Users attach to plugins via the Janus core • The core handles the WebRTC stuff • Plugins route/manipulate the media/data • Plugins can be combined on client side as “bricks” • Video SFU, Audio MCU, SIP gatewaying, broadcasting, etc.
  • 24. Configuring Janus • Janus and plugins can be configured via .jcfg files (libconfig format) • Old INI format still supported, though • Some (core-only) properties can be set via command-line as well • Several options to configure the server’s behaviour • Logging, transport, media settings, etc. • Format of libconfig files is quite simple to understand and use # This is a comment name0 = value0 category1: { name1 = number name2 = "string" name3 = boolean ... } category2: { name2 = [ array ] ... }
  • 25. Configuring Janus • Janus and plugins can be configured via .jcfg files (libconfig format) • Old INI format still supported, though • Some (core-only) properties can be set via command-line as well • Several options to configure the server’s behaviour • Logging, transport, media settings, etc. • Format of libconfig files is quite simple to understand and use # This is a comment name0 = value0 category1: { name1 = number name2 = "string" name3 = boolean ... } category2: { name2 = [ array ] ... }
  • 26. Configuring Janus • Janus and plugins can be configured via .jcfg files (libconfig format) • Old INI format still supported, though • Some (core-only) properties can be set via command-line as well • Several options to configure the server’s behaviour • Logging, transport, media settings, etc. • Format of libconfig files is quite simple to understand and use # This is a comment name0 = value0 category1: { name1 = number name2 = "string" name3 = boolean ... } category2: { name2 = [ array ] ... }
  • 27. Example of configuration file # This is a comment general: { configs_folder = "/opt/janus/etc/janus" plugins_folder = "/opt/janus/lib/janus/plugins" transports_folder = "/opt/janus/lib/janus/transports" events_folder = "/opt/janus/lib/janus/events" debug_level = 5 admin_secret = "janusoverlord" } certificates: { } media: { rfc_4588 = true rtp_port_range = "20000-40000" } nat: { nice_debug = false ice_ignore_list = "vmnet" } plugins: { } transports: { } events: { }
  • 28. Configuring the core • The Janus core is configured in janus.jcfg • As anticipated, some properties can be overridden via command-line too • Different categories that can be configured • general • General settings (logging, daemonization, etc.) • certificates • Certificate and key to use (DTLS only, autogenerated if missing) • media • Media related stuff (RTP range, DTLS mtu, etc.) • nat • ICE related settings (ICE Lite/TCP, STUN/TURN, etc.) • plugins, transports • Media and transport plugins NOT to load • events • Event handlers settings
  • 29. Configuring the core • The Janus core is configured in janus.jcfg • As anticipated, some properties can be overridden via command-line too • Different categories that can be configured • general • General settings (logging, daemonization, etc.) • certificates • Certificate and key to use (DTLS only, autogenerated if missing) • media • Media related stuff (RTP range, DTLS mtu, etc.) • nat • ICE related settings (ICE Lite/TCP, STUN/TURN, etc.) • plugins, transports • Media and transport plugins NOT to load • events • Event handlers settings
  • 30. Configuring the core • The Janus core is configured in janus.jcfg • As anticipated, some properties can be overridden via command-line too • Different categories that can be configured • general • General settings (logging, daemonization, etc.) • certificates • Certificate and key to use (DTLS only, autogenerated if missing) • media • Media related stuff (RTP range, DTLS mtu, etc.) • nat • ICE related settings (ICE Lite/TCP, STUN/TURN, etc.) • plugins, transports • Media and transport plugins NOT to load • events • Event handlers settings
  • 31. Configuring the core • The Janus core is configured in janus.jcfg • As anticipated, some properties can be overridden via command-line too • Different categories that can be configured • general • General settings (logging, daemonization, etc.) • certificates • Certificate and key to use (DTLS only, autogenerated if missing) • media • Media related stuff (RTP range, DTLS mtu, etc.) • nat • ICE related settings (ICE Lite/TCP, STUN/TURN, etc.) • plugins, transports • Media and transport plugins NOT to load • events • Event handlers settings
  • 32. Configuring the core • The Janus core is configured in janus.jcfg • As anticipated, some properties can be overridden via command-line too • Different categories that can be configured • general • General settings (logging, daemonization, etc.) • certificates • Certificate and key to use (DTLS only, autogenerated if missing) • media • Media related stuff (RTP range, DTLS mtu, etc.) • nat • ICE related settings (ICE Lite/TCP, STUN/TURN, etc.) • plugins, transports • Media and transport plugins NOT to load • events • Event handlers settings
  • 33. Configuring the core • The Janus core is configured in janus.jcfg • As anticipated, some properties can be overridden via command-line too • Different categories that can be configured • general • General settings (logging, daemonization, etc.) • certificates • Certificate and key to use (DTLS only, autogenerated if missing) • media • Media related stuff (RTP range, DTLS mtu, etc.) • nat • ICE related settings (ICE Lite/TCP, STUN/TURN, etc.) • plugins, transports • Media and transport plugins NOT to load • events • Event handlers settings
  • 34. Configuring the core • The Janus core is configured in janus.jcfg • As anticipated, some properties can be overridden via command-line too • Different categories that can be configured • general • General settings (logging, daemonization, etc.) • certificates • Certificate and key to use (DTLS only, autogenerated if missing) • media • Media related stuff (RTP range, DTLS mtu, etc.) • nat • ICE related settings (ICE Lite/TCP, STUN/TURN, etc.) • plugins, transports • Media and transport plugins NOT to load • events • Event handlers settings
  • 35. Media/IP settings (media) Name Value Description ipv6 true/false Enable IPv6 for media or not dtls_mtu int Maximum size of DTLS packets dtls_timeout int Retransmission step in ms (BoringSSL only) rtp_port_range min-max Range of ports to bind to for RTP/RTCP rfc_4588 true/false Whether rtx should be supported max_nack_queue int How many packets (window size in ms) to store for retransmissions no_media_timer int How long to wait (in seconds) before detecting no incoming media Considerations • dtls_mtu and dtls_timeout can have an impact on DTLS handshake • Make sure rtp_port_range reflects the server firewall, if any
  • 36. Generic ICE settings (nat) Name Value Description ice_lite true/false Whether to use ICE Lite or not ice_tcp true/false Whether to use ICE TCP or not (needs ICE Lite) full_trickle true/false Whether Janus should do full-trickle or not nat_1_1_mapping ip IP to replace host addresses with (e.g., AWS) ice_enforce_list list List of interfaces/IPs (even partial) to gather on ice_ignore_list list List of interfaces/IPs (even partial) NOT to gather on nice_debug true/false Enable libnice debugging or not Considerations • ice_lite can be quicker, if the server has a public address • Don’t mix nat_1_1_mapping and STUN, and only use it on AWS • ice_enforce_list and ice_ignore_list can make gathering faster
  • 37. STUN settings (nat) Most of the times you won’t need STUN in Janus (only for users), but if you do... Name Value Description stun_server address Address of the STUN server stun_port port Port of the STUN server Considerations • If Janus has a public address (common) or NAT-1-1, STUN makes things slower • If Janus is NATted, check the type of NAT first • STUN would most likely NOT work if it’s behind a symmetric NATs
  • 38. TURN settings (nat) Most of the times you won’t need TURN in Janus (only for users), but if you do... Name Value Description turn_server address Address of the TURN server turn_port port Port of the TURN server turn_type udp/tcp/tls Protocol to use to connect to the TURN server turn_user string Username to authenticate, if needed turn_pwd string Password to authenticate, if needed Considerations • 99% of the times, it’s users that need TURN, NOT Janus • If Janus can work with host or STUN, TURN makes things MUCH slower • Connections are much less efficient when TURN is used in Janus
  • 39. TURN REST API settings (nat) In case TURN credentials are not static, but ephemeral... Name Value Description turn_rest_api address Backend to contact for ephemeral credentials turn_rest_api_key string API key to authenticate at the backend turn_rest_api_method GET/POST HTTP method to use Considerations • As for TURN, plus the overhead of a new GET/POST per each PeerConnection • Explicit TURN info and TURN REST API are mutually exclusive
  • 40. A ton of scenarios done today with Janus! • SIP and RTSP gatewaying • WebRTC-based call/contact centers • Conferencing & collaboration • E-learning & webinars • Cloud platforms • Media production • Broadcasting & Gaming • Identity verification • Internet of Things • Augmented/Virtual Reality • ...and more!
  • 41. A quick look at plugins: EchoTest https://janus.conf.meetecho.com/docs/echotest
  • 42. A quick look at plugins: Record & Play https://janus.conf.meetecho.com/docs/recordplay
  • 43. A quick look at plugins: Record & Play https://janus.conf.meetecho.com/docs/recordplay
  • 44. A quick look at plugins: SIP gateway https://janus.conf.meetecho.com/docs/sipsofia
  • 45. A quick look at plugins: Audio MCU https://janus.conf.meetecho.com/docs/audiobridge
  • 46. A quick look at plugins: Video SFU https://janus.conf.meetecho.com/docs/videoroom
  • 47. A quick look at plugins: Streaming https://janus.conf.meetecho.com/docs/streaming
  • 48. Writing your own plugin in C (1) • Plugin initialization and information • init(): called when plugin is loaded • destroy(): called when Janus is shutting down • get_api_compatibility(): must return JANUS_PLUGIN_API_VERSION • get_version(): numeric version identifier (e.g., 3) • get_version_string(): verbose version identifier (e.g., “v1.0.1”) • get_description(): verbose description of the plugin (e.g., “This is my awesome plugin that does this and that”) • get_name(): short display name for your plugin (e.g., “My Awesome Plugin”) • get_author(): author of the plugin (e.g., “Meetecho s.r.l.”) • get_package(): unique package identifier for your plugin (e.g., “janus.plugin.myplugin”)
  • 49. Writing your own plugin in C (2) • Sessions management (callbacks invoked by the core) • create_session(): a user (session+handle) just attached to the plugin • handle_message(): incoming message/request (with or without a JSEP/SDP) • handle_admin_message(): incoming message/request from Admin API • setup_media(): PeerConnection is now ready to be used • incoming_rtp(): incoming RTP packet • incoming_rtcp(): incoming RTCP message • incoming_data(): incoming DataChannel message • slow_link(): notification of problems on media path • hangup_media(): PeerConnection has been closed (e.g., DTLS alert) • query_session(): called to get plugin-specific info on a user session • destroy_session(): existing user gone (handle detached)
  • 50. Writing your own plugin in C (3) • Interaction with the core (methods invoked by the plugin) • push_event(): send the user a JSON message/event (with or without a JSEP/SDP) • relay_rtp(): send/relay the user an RTP packet • relay_rtcp(): send/relay the user an RTCP message • relay_data(): send/relay the user a DataChannel message • close_pc(): close the user’s PeerConnection • end_session(): close a user session (force-detach core handle) • events_is_enabled(): check whether the event handlers mechanism is enabled • notify_event(): notify an event to the registered and subscribed event handlers
  • 57. Beyond C: plugins in Lua or JavaScript https://janus.conf.meetecho.com/docs/lua https://janus.conf.meetecho.com/docs/duktape
  • 64. Recording streams MJR00002 (8 bytes) LEN (2 bytes) JSON header (variable length) MEETECHO (8 bytes) LEN (2 bytes) RTP packet (variable length) MEETECHO (8 bytes) LEN (2 bytes) RTP packet (variable length) MEETECHO (8 bytes) LEN (2 bytes) RTP packet (variable length) ... Table: Old Janus MJR format https://janus.conf.meetecho.com/docs/recordings
  • 65. Recording streams MJR00002 (8 bytes) LEN (2 bytes) JSON header (variable length) MEET (4 bytes) + Timestamp (4 bytes) LEN (2 bytes) RTP packet (variable length) MEET (4 bytes) + Timestamp (4 bytes) LEN (2 bytes) RTP packet (variable length) MEET (4 bytes) + Timestamp (4 bytes) LEN (2 bytes) RTP packet (variable length) ... Table: New Janus MJR format https://janus.conf.meetecho.com/docs/recordings
  • 66. Processing a Janus recording janus-pp-rec /path/to/file.mjr /path/to/video.webm
  • 67. Processing Janus recordings (IETF example)
  • 68. Converting a Janus recording to pcap mjr2pcap /path/to/file.mjr /path/to/file.pcap
  • 71. Capping the bandwidth (REMB) https://tools.ietf.org/id/draft-alvestrand-rmcat-remb-03.html
  • 72. Client-side bandwidth estimation (BWE) https://github.com/meetecho/janus-gateway/pull/1118 (merged)
  • 74. Native data channels support https://www.meetecho.com/blog/data-channels-broadcasting-with-janus/
  • 81. Deploying Janus: a few possible topologies
  • 82. Deploying Janus: a few possible topologies
  • 83. Deploying Janus: a few possible topologies
  • 84. Deploying Janus: a few possible topologies
  • 85. Deploying Janus: a few possible topologies
  • 86. Deploying Janus: a few possible topologies
  • 87. Deploying Janus: a few possible topologies
  • 88. Anything wrong? Check the Admin API first! • One option is the requests/response API to interrogate Janus • Query server capabilities • Control some aspects (e.g., enable/disable debugging) • Inspect handles and WebRTC “internals” https://www.meetecho.com/blog/understanding-the-janus-admin-api/
  • 89. Admin API features: WebRTC internals
  • 90. Admin API features: detecting NAT types { "janus": "test_stun", "transaction": "123", "admin_secret": "janusoverlord", "address": "stun.l.google.com", "port": 19302, "localport": 7000 } { "janus": "test_stun", "transaction": "456", "admin_secret": "janusoverlord", "address":"stun.voip.eutelia.it", "port": 3478, "localport": 7000 } https://janus.conf.meetecho.com/docs/admin
  • 91. Admin API features: detecting NAT types { "janus": "success", "transaction": "123", "public_ip": "93.44 .. ", "public_port": 50819, "elapsed": 114808 } { "janus": "success", "transaction": "456", "public_ip": "93.44 .. ", "public_port": 65492, "elapsed": 127515 } https://janus.conf.meetecho.com/docs/admin
  • 92. Admin API features: capturing traffic https://www.meetecho.com/blog/capturing-webrtc-traffic-in-janus/
  • 93. An asynchronous approach • Admin API is cool, but is request/response... • Needs constant polling, and data is unavailable after the session ends • What about an asynchronous approach? • A new mechanism: Event Handlers • Core and plugins generate events • Custom modules can subscribe to and handle them • e.g., save to DB, send to external service, CDR, etc. • Multiple handlers available out of the box • HTTP, WebSockets, RabbitMQ, MQTT, Nanomsg
  • 94. An asynchronous approach • Admin API is cool, but is request/response... • Needs constant polling, and data is unavailable after the session ends • What about an asynchronous approach? • A new mechanism: Event Handlers • Core and plugins generate events • Custom modules can subscribe to and handle them • e.g., save to DB, send to external service, CDR, etc. • Multiple handlers available out of the box • HTTP, WebSockets, RabbitMQ, MQTT, Nanomsg
  • 95. An asynchronous approach • Admin API is cool, but is request/response... • Needs constant polling, and data is unavailable after the session ends • What about an asynchronous approach? • A new mechanism: Event Handlers • Core and plugins generate events • Custom modules can subscribe to and handle them • e.g., save to DB, send to external service, CDR, etc. • Multiple handlers available out of the box • HTTP, WebSockets, RabbitMQ, MQTT, Nanomsg
  • 97. Type of events • Different events handlers can subscribe to • Core events (e.g., startup/shutdown) • Session related events (e.g., session created/destroyed) • Handle related events (e.g., handle attached/detached) • JSEP related events (e.g., got/sent offer/answer) • WebRTC related events (e.g., ICE/DTLS state changes) • Media related events (e.g., stats on packets/bytes) • Plugin-originated events (specific to the application) • Transport-originated (specific to the transport) • External events (originated via Admin API) • Correlation possible on different identifiers • Transport instances that originate specific session • Opaque ID applications can set on handles of same “user” • Plugin-specific identifiers (e.g., in VideoRoom)
  • 98. Type of events • Different events handlers can subscribe to • Core events (e.g., startup/shutdown) • Session related events (e.g., session created/destroyed) • Handle related events (e.g., handle attached/detached) • JSEP related events (e.g., got/sent offer/answer) • WebRTC related events (e.g., ICE/DTLS state changes) • Media related events (e.g., stats on packets/bytes) • Plugin-originated events (specific to the application) • Transport-originated (specific to the transport) • External events (originated via Admin API) • Correlation possible on different identifiers • Transport instances that originate specific session • Opaque ID applications can set on handles of same “user” • Plugin-specific identifiers (e.g., in VideoRoom)
  • 99. Why is correlation important?
  • 100. Why is correlation important?
  • 101. Why is correlation important?
  • 102. “Sample Event Handler”: HTTP as a notifier • Simply forwards all events as JSON to an HTTP backend • Supports basic authentication • Can group events (i.e., JSON array vs. multiple JSON objects) • Implements basic retransmissions (exponential back-off) • Does nothing more than that: logic needs to be elsewhere • HTTP backend decides what to do with events, if anything • Behaviour can be tweaked via Admin API calls Need something else? Check the alternatives or write your own! A few other event handlers also available • Other transports (in repo), SQLite (by Mozilla)
  • 103. “Sample Event Handler”: HTTP as a notifier • Simply forwards all events as JSON to an HTTP backend • Supports basic authentication • Can group events (i.e., JSON array vs. multiple JSON objects) • Implements basic retransmissions (exponential back-off) • Does nothing more than that: logic needs to be elsewhere • HTTP backend decides what to do with events, if anything • Behaviour can be tweaked via Admin API calls Need something else? Check the alternatives or write your own! A few other event handlers also available • Other transports (in repo), SQLite (by Mozilla)
  • 104. “Sample Event Handler”: HTTP as a notifier • Simply forwards all events as JSON to an HTTP backend • Supports basic authentication • Can group events (i.e., JSON array vs. multiple JSON objects) • Implements basic retransmissions (exponential back-off) • Does nothing more than that: logic needs to be elsewhere • HTTP backend decides what to do with events, if anything • Behaviour can be tweaked via Admin API calls Need something else? Check the alternatives or write your own! A few other event handlers also available • Other transports (in repo), SQLite (by Mozilla)
  • 107. Writing your own event handler in C (1) • Plugin initialization and information • init(): called when event handler is loaded • destroy(): called when Janus is shutting down • get_api_compatibility(): must return JANUS_EVENTHANDLER_API_VERSION • get_version(): numeric version identifier (e.g., 3) • get_version_string(): verbose version identifier (e.g., “v1.0.1”) • get_description(): verbose description of the plugin (e.g., “This is my awesome event handler that does this and that”) • get_name(): short display name for your plugin (e.g., “My Awesome Event Handler”) • get_author(): author of the plugin (e.g., “Meetecho s.r.l.”) • get_package(): unique package identifier for your plugin (e.g., “janus.eventhandler.myhandler”)
  • 108. Writing your own event handler in C (2) • Events management (callbacks invoked by the core) • incoming_event(): incoming event to manage (queue and process in your thread) • handle_request(): incoming request from Admin API to tweak the plugin
  • 109. How can you handle events? • Generating events is easy, evaluating them is another matter... • Event Handlers typically just relay events, and don’t do processing themselves • Analyzing and correlating tons of events is complicated • A few different approaches, from easiest to trickiest 1 https://github.com/stirlab/janus-event-server (dumping events to file) 2 https://github.com/mozilla/janus-eventhandler-sqlite (dumping events to SQLite) 3 Write your own backend, e.g., https://www.meetecho.com/blog/event-handlers-a-practical-example/ https://www.meetecho.com/blog/correlating-janus-event-handlers/ • A much better approach: trust the smart guys! • https://github.com/sipcapture/homer • https://hepic.tel/
  • 110. How can you handle events? • Generating events is easy, evaluating them is another matter... • Event Handlers typically just relay events, and don’t do processing themselves • Analyzing and correlating tons of events is complicated • A few different approaches, from easiest to trickiest 1 https://github.com/stirlab/janus-event-server (dumping events to file) 2 https://github.com/mozilla/janus-eventhandler-sqlite (dumping events to SQLite) 3 Write your own backend, e.g., https://www.meetecho.com/blog/event-handlers-a-practical-example/ https://www.meetecho.com/blog/correlating-janus-event-handlers/ • A much better approach: trust the smart guys! • https://github.com/sipcapture/homer • https://hepic.tel/
  • 111. How can you handle events? • Generating events is easy, evaluating them is another matter... • Event Handlers typically just relay events, and don’t do processing themselves • Analyzing and correlating tons of events is complicated • A few different approaches, from easiest to trickiest 1 https://github.com/stirlab/janus-event-server (dumping events to file) 2 https://github.com/mozilla/janus-eventhandler-sqlite (dumping events to SQLite) 3 Write your own backend, e.g., https://www.meetecho.com/blog/event-handlers-a-practical-example/ https://www.meetecho.com/blog/correlating-janus-event-handlers/ • A much better approach: trust the smart guys! • https://github.com/sipcapture/homer • https://hepic.tel/
  • 112. Event Handlers in HOMER since “day one”
  • 116. Thanks! Questions? Comments? Get in touch! https://www.meetecho.com rtcexpo@meetecho.com