Asterisk - The Open Source Telephony Project GIT-master-754dea3
|
Internal API's for websockets. More...
Go to the source code of this file.
Data Structures | |
struct | ari_ws_session |
Functions | |
void | ari_handle_websocket (struct ast_tcptls_session_instance *ser, const char *uri, enum ast_http_method method, struct ast_variable *get_params, struct ast_variable *headers) |
Wrapper for invoking the websocket code for an incoming connection. More... | |
int | ari_websocket_load_module (void) |
int | ari_websocket_process_request (struct ari_ws_session *ast_ws_session, const char *remote_addr, struct ast_variable *upgrade_headers, const char *app_name, struct ast_json *msg) |
void | ari_websocket_send_event (struct ari_ws_session *ari_ws_session, const char *app_name, struct ast_json *message, int debug_app) |
Callback handler for Stasis application messages. More... | |
int | ari_websocket_unload_module (void) |
Internal API's for websockets.
Definition in file ari_websockets.h.
void ari_handle_websocket | ( | struct ast_tcptls_session_instance * | ser, |
const char * | uri, | ||
enum ast_http_method | method, | ||
struct ast_variable * | get_params, | ||
struct ast_variable * | headers | ||
) |
Wrapper for invoking the websocket code for an incoming connection.
ws_server | WebSocket server to invoke. |
ser | HTTP session. |
uri | Requested URI. |
method | Requested HTTP method. |
get_params | Parsed query parameters. |
headers | Parsed HTTP headers. |
Definition at line 221 of file ari_websockets.c.
References ast_websocket_uri_cb(), ast_ws_server, ast_http_uri::data, method, and ast_http_uri::uri.
Referenced by ast_ari_invoke().
int ari_websocket_load_module | ( | void | ) |
Definition at line 722 of file ari_websockets.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, ARI_WS_SESSION_NUM_BUCKETS, ari_ws_session_registry, ari_ws_session_registry_dtor(), ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_websocket_server_add_protocol2(), ast_websocket_server_create(), ast_websocket_sub_protocol_alloc(), ast_ws_server, LOG_WARNING, NULL, ast_websocket_protocol::session_attempted, ast_websocket_protocol::session_established, websocket_attempted_cb(), and websocket_established_cb().
Referenced by load_module().
int ari_websocket_process_request | ( | struct ari_ws_session * | ast_ws_session, |
const char * | remote_addr, | ||
struct ast_variable * | upgrade_headers, | ||
const char * | app_name, | ||
struct ast_json * | msg | ||
) |
Definition at line 261 of file ari_websocket_requests.c.
References app_name(), ARI_INVOKE_SOURCE_WEBSOCKET, ast_ari_invoke(), ast_free, ast_json_dump_string_format(), ast_json_free(), AST_JSON_PRETTY, ast_str_create, ast_verbose(), ast_ari_response::fd, ast_ari_response::headers, LOG_ERROR, ast_ari_response::no_response, NULL, parse_rest_request_msg(), RAII_VAR, request(), request_destroy(), ast_ari_response::response_code, SCOPE_CALL, SCOPE_CALL_WITH_RESULT, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, send_rest_response(), stasis_app_get_debug_by_name(), str, and TRACE_ATLEAST.
Referenced by websocket_established_cb().
void ari_websocket_send_event | ( | struct ari_ws_session * | ari_ws_session, |
const char * | app_name, | ||
struct ast_json * | message, | ||
int | debug_app | ||
) |
Callback handler for Stasis application messages.
Definition at line 244 of file ari_websockets.c.
References ao2_find, ao2_lock, ao2_unlock, app_name(), ari_ws_session_write(), ast_assert, ast_eid_default, ast_eid_to_str(), ast_json_dump_string_format(), ast_json_free(), ast_json_object_get(), ast_json_object_set(), AST_JSON_PRETTY, ast_json_ref(), ast_json_string_create(), ast_json_string_get(), ast_json_timeval(), ast_log, ast_sockaddr_stringify(), ast_strlen_zero(), ast_tvnow(), AST_VECTOR_APPEND, ast_verbose(), ast_websocket_remote_address(), ari_ws_session::ast_ws_session, LOG_WARNING, ari_ws_session::message_queue, msg_timestamp(), NULL, OBJ_NODATA, OBJ_UNLINK, S_OR, SCOPE_ENTER, SCOPE_EXIT, SCOPE_EXIT_LOG_RTN, stasis_app_event_allowed(), str, TRACE_ATLEAST, and ari_ws_session::websocket_apps.
Referenced by ari_ws_session_read(), send_rest_response(), and stasis_app_message_handler().
int ari_websocket_unload_module | ( | void | ) |
Definition at line 711 of file ari_websockets.c.
References ao2_cleanup, ari_ws_session_registry_dtor(), ast_ws_server, and NULL.
Referenced by unload_module().