The event handler plugin session and callbacks interface. More...
#include <eventhandler.h>
Data Fields | |
| int(*const) | init (const char *config_path) |
| Event handler plugin initialization/constructor. | |
| void(*const) | destroy (void) |
| Event handler plugin deinitialization/destructor. | |
| int(*const) | get_api_compatibility (void) |
| Informative method to request the API version this event handler plugin was compiled against. | |
| int(*const) | get_version (void) |
| Informative method to request the numeric version of the event handler plugin. | |
| const char *(*const) | get_version_string (void) |
| Informative method to request the string version of the event handler plugin. | |
| const char *(*const) | get_description (void) |
| Informative method to request a description of the event handler plugin. | |
| const char *(*const) | get_name (void) |
| Informative method to request the name of the event handler plugin. | |
| const char *(*const) | get_author (void) |
| Informative method to request the author of the event handler plugin. | |
| const char *(*const) | get_package (void) |
| Informative method to request the package name of the event handler plugin (what will be used in web applications to refer to it). | |
| void(*const) | incoming_event (json_t *event) |
| Method to notify the event handler plugin that a new event is available. | |
| json_t *(*const) | handle_request (json_t *request) |
| Method to send a request to this specific event handler plugin. | |
| janus_flags | events_mask |
| Mask of events this handler is interested in, as a janus_flags object. | |
The event handler plugin session and callbacks interface.
| void(*const) janus_eventhandler::destroy(void) |
Event handler plugin deinitialization/destructor.
| janus_flags janus_eventhandler::events_mask |
Mask of events this handler is interested in, as a janus_flags object.
| int(*const) janus_eventhandler::get_api_compatibility(void) |
Informative method to request the API version this event handler plugin was compiled against.
| const char *(*const) janus_eventhandler::get_author(void) |
Informative method to request the author of the event handler plugin.
| const char *(*const) janus_eventhandler::get_description(void) |
Informative method to request a description of the event handler plugin.
| const char *(*const) janus_eventhandler::get_name(void) |
Informative method to request the name of the event handler plugin.
| const char *(*const) janus_eventhandler::get_package(void) |
Informative method to request the package name of the event handler plugin (what will be used in web applications to refer to it).
| int(*const) janus_eventhandler::get_version(void) |
Informative method to request the numeric version of the event handler plugin.
| const char *(*const) janus_eventhandler::get_version_string(void) |
Informative method to request the string version of the event handler plugin.
Method to send a request to this specific event handler plugin.
The method takes a Jansson json_t, that contains all the info related to the request. This object will come from an Admin API request, and is meant to represent a synchronous request. Since each handler can have its own bells and whistles, there's no constraint on what this object should contain, which is entirely handler specific. A json_t object needs to be returned as a response, which will be sent in response to the Admin API call. This can be useful to tweak settings in real-time, or to probe the internals of the handler plugin for monitoring purposes.
| [in] | request | Jansson object containing the request |
| void(*const) janus_eventhandler::incoming_event(json_t *event) |
Method to notify the event handler plugin that a new event is available.
All events are notified as a Jansson json_t object, and the syntax of the associated JSON document is as follows:
{
"type" : <numeric event type identifier>,
"timestamp" : <monotonic time of when the event was generated>,
"session_id" : <unique session identifier>,
"handle_id" : <unique handle identifier, if provided/available>,
"event" : {
<event body, custom depending on event type>
}
}
* json_decref the event object once you're done with it: a failure to do so will result in memory leaks. | [in] | event | Jansson object containing the event details |
| int(*const) janus_eventhandler::init(const char *config_path) |
Event handler plugin initialization/constructor.
| [in] | config_path | Path of the folder where the configuration for this event handler plugin can be found |