Janus Unix Sockets transport plugin. More...
#include "transport.h"
#include <arpa/inet.h>
#include <sys/socket.h>
#include <poll.h>
#include <sys/un.h>
#include "../debug.h"
#include "../apierror.h"
#include "../config.h"
#include "../mutex.h"
#include "../utils.h"
Data Structures | |
struct | janus_pfunix_client |
Macros | |
#define | JANUS_PFUNIX_VERSION 1 |
#define | JANUS_PFUNIX_VERSION_STRING "0.0.1" |
#define | JANUS_PFUNIX_DESCRIPTION "This transport plugin adds Unix Sockets support to the Janus API." |
#define | JANUS_PFUNIX_NAME "JANUS Unix Sockets transport plugin" |
#define | JANUS_PFUNIX_AUTHOR "Meetecho s.r.l." |
#define | JANUS_PFUNIX_PACKAGE "janus.transport.pfunix" |
#define | BUFFER_SIZE 8192 |
#define | JANUS_PFUNIX_ERROR_INVALID_REQUEST 411 |
#define | JANUS_PFUNIX_ERROR_MISSING_ELEMENT 412 |
#define | JANUS_PFUNIX_ERROR_INVALID_ELEMENT 413 |
#define | JANUS_PFUNIX_ERROR_UNKNOWN_ERROR 499 |
#define | UNIX_PATH_MAX sizeof(sizecheck.sun_path) |
Typedefs | |
typedef struct janus_pfunix_client | janus_pfunix_client |
Variables | |
struct sockaddr_un | sizecheck |
Janus Unix Sockets transport plugin.
This is an implementation of a Unix Sockets transport for the Janus API. This means that, with the help of this module, local applications can use Unix Sockets to make requests to Janus. This plugin can make use of either the SOCK_SEQPACKET
or the SOCK_DGRAM
socket type according to what you configure, so make sure you're using the right one when writing a client application. Pretty much as it happens with WebSockets, the same client socket can be used for both sending requests and receiving notifications, without any need for long polls. At the same time, without the concept of a REST path, requests sent through the Unix Sockets interface will need to include, when needed, additional pieces of information like session_id
and handle_id
. That is, where you'd send a Janus request related to a specific session to the /janus/<session>
path, with Unix Sockets you'd have to send the same request with an additional session_id
field in the JSON payload. The same applies for the handle.
#define BUFFER_SIZE 8192 |
#define JANUS_PFUNIX_AUTHOR "Meetecho s.r.l." |
#define JANUS_PFUNIX_DESCRIPTION "This transport plugin adds Unix Sockets support to the Janus API." |
#define JANUS_PFUNIX_ERROR_INVALID_ELEMENT 413 |
#define JANUS_PFUNIX_ERROR_INVALID_REQUEST 411 |
#define JANUS_PFUNIX_ERROR_MISSING_ELEMENT 412 |
#define JANUS_PFUNIX_ERROR_UNKNOWN_ERROR 499 |
#define JANUS_PFUNIX_NAME "JANUS Unix Sockets transport plugin" |
#define JANUS_PFUNIX_PACKAGE "janus.transport.pfunix" |
#define JANUS_PFUNIX_VERSION 1 |
#define JANUS_PFUNIX_VERSION_STRING "0.0.1" |
#define UNIX_PATH_MAX sizeof(sizecheck.sun_path) |
typedef struct janus_pfunix_client janus_pfunix_client |
janus_transport * create | ( | void | ) |
void janus_pfunix_destroy | ( | void | ) |
int janus_pfunix_get_api_compatibility | ( | void | ) |
const char * janus_pfunix_get_author | ( | void | ) |
const char * janus_pfunix_get_description | ( | void | ) |
const char * janus_pfunix_get_name | ( | void | ) |
const char * janus_pfunix_get_package | ( | void | ) |
int janus_pfunix_get_version | ( | void | ) |
const char * janus_pfunix_get_version_string | ( | void | ) |
int janus_pfunix_init | ( | janus_transport_callbacks * | callback, |
const char * | config_path ) |
gboolean janus_pfunix_is_admin_api_enabled | ( | void | ) |
gboolean janus_pfunix_is_janus_api_enabled | ( | void | ) |
int janus_pfunix_send_message | ( | janus_transport_session * | transport, |
void * | request_id, | ||
gboolean | admin, | ||
json_t * | message ) |
void janus_pfunix_session_claimed | ( | janus_transport_session * | transport, |
guint64 | session_id ) |
void janus_pfunix_session_created | ( | janus_transport_session * | transport, |
guint64 | session_id ) |
void janus_pfunix_session_over | ( | janus_transport_session * | transport, |
guint64 | session_id, | ||
gboolean | timeout, | ||
gboolean | claimed ) |
void * janus_pfunix_thread | ( | void * | data | ) |
struct sockaddr_un sizecheck |