Asterisk - The Open Source Telephony Project GIT-master-754dea3
|
#include "asterisk.h"
#include "ari_websockets.h"
#include "asterisk/ari.h"
#include "asterisk/json.h"
#include "asterisk/stasis_app.h"
Go to the source code of this file.
Data Structures | |
struct | rest_request_msg |
Macros | |
#define | SET_RESPONSE_AND_EXIT(_reponse_code, _reponse_text, _reponse_msg, _remote_addr, _request, _request_msg) |
Functions | |
int | ari_websocket_process_request (struct ari_ws_session *ari_ws_session, const char *remote_addr, struct ast_variable *upgrade_headers, const char *app_name, struct ast_json *request_msg) |
static struct rest_request_msg * | parse_rest_request_msg (const char *remote_addr, struct ast_json *request_msg, struct ast_ari_response *response, int debug_app) |
static void | request_destroy (struct rest_request_msg *request) |
static void | send_rest_response (struct ari_ws_session *ari_ws_session, const char *remote_addr, const char *app_name, struct rest_request_msg *request, struct ast_ari_response *response, int debug_app) |
#define SET_RESPONSE_AND_EXIT | ( | _reponse_code, | |
_reponse_text, | |||
_reponse_msg, | |||
_remote_addr, | |||
_request, | |||
_request_msg | |||
) |
Definition at line 54 of file ari_websocket_requests.c.
int ari_websocket_process_request | ( | struct ari_ws_session * | ari_ws_session, |
const char * | remote_addr, | ||
struct ast_variable * | upgrade_headers, | ||
const char * | app_name, | ||
struct ast_json * | request_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().
|
static |
Definition at line 73 of file ari_websocket_requests.c.
References ast_calloc, ast_free, ast_get_http_method_from_string(), ast_http_parse_post_form(), AST_HTTP_UNKNOWN, ast_json_load_buf(), ast_json_null(), ast_json_nvp_array_to_ast_variables(), AST_JSON_NVP_AST_VARS_CODE_NO_INPUT, AST_JSON_NVP_AST_VARS_CODE_SUCCESS, ast_json_object_get(), ast_json_string_get(), ast_strdup, ast_strings_equal(), ast_strlen_zero(), ast_trace, ast_variable_list_append, rest_request_msg::body, error(), ast_variable::name, ast_variable::next, NULL, RAII_VAR, request(), ast_ari_response::response_code, ast_ari_response::response_text, SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, SET_RESPONSE_AND_EXIT, TRACE_ATLEAST, and ast_variable::value.
Referenced by ari_websocket_process_request().
|
static |
Definition at line 37 of file ari_websocket_requests.c.
References ast_free, ast_json_unref(), ast_variables_destroy(), and request().
Referenced by ari_websocket_process_request().
|
static |
Definition at line 211 of file ari_websocket_requests.c.
References app_name(), ari_websocket_send_event(), AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_free(), ast_json_is_null(), ast_json_pack(), ast_json_unref(), ast_ari_response::fd, LOG_WARNING, ast_ari_response::message, NULL, request(), ast_ari_response::response_code, ast_ari_response::response_text, S_OR, SCOPE_CALL, SCOPE_ENTER, SCOPE_EXIT, and SCOPE_EXIT_LOG_RTN.
Referenced by ari_websocket_process_request().