Janus MQTTEventHandler plugin. More...
#include "eventhandler.h"
#include <MQTTAsync.h>
#include "../debug.h"
#include "../config.h"
#include "../utils.h"
#include "../events.h"
Data Structures | |
struct | janus_mqttevh_context |
Typedefs | |
typedef struct janus_mqttevh_context | janus_mqttevh_context |
Functions | |
janus_eventhandler * | create (void) |
json_t * | janus_mqttevh_handle_request (json_t *request) |
int | janus_mqttevh_client_get_response_code (MQTTAsync_failureData *response) |
int | janus_mqttevh_client_publish_message_wrap (void *context, const char *topic, int retain, char *payload) |
Janus MQTTEventHandler plugin.
This is an MQTT event handler plugin for Janus. It is a refactoring of the original effort contributed by Olle E. Johansson (see https://github.com/meetecho/janus-gateway/pull/1185), which was based on the MQTT transport by Andrei Nesterov and the RabbitMQ event plugin by Piter Konstantinov.
#define JANUS_MQTTEVH_AUTHOR "Olle E. Johansson, Edvina AB" |
#define JANUS_MQTTEVH_DEFAULT_ADDEVENT 1 |
#define JANUS_MQTTEVH_DEFAULT_ADDPLUGIN 1 |
#define JANUS_MQTTEVH_DEFAULT_BASETOPIC "/janus/events" |
#define JANUS_MQTTEVH_DEFAULT_CLEANSESSION 0 /* Off */ |
#define JANUS_MQTTEVH_DEFAULT_CONNECT_STATUS "{\"event\": \"connected\", \"eventhandler\": \""JANUS_MQTTEVH_PACKAGE"\"}" |
#define JANUS_MQTTEVH_DEFAULT_DISCONNECT_STATUS "{\"event\": \"disconnected\"}" |
#define JANUS_MQTTEVH_DEFAULT_DISCONNECT_TIMEOUT 100 |
#define JANUS_MQTTEVH_DEFAULT_JSON_FORMAT JSON_INDENT(3) | JSON_PRESERVE_ORDER |
#define JANUS_MQTTEVH_DEFAULT_KEEPALIVE 30 |
#define JANUS_MQTTEVH_DEFAULT_MAX_BUFFERED 100 |
#define JANUS_MQTTEVH_DEFAULT_MAX_INFLIGHT 10 |
#define JANUS_MQTTEVH_DEFAULT_MQTTURL "tcp://localhost:1883" |
#define JANUS_MQTTEVH_DEFAULT_QOS 0 |
#define JANUS_MQTTEVH_DEFAULT_RETAIN 0 |
#define JANUS_MQTTEVH_DEFAULT_TIMEOUT 30 |
#define JANUS_MQTTEVH_DEFAULT_TLS_ENABLE FALSE |
#define JANUS_MQTTEVH_DEFAULT_TLS_VERIFY_HOST FALSE |
#define JANUS_MQTTEVH_DEFAULT_TLS_VERIFY_PEER FALSE |
#define JANUS_MQTTEVH_DEFAULT_WILL_QOS 0 |
#define JANUS_MQTTEVH_DEFAULT_WILL_RETAIN 1 |
#define JANUS_MQTTEVH_DESCRIPTION "An MQTT event handler plugin for Janus." |
#define JANUS_MQTTEVH_ERROR_INVALID_ELEMENT 413 |
#define JANUS_MQTTEVH_ERROR_INVALID_REQUEST 411 |
#define JANUS_MQTTEVH_ERROR_MISSING_ELEMENT 412 |
#define JANUS_MQTTEVH_ERROR_UNKNOWN_ERROR 499 |
#define JANUS_MQTTEVH_NAME "JANUS MQTTEventHandler plugin" |
#define JANUS_MQTTEVH_PACKAGE "janus.eventhandler.mqttevh" |
#define JANUS_MQTTEVH_STATUS_TOPIC "status" |
#define JANUS_MQTTEVH_VERSION 1 |
#define JANUS_MQTTEVH_VERSION_3_1 "3.1" |
#define JANUS_MQTTEVH_VERSION_3_1_1 "3.1.1" |
#define JANUS_MQTTEVH_VERSION_5 "5" |
#define JANUS_MQTTEVH_VERSION_DEFAULT JANUS_MQTTEVH_VERSION_3_1_1 |
#define JANUS_MQTTEVH_VERSION_STRING "0.1.0" |
typedef struct janus_mqttevh_context janus_mqttevh_context |
janus_eventhandler * create | ( | void | ) |
int janus_mqttevh_client_get_response_code | ( | MQTTAsync_failureData * | response | ) |
int janus_mqttevh_client_publish_message_wrap | ( | void * | context, |
const char * | topic, | ||
int | retain, | ||
char * | payload ) |