Skip to content

Event handler files ​

Event handlers receive every event the core and the plugins raise. They load only when events.broadcast is true in janus.jcfg (or the -e flag is given). See Event handlers.

How to read the tables

Sample is the value in the C sample file. In the port says whether the Rust source mentions the key as a string (read) or not (not found). It is a grep, not a proof: a key that is "read" may be read only in some modes, and a key that is "not found" is accepted and ignored with a warning, as the compatibility notes describe.

Sample HTTP ​

File: janus.eventhandler.sampleevh.jcfg in the configs folder. Sample: conf/janus.eventhandler.sampleevh.jcfg.sample in the C repo.

This configures the sample event handler. Since this plugin simply forwards each event it receives via HTTP POST, you simply need to configure (i) which events to subscribe to, and (ii) the address of the web server which will receive the requests.

general ​

KeySampleMeaningIn the port
enabledfalseBy default the module is not enabledread
events"all"Comma separated list of the events mask you're interested in. Valid values are none, sessions, handles, jsep, webrtc, media, plugins, transports, core, external and all. By default we subscribe to everything (all)read
groupingtrueWhether events should be sent individually (one per HTTP POST, JSON object), or if it's ok to group them (one or more per HTTP POST, JSON array with objects) The default is 'true' to limit the number of connections.read
json"compact"Whether the JSON messages should be indented (pretty), plain (no indentation) or compact (no indentation and no spaces)read
compresstrue (commented out)Optionally, the JSON messages can be compressed using zlibread
compression9 (commented out)In case, you can specify the compression factor, where 1 is the fastest (low compression), and 9 gives the best compressionread
backend"http://your.webserver.here/and/a/path"Address the plugin will send all events to as HTTP POST requests with an application/json payload. In case authentication is required to contact the backend, set the credentials as well (basic authentication only).read
backend_user"myuser" (commented out)read
backend_pwd"mypwd" (commented out)read
max_retransmissions5 (commented out)You can also configure how retransmissions should happen, after a failed attempt to deliver an event. Specifically, you can specify how many times a retransmission should be attempted (default=5) and which step is used, in milliseconds, for the exponential backoff before retrying (e.g, if step=100ms, then the the first retry will happen after 100ms, the second after 200ms, then 400ms, and so on). If the event cannot be retransmitted after the maximum number of attemps is reached, then it's lost. Beware that retransmissions will also delay pending events and increase the queue.read
retransmissions_backoff100 (commented out)read

WebSocket ​

File: janus.eventhandler.wsevh.jcfg in the configs folder. Sample: conf/janus.eventhandler.wsevh.jcfg.sample in the C repo.

This configures the WebSockets event handler. Since this plugin only forwards each event it receives via WebSockets, you simply need to configure (i) which events to subscribe to, and (ii) the address of the WebSockets server which will receive the requests.

general ​

KeySampleMeaningIn the port
enabledfalseBy default the module is not enabledread
events"all"Comma separated list of the events mask you're interested in. Valid values are none, sessions, handles, jsep, webrtc, media, plugins, transports, core, external and all. By default we subscribe to everything (all)read
groupingtrueWhether events should be sent individually (one per HTTP POST, JSON object), or if it's ok to group them (one or more per HTTP POST, JSON array with objects) The default is 'yes' to limit the number of connections.read
json"compact"Whether the JSON messages should be indented (pretty), plain (no indentation) or compact (no indentation and no spaces)read
backend"ws://your.websocket.here"Address the plugin will send all events to as WebSocket messages. In case authentication is required to contact the backend, set the credentials as well.read
subprotocol"your-subprotocol" (commented out)read
events_cap_on_reconnect10 (commented out)If the WebSocket server isn't reachable or the client has to reconnect, the default behaviour of the handler plugin is to retry with an exponential back-off, all while buffering events that Janus may keep on pushing. Buffering has no limit, so if reconnecting takes a long time (or forever) memory usage will keep on growing; besides, it may cause a network spike when eventually reconnected, as all stored events would need to be sent to the backend before new ones can be relayed as well. You can prune queued events and put a cap on the amount of buffering to perform when reconnecting by setting the 'events_cap_on_reconnect' property accordingly: any number you set will be the maximum number of events stored in memory until we reconnect, which means older packets will be discarded if the cap is exceeded. Notice that setting a value of 0 will not mean "drop all packets", but will disable the cap (default behaviour), which means the minimum possible value is 1. Also notice that, when the cap is enabled, this means the event receiver may end up missing key events when a reconnection actually ends up taking place.read
events_max_queue20000 (commented out)'events_cap_on_reconnect' only applies while we are actually reconnecting. A backend that completes the WebSocket handshake and then stops reading never puts us in that state, so nothing pops the queue and it grows until libwebsockets itself gives up on the connection minutes later. 'events_max_queue' is an absolute ceiling that applies whatever the connection state is: when both are set the smaller one wins. As above, 0 disables it (the default), so the minimum useful value is 1.read
ws_logging"err,warn" (commented out)In case you need to debug connection issues, you can configure the libwebsockets debugging level as a comma separated list of things to debug, supported values: err, warn, notice, info, debug, parser, header, ext, client, latency, user, count (plus 'none' and 'all')not found

RabbitMQ ​

File: janus.eventhandler.rabbitmqevh.jcfg in the configs folder. Sample: conf/janus.eventhandler.rabbitmqevh.jcfg.sample in the C repo.

This configures the RabbitMQ event handler.

general ​

KeySampleMeaningIn the port
enabledfalseBy default the module is not enabledread
events"all"Comma separated list of the events mask you're interested in. Valid values are none, sessions, handles, jsep, webrtc, media, plugins, transports, core, external and all. By default we subscribe to everything (all)read
groupingtrueWhether events should be sent individually , or if it's ok to group them. The default is 'yes' to limit the number of messagesread
json"compact"Whether the JSON messages should be indented (pretty), plain (no indentation) or compact (no indentation and no spaces)read
host"localhost"The address of the RabbitMQ serverread
port5672 (commented out)The port of the RabbitMQ server (5672 by default)read
username"guest" (commented out)Username to use to authenticate, if neededread
password"guest" (commented out)Password to use to authenticate, if neededread
vhost"/" (commented out)Virtual host to specify when logging in, if neededread
exchange"janus-exchange" (commented out)read
route_key"janus-events"Routing key to use when publishing messagesread
exchange_type"fanout" (commented out)Rabbitmq exchange_type can be one of the available types: direct, topic, headers and fanout (fanout by defualt).read
heartbeat60 (commented out)Defines the seconds without communication that should pass before considering the TCP connection unreachable.read
block_startup_until_connectedfalse (commented out)Whether to block startup until connected to RabbitMQread
retry_interval5 (commented out)Seconds between startup retries (1-65535, default=5) Also caps runtime reconnect backoff (100ms initial, multiplier=1.5)read
declare_outgoing_queuetrue (commented out)By default (for backwards compatibility), we declare an outgoing queue. Set this to false to disable that behaviorread
ssl_enablefalse (commented out)Whether ssl support must be enabledread
ssl_verify_peertrue (commented out)Whether peer verification must be enabledread
ssl_verify_hostnametrue (commented out)Whether hostname verification must be enabledread
ssl_cacert"/path/to/cacert.pem" (commented out)Certificates to use when SSL support is enabled, if neededread
ssl_cert"/path/to/cert.pem" (commented out)read
ssl_key"/path/to/key.pem" (commented out)read

MQTT ​

File: janus.eventhandler.mqttevh.jcfg in the configs folder. Sample: conf/janus.eventhandler.mqttevh.jcfg.sample in the C repo.

This configures the MQTT event handler. Events are sent either on one topic or on a topic per event type. By default, configuration topics for handle and webrtc event types with the base topic are configured to /janus/events, e.g.: /janus/events/handle /janus/events/webrtc

general ​

KeySampleMeaningIn the port
enabledfalseBy default the module is not enabledread
events"all"Comma separated list of the events mask you're interested in. Valid values are none, sessions, handles, jsep, webrtc, media, plugins, transports, core, external and all. By default we subscribe to everything (all)read
json"compact"Whether the JSON messages should be indented (pretty), plain (no indentation) or compact (no indentation and no spaces)read
url"tcp://localhost:1883"The URL of the MQTT server. "tcp://" and "ssl://" protocols are supported.read
mqtt_version"3.1.1" (commented out)Protocol version. Available values: 3.1, 3.1.1 (default), 5.read
client_id"janus.example.com"Janus client id. You have to configure a unique ID (default: guest).read
keep_alive_interval20 (commented out)Keep connection for N seconds (default: 30)read
cleansession0 (commented out)Clean session flag (default: off)read
retain0 (commented out)Default MQTT retain flag for published eventsread
qos1 (commented out)Default MQTT QoS for published eventsread
max_inflight10 (commented out)Maximum number of inflight messagesread
max_buffered100 (commented out)Maximum number of buffered messagesread
disconnect_timeout100 (commented out)Seconds to wait before destroying clientread
username"guest" (commented out)Username for authentication (default: no authentication)read
password"guest" (commented out)Password for authentication (default: no authentication)read
topic"/janus/events" (commented out)Base topic (default: /janus/events)read
addeventtrue (commented out)Whether we should add the event type to the base topicnot found
tls_enablefalse (commented out)Whether TLS support must be enabledread
connect_status"{\"event\": \"connected\", \"eventhandler\": \"janus.eventhandler.mqttevh\"}" (commented out)Initial message sent to status topic Message sent after disconnect or as LWTread
disconnect_status"{\"event\": \"disconnected\"}" (commented out)read
will_enabledfalse (commented out)Whether to enable LWT (default: false)read
will_retain1 (commented out)Whether LWT should be retained (default: 1)read
will_qos0 (commented out)QoS for LWT (default: 0)read
tls_verify_peertrue (commented out)Whether peer verification must be enabledread
tls_verify_hostnametrue (commented out)Whether hostname verification must be enabledread
tls_cacert"/path/to/cacert.pem" (commented out)Certificates to use when TLS support is enabled, if neededread
tls_client_cert"/path/to/cert.pem" (commented out)read
tls_client_key"/path/to/key.pem" (commented out)read
add_user_properties() (commented out)List of user property ["key", "value"] pairs to add.read

nanomsg ​

File: janus.eventhandler.nanomsgevh.jcfg in the configs folder. Sample: conf/janus.eventhandler.nanomsgevh.jcfg.sample in the C repo.

This configures the Nanomsg event handler. Since this plugin only forwards each event it receives via Nanomsg, you simply need to configure (i) which events to subscribe to, (ii) the address to use for the communication, and (iii) whether the address should be used to bind locally or to connect to a remote endpoint. Notice that the only supported pattern is NN_PUBSUB, where the Nanomsg event handler is the publisher.

general ​

KeySampleMeaningIn the port
enabledfalseBy default the module is not enabledread
events"all"Comma separated list of the events mask you're interested in. Valid values are none, sessions, handles, jsep, webrtc, media, plugins, transports, core, external and all. By default we subscribe to everything (all)read
groupingtrueWhether events should be sent individually (one per HTTP POST, JSON object), or if it's ok to group them (one or more per HTTP POST, JSON array with objects) The default is 'yes' to limit the number of connections.read
json"compact"Whether the JSON messages should be indented (pretty), plain (no indentation) or compact (no indentation and no spaces)read
mode"bind" (commented out)Whether we should 'bind' to the specified address, or connect to it if remote (default)read
address"ipc:///tmp/janusevh.ipc"Address to use, refer to the Nanomsg documentation for more info on different transports you can use hereread

GELF ​

File: janus.eventhandler.gelfevh.jcfg in the configs folder. Sample: conf/janus.eventhandler.gelfevh.jcfg.sample in the C repo.

This configures the GELF event handler. Appending necessary headers and sending messages via TCP or UDP

general ​

KeySampleMeaningIn the port
enabledfalseBy default the module is not enabledread
events"all"Comma separated list of the events mask you're interested in. Valid values are none, sessions, handles, jsep, webrtc, media, plugins, transports, core, external and all. By default we subscribe to everything (all)read
backend"your.graylog.server"DNS or IP of your Graylog serverread
port"12201"Port Graylog server is listening onread
protocol"tcp"tcp or udp transport typeread
max_message_len1024Note that we add 12 bytes of headers + standard UDP headers (8 bytes) when calculating packet size based on MTUread
compresstrue (commented out)Optionally, only for UDP transport, JSON messages can be compressed using zlibread
compression9 (commented out)In case, you can specify the compression factor, where 1 is the fastest (low compression), and 9 gives the best compressionread

GPL-3.0-or-later, like the Janus gateway it ports.