19 #ifndef _ASTERISK_HTTP_WEBSOCKET_H
20 #define _ASTERISK_HTTP_WEBSOCKET_H
28 #define AST_DEFAULT_WEBSOCKET_WRITE_TIMEOUT 100
31 #define AST_DEFAULT_WEBSOCKET_WRITE_TIMEOUT_STR "100"
120 #define AST_WEBSOCKET_PROTOCOL_VERSION 1
264 { errno = ENOSYS;
return -1;});
289 { errno = ENOSYS;
return -1;});
404 WS_URI_RESOLVE_ERROR,
413 WS_CLIENT_START_ERROR,
439 (
const char *uri,
const char *protocols,
Optional API function macros.
A websocket protocol implementation.
ast_websocket_result
Result code for a websocket client.
Structure for a WebSocket server.
ast_websocket_pre_callback session_attempted
Callback called when a new session is attempted. Optional.
Structure for variables, used for configurations and for channel variables.
int AST_OPTIONAL_API_NAME() ast_websocket_close(struct ast_websocket *session, uint16_t reason)
Close function for websocket session.
#define AST_OPTIONAL_API(result, name, proto, stub)
Declare an optional API function.
Socket address structure.
Support for Private Asterisk HTTP Servers.
char * name
Name of the protocol.
Options used for a websocket client.
struct ast_tls_config * tls_cfg
describes a server instance
void(* ast_websocket_callback)(struct ast_websocket *session, struct ast_variable *parameters, struct ast_variable *headers)
Callback for when a new connection for a sub-protocol is established.
int AST_OPTIONAL_API_NAME() ast_websocket_write(struct ast_websocket *session, enum ast_websocket_opcode opcode, char *payload, uint64_t payload_size)
Write function for websocket traffic.
Structure definition for session.
int(* ast_websocket_pre_callback)(struct ast_tcptls_session_instance *ser, struct ast_variable *parameters, struct ast_variable *headers, const char *session_id)
Callback from the HTTP request attempting to establish a websocket connection.
Definition of a URI handler.
ast_websocket_callback session_established
Callback called when a new session is established. Mandatory.
ast_http_method
HTTP Request methods known by Asterisk.
ast_websocket_opcode
WebSocket operation codes.
unsigned int version
Protocol version. Should be set to /ref AST_WEBSOCKET_PROTOCOL_VERSION.