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
| Key | Sample | Meaning | In the port |
|---|---|---|---|
enabled | false | By default the module is not enabled | read |
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 |
grouping | true | Whether 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 |
compress | true (commented out) | Optionally, the JSON messages can be compressed using zlib | read |
compression | 9 (commented out) | In case, you can specify the compression factor, where 1 is the fastest (low compression), and 9 gives the best compression | read |
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_retransmissions | 5 (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_backoff | 100 (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
| Key | Sample | Meaning | In the port |
|---|---|---|---|
enabled | false | By default the module is not enabled | read |
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 |
grouping | true | Whether 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_reconnect | 10 (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_queue | 20000 (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
| Key | Sample | Meaning | In the port |
|---|---|---|---|
enabled | false | By default the module is not enabled | read |
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 |
grouping | true | Whether events should be sent individually , or if it's ok to group them. The default is 'yes' to limit the number of messages | read |
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 server | read |
port | 5672 (commented out) | The port of the RabbitMQ server (5672 by default) | read |
username | "guest" (commented out) | Username to use to authenticate, if needed | read |
password | "guest" (commented out) | Password to use to authenticate, if needed | read |
vhost | "/" (commented out) | Virtual host to specify when logging in, if needed | read |
exchange | "janus-exchange" (commented out) | read | |
route_key | "janus-events" | Routing key to use when publishing messages | read |
exchange_type | "fanout" (commented out) | Rabbitmq exchange_type can be one of the available types: direct, topic, headers and fanout (fanout by defualt). | read |
heartbeat | 60 (commented out) | Defines the seconds without communication that should pass before considering the TCP connection unreachable. | read |
block_startup_until_connected | false (commented out) | Whether to block startup until connected to RabbitMQ | read |
retry_interval | 5 (commented out) | Seconds between startup retries (1-65535, default=5) Also caps runtime reconnect backoff (100ms initial, multiplier=1.5) | read |
declare_outgoing_queue | true (commented out) | By default (for backwards compatibility), we declare an outgoing queue. Set this to false to disable that behavior | read |
ssl_enable | false (commented out) | Whether ssl support must be enabled | read |
ssl_verify_peer | true (commented out) | Whether peer verification must be enabled | read |
ssl_verify_hostname | true (commented out) | Whether hostname verification must be enabled | read |
ssl_cacert | "/path/to/cacert.pem" (commented out) | Certificates to use when SSL support is enabled, if needed | read |
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
| Key | Sample | Meaning | In the port |
|---|---|---|---|
enabled | false | By default the module is not enabled | read |
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_interval | 20 (commented out) | Keep connection for N seconds (default: 30) | read |
cleansession | 0 (commented out) | Clean session flag (default: off) | read |
retain | 0 (commented out) | Default MQTT retain flag for published events | read |
qos | 1 (commented out) | Default MQTT QoS for published events | read |
max_inflight | 10 (commented out) | Maximum number of inflight messages | read |
max_buffered | 100 (commented out) | Maximum number of buffered messages | read |
disconnect_timeout | 100 (commented out) | Seconds to wait before destroying client | read |
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 |
addevent | true (commented out) | Whether we should add the event type to the base topic | not found |
tls_enable | false (commented out) | Whether TLS support must be enabled | read |
connect_status | "{\"event\": \"connected\", \"eventhandler\": \"janus.eventhandler.mqttevh\"}" (commented out) | Initial message sent to status topic Message sent after disconnect or as LWT | read |
disconnect_status | "{\"event\": \"disconnected\"}" (commented out) | read | |
will_enabled | false (commented out) | Whether to enable LWT (default: false) | read |
will_retain | 1 (commented out) | Whether LWT should be retained (default: 1) | read |
will_qos | 0 (commented out) | QoS for LWT (default: 0) | read |
tls_verify_peer | true (commented out) | Whether peer verification must be enabled | read |
tls_verify_hostname | true (commented out) | Whether hostname verification must be enabled | read |
tls_cacert | "/path/to/cacert.pem" (commented out) | Certificates to use when TLS support is enabled, if needed | read |
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
| Key | Sample | Meaning | In the port |
|---|---|---|---|
enabled | false | By default the module is not enabled | read |
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 |
grouping | true | Whether 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 here | read |
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
| Key | Sample | Meaning | In the port |
|---|---|---|---|
enabled | false | By default the module is not enabled | read |
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 server | read |
port | "12201" | Port Graylog server is listening on | read |
protocol | "tcp" | tcp or udp transport type | read |
max_message_len | 1024 | Note that we add 12 bytes of headers + standard UDP headers (8 bytes) when calculating packet size based on MTU | read |
compress | true (commented out) | Optionally, only for UDP transport, JSON messages can be compressed using zlib | read |
compression | 9 (commented out) | In case, you can specify the compression factor, where 1 is the fastest (low compression), and 9 gives the best compression | read |