16 #ifndef _JANUS_GATEWAY_H
17 #define _JANUS_GATEWAY_H
28 #include <microhttpd.h>
29 #ifdef HAVE_WEBSOCKETS
30 #include <libwebsockets.h>
34 #include <amqp_framing.h>
35 #include <amqp_tcp_socket.h>
96 #ifdef HAVE_WEBSOCKETS
98 typedef struct janus_websocket_client {
100 struct libwebsocket_context *context;
102 struct libwebsocket *wsi;
104 GHashTable *sessions;
106 GAsyncQueue *responses;
108 GThreadPool *thread_pool;
113 } janus_websocket_client;
116 typedef struct janus_websocket_request {
121 } janus_websocket_request;
126 typedef struct janus_rabbitmq_client {
128 GHashTable *sessions;
130 GAsyncQueue *responses;
132 GThread *in_thread, *out_thread;
134 GThreadPool *thread_pool;
139 } janus_rabbitmq_client;
142 typedef struct janus_rabbitmq_request {
147 } janus_rabbitmq_request;
150 typedef struct janus_rabbitmq_response {
152 gchar *correlation_id;
155 } janus_rabbitmq_response;
196 #define JANUS_SOURCE_PLAIN_HTTP 1
198 #define JANUS_SOURCE_WEBSOCKETS 2
200 #define JANUS_SOURCE_RABBITMQ 3
269 int janus_ws_handler(
void *cls, struct MHD_Connection *connection, const
char *url, const
char *method, const
char *version, const
char *upload_data,
size_t *upload_data_size,
void **ptr);
271 int janus_admin_ws_handler(
void *cls, struct MHD_Connection *connection, const
char *url, const
char *method, const
char *version, const
char *upload_data,
size_t *upload_data_size,
void **ptr);
273 int janus_ws_headers(
void *cls, enum MHD_ValueKind kind, const
char *key, const
char *value);
275 void janus_ws_request_completed (
void *cls, struct MHD_Connection *connection,
void **con_cls, enum MHD_RequestTerminationCode toe);
287 #ifdef HAVE_WEBSOCKETS
315 void *janus_wss_thread(
void *data);
320 void janus_wss_task(gpointer data, gpointer user_data);
355 void *janus_rmq_in_thread(
void *data);
366 void *janus_rmq_out_thread(
void *data);
371 void janus_rmq_task(gpointer data, gpointer user_data);