Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include "asterisk/http_websocket.h"
#include "asterisk/utils.h"
#include "logger.h"
#include "transport.h"
#include "transport_websocket.h"
Go to the source code of this file.
Data Structures | |
struct | aeap_transport_websocket |
Macros | |
#define | log_error(obj, fmt, ...) aeap_error(obj, "websocket", fmt, ##__VA_ARGS__) |
Functions | |
struct aeap_transport_websocket * | aeap_transport_websocket_create (void) |
Creates (heap allocated), and initializes a transport websocket. More... | |
static int | transport_websocket_init (struct aeap_transport_websocket *transport) |
Initialize a transport websocket object, and set its virtual table. More... | |
static struct aeap_transport_vtable * | transport_websocket_vtable (void) |
static int | websocket_connect (struct aeap_transport *self, const char *url, const char *protocol, int timeout) |
static void | websocket_destroy (struct aeap_transport *self) |
static int | websocket_disconnect (struct aeap_transport *self) |
static intmax_t | websocket_read (struct aeap_transport *self, void *buf, intmax_t size, enum AST_AEAP_DATA_TYPE *rtype) |
static intmax_t | websocket_write (struct aeap_transport *self, const void *buf, intmax_t size, enum AST_AEAP_DATA_TYPE wtype) |
#define log_error | ( | obj, | |
fmt, | |||
... | |||
) | aeap_error(obj, "websocket", fmt, ##__VA_ARGS__) |
Definition at line 28 of file transport_websocket.c.
struct aeap_transport_websocket * aeap_transport_websocket_create | ( | void | ) |
Creates (heap allocated), and initializes a transport websocket.
Definition at line 238 of file transport_websocket.c.
References ast_calloc, ast_free, ast_log, LOG_ERROR, NULL, and transport_websocket_init().
Referenced by aeap_transport_create().
|
static |
Initialize a transport websocket object, and set its virtual table.
transport | The transport to initialize |
Definition at line 229 of file transport_websocket.c.
References NULL, transport_websocket_vtable(), and aeap_transport_websocket::ws.
Referenced by aeap_transport_websocket_create().
|
static |
Definition at line 209 of file transport_websocket.c.
References aeap_transport_vtable::connect, websocket_connect(), websocket_destroy(), websocket_disconnect(), websocket_read(), and websocket_write().
Referenced by transport_websocket_init().
|
static |
Definition at line 37 of file transport_websocket.c.
References ast_websocket_client_create_with_options(), log_error, NULL, ast_websocket_client_options::timeout, ast_websocket_client_options::uri, url, aeap_transport_websocket::ws, and WS_OK.
Referenced by transport_websocket_vtable().
|
static |
Definition at line 70 of file transport_websocket.c.
Referenced by transport_websocket_vtable().
|
static |
Definition at line 58 of file transport_websocket.c.
References ast_websocket_unref(), NULL, and aeap_transport_websocket::ws.
Referenced by transport_websocket_vtable().
|
static |
Definition at line 79 of file transport_websocket.c.
References aeap_transport_disconnect(), AST_AEAP_DATA_TYPE_BINARY, AST_AEAP_DATA_TYPE_NONE, AST_AEAP_DATA_TYPE_STRING, ast_mutex_lock, ast_mutex_unlock, ast_websocket_fd(), AST_WEBSOCKET_OPCODE_BINARY, AST_WEBSOCKET_OPCODE_CLOSE, AST_WEBSOCKET_OPCODE_CONTINUATION, AST_WEBSOCKET_OPCODE_TEXT, ast_websocket_read(), ast_websocket_wait_for_input(), aeap_transport_websocket::base, buf, errno, log_error, aeap_transport::read_lock, and aeap_transport_websocket::ws.
Referenced by transport_websocket_vtable().
|
static |
Definition at line 175 of file transport_websocket.c.
References aeap_transport_disconnect(), AST_AEAP_DATA_TYPE_BINARY, AST_AEAP_DATA_TYPE_STRING, AST_WEBSOCKET_OPCODE_BINARY, AST_WEBSOCKET_OPCODE_TEXT, ast_websocket_write(), buf, log_error, and aeap_transport_websocket::ws.
Referenced by transport_websocket_vtable().