SlideShare ist ein Scribd-Unternehmen logo
1 von 116
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Performance Testing using Loadrunner
Performance Testingusing LoadrunnerPerformance Testingusing Loadrunner
Performance Testing using Loadrunnerhmfive
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPCGuo Jing
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
Fully Utilizing Spark for Data Validation
Fully Utilizing Spark for Data ValidationFully Utilizing Spark for Data Validation
Fully Utilizing Spark for Data ValidationDatabricks
 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google MockICS
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudEberhard Wolff
 
Testes de ponta a ponta
Testes de ponta a pontaTestes de ponta a ponta
Testes de ponta a pontaElias Nogueira
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Mobile Performance Testing - Best Practices
Mobile Performance Testing - Best PracticesMobile Performance Testing - Best Practices
Mobile Performance Testing - Best PracticesEran Kinsbrunner
 
How to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in RundeckHow to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in RundeckRundeck
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introductionJonathan Holloway
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongDerek Perkins
 
How to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elementsHow to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elementsMarcellKiss7
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitecturePaul Mooney
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsSATOSHI TAGOMORI
 
Google mock training
Google mock trainingGoogle mock training
Google mock trainingThierry Gayet
 

Was ist angesagt? (20)

Performance Testing using Loadrunner
Performance Testingusing LoadrunnerPerformance Testingusing Loadrunner
Performance Testing using Loadrunner
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 
Jest
JestJest
Jest
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
Fully Utilizing Spark for Data Validation
Fully Utilizing Spark for Data ValidationFully Utilizing Spark for Data Validation
Fully Utilizing Spark for Data Validation
 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
Testes de ponta a ponta
Testes de ponta a pontaTestes de ponta a ponta
Testes de ponta a ponta
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Mobile Performance Testing - Best Practices
Mobile Performance Testing - Best PracticesMobile Performance Testing - Best Practices
Mobile Performance Testing - Best Practices
 
How to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in RundeckHow to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in Rundeck
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introduction
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong
 
How to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elementsHow to build Micro Frontends with @angular/elements
How to build Micro Frontends with @angular/elements
 
React & GraphQL
React & GraphQLReact & GraphQL
React & GraphQL
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API Details
 
Google mock training
Google mock trainingGoogle mock training
Google mock training
 

Ähnlich wie 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
 
Scaling WebRTC applications with Janus
Scaling WebRTC applications with JanusScaling WebRTC applications with Janus
Scaling WebRTC applications with JanusLorenzo Miniero
 
Scaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo minieroScaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo minieroGreg Kawere
 
Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 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
 
Janus RTP forwarders @ FOSDEM 2020
Janus RTP forwarders @ FOSDEM 2020Janus RTP forwarders @ FOSDEM 2020
Janus RTP forwarders @ FOSDEM 2020Lorenzo Miniero
 
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
 

Ähnlich wie 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
 
Scaling WebRTC applications with Janus
Scaling WebRTC applications with JanusScaling WebRTC applications with Janus
Scaling WebRTC applications with Janus
 
Scaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo minieroScaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo miniero
 
Convergence Best Poster Award
Convergence Best Poster AwardConvergence Best Poster Award
Convergence Best Poster Award
 
Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019Janus/SIP @ OpenSIPS 2019
Janus/SIP @ OpenSIPS 2019
 
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 (...
 
Janus RTP forwarders @ FOSDEM 2020
Janus RTP forwarders @ FOSDEM 2020Janus RTP forwarders @ FOSDEM 2020
Janus RTP forwarders @ FOSDEM 2020
 
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
 

Mehr von 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
 
Janus SFU cascading @ IIT-RTC 2022
Janus SFU cascading @ IIT-RTC 2022Janus SFU cascading @ IIT-RTC 2022
Janus SFU cascading @ IIT-RTC 2022Lorenzo 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
 
Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Lorenzo Miniero
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceLorenzo Miniero
 
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDScaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDLorenzo 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
 

Mehr von 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!
 
Janus SFU cascading @ IIT-RTC 2022
Janus SFU cascading @ IIT-RTC 2022Janus SFU cascading @ IIT-RTC 2022
Janus SFU cascading @ IIT-RTC 2022
 
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
 
Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConference
 
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDScaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
 
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
 

Kürzlich hochgeladen

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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
🐬 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
 
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
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Kürzlich hochgeladen (20)

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...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
+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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
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...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

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