Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
/api-docs/endpoints.{format} implementation- Endpoint resources More...
#include "asterisk.h"
#include "resource_endpoints.h"
#include "asterisk/astobj2.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_app.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/channel.h"
#include "asterisk/message.h"
#include "asterisk/refer.h"
Go to the source code of this file.
Functions | |
void | ast_ari_endpoints_get (struct ast_variable *headers, struct ast_ari_endpoints_get_args *args, struct ast_ari_response *response) |
Details for an endpoint. More... | |
void | ast_ari_endpoints_list (struct ast_variable *headers, struct ast_ari_endpoints_list_args *args, struct ast_ari_response *response) |
List all endpoints. More... | |
void | ast_ari_endpoints_list_by_tech (struct ast_variable *headers, struct ast_ari_endpoints_list_by_tech_args *args, struct ast_ari_response *response) |
List available endoints for a given endpoint technology. More... | |
void | ast_ari_endpoints_refer (struct ast_variable *headers, struct ast_ari_endpoints_refer_args *args, struct ast_ari_response *response) |
Refer an endpoint or technology URI to some technology URI or endpoint. More... | |
void | ast_ari_endpoints_refer_to_endpoint (struct ast_variable *headers, struct ast_ari_endpoints_refer_to_endpoint_args *args, struct ast_ari_response *response) |
Refer an endpoint or technology URI to some technology URI or endpoint. More... | |
void | ast_ari_endpoints_send_message (struct ast_variable *headers, struct ast_ari_endpoints_send_message_args *args, struct ast_ari_response *response) |
Send a message to some technology URI or endpoint. More... | |
void | ast_ari_endpoints_send_message_to_endpoint (struct ast_variable *headers, struct ast_ari_endpoints_send_message_to_endpoint_args *args, struct ast_ari_response *response) |
Send a message to some endpoint in a technology. More... | |
static int | json_to_ast_variables (struct ast_ari_response *response, struct ast_json *json_variables, struct ast_variable **variables) |
static int | parse_refer_json (struct ast_json *body, struct ast_ari_response *response, struct ast_variable **variables) |
static void | send_message (const char *to, const char *from, const char *body, struct ast_variable *variables, struct ast_ari_response *response) |
static void | send_refer (const char *to, const char *from, const char *refer_to, int to_self, struct ast_variable *variables, struct ast_ari_response *response) |
/api-docs/endpoints.{format} implementation- Endpoint resources
Definition in file resource_endpoints.c.
void ast_ari_endpoints_get | ( | struct ast_variable * | headers, |
struct ast_ari_endpoints_get_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Details for an endpoint.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 154 of file resource_endpoints.c.
References ao2_cleanup, args, ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_response_ok(), ast_endpoint_latest_snapshot(), ast_endpoint_snapshot_to_json(), NULL, RAII_VAR, and stasis_app_get_sanitizer().
Referenced by ast_ari_endpoints_get_cb().
void ast_ari_endpoints_list | ( | struct ast_variable * | headers, |
struct ast_ari_endpoints_list_args * | args, | ||
struct ast_ari_response * | response | ||
) |
List all endpoints.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 38 of file resource_endpoints.c.
References ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_response_ok(), ast_endpoint_cache(), ast_endpoint_snapshot_to_json(), ast_endpoint_snapshot_type(), ast_json_array_append(), ast_json_array_create(), ast_json_ref(), ast_json_unref(), cache, NULL, RAII_VAR, stasis_app_get_sanitizer(), stasis_cache_dump(), and stasis_message_data().
Referenced by ast_ari_endpoints_list_cb().
void ast_ari_endpoints_list_by_tech | ( | struct ast_variable * | headers, |
struct ast_ari_endpoints_list_by_tech_args * | args, | ||
struct ast_ari_response * | response | ||
) |
List available endoints for a given endpoint technology.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 86 of file resource_endpoints.c.
References ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, args, ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_response_ok(), ast_endpoint_cache(), ast_endpoint_find_by_id(), ast_endpoint_snapshot_to_json(), ast_endpoint_snapshot_type(), ast_json_array_append(), ast_json_array_create(), ast_json_ref(), ast_json_unref(), cache, NULL, RAII_VAR, stasis_app_get_sanitizer(), stasis_cache_dump(), stasis_message_data(), and ast_endpoint_snapshot::tech.
Referenced by ast_ari_endpoints_list_by_tech_cb().
void ast_ari_endpoints_refer | ( | struct ast_variable * | headers, |
struct ast_ari_endpoints_refer_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Refer an endpoint or technology URI to some technology URI or endpoint.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 398 of file resource_endpoints.c.
References args, ast_ari_endpoints_refer_parse_body(), ast_variables_destroy(), NULL, parse_refer_json(), and send_refer().
Referenced by ast_ari_endpoints_refer_cb().
void ast_ari_endpoints_refer_to_endpoint | ( | struct ast_variable * | headers, |
struct ast_ari_endpoints_refer_to_endpoint_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Refer an endpoint or technology URI to some technology URI or endpoint.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 414 of file resource_endpoints.c.
References ao2_ref, args, ast_ari_endpoints_refer_to_endpoint_parse_body(), ast_ari_response_error(), ast_endpoint_latest_snapshot(), ast_str_to_lower(), ast_strdupa, ast_variables_destroy(), NULL, parse_refer_json(), send_refer(), and ast_endpoint_snapshot::tech.
Referenced by ast_ari_endpoints_refer_to_endpoint_cb().
void ast_ari_endpoints_send_message | ( | struct ast_variable * | headers, |
struct ast_ari_endpoints_send_message_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Send a message to some technology URI or endpoint.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 256 of file resource_endpoints.c.
References args, ast_ari_endpoints_send_message_parse_body(), ast_json_object_get(), ast_variables_destroy(), json_to_ast_variables(), NULL, and send_message().
Referenced by ast_ari_endpoints_send_message_cb().
void ast_ari_endpoints_send_message_to_endpoint | ( | struct ast_variable * | headers, |
struct ast_ari_endpoints_send_message_to_endpoint_args * | args, | ||
struct ast_ari_response * | response | ||
) |
Send a message to some endpoint in a technology.
headers | HTTP headers | |
args | Swagger parameters | |
[out] | response | HTTP response |
Definition at line 277 of file resource_endpoints.c.
References ao2_ref, args, ast_ari_endpoints_send_message_to_endpoint_parse_body(), ast_ari_response_error(), ast_endpoint_latest_snapshot(), ast_json_object_get(), ast_str_to_lower(), ast_strdupa, ast_variables_destroy(), json_to_ast_variables(), NULL, send_message(), and ast_endpoint_snapshot::tech.
Referenced by ast_ari_endpoints_send_message_to_endpoint_cb().
|
static |
Definition at line 235 of file resource_endpoints.c.
References ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_json_to_ast_variables(), AST_JSON_TO_AST_VARS_CODE_INVALID_TYPE, AST_JSON_TO_AST_VARS_CODE_OOM, AST_JSON_TO_AST_VARS_CODE_SUCCESS, ast_log, and AST_LOG_ERROR.
Referenced by ast_ari_endpoints_send_message(), ast_ari_endpoints_send_message_to_endpoint(), and parse_refer_json().
|
static |
Definition at line 361 of file resource_endpoints.c.
References ast_json_object_get(), AST_JSON_STRING, ast_json_string_get(), ast_json_typeof(), ast_variable_list_append, ast_variable_new, json_to_ast_variables(), and value.
Referenced by ast_ari_endpoints_refer(), and ast_ari_endpoints_refer_to_endpoint().
|
static |
Definition at line 177 of file resource_endpoints.c.
References ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_json_null(), ast_msg_alloc(), ast_msg_destroy(), ast_msg_send(), ast_msg_set_body(), ast_msg_set_from(), ast_msg_set_to(), ast_msg_set_var_outbound(), ast_strlen_zero(), ast_msg::body, current, ast_msg::from, ast_ari_response::message, ast_ari_response::response_code, ast_ari_response::response_text, and ast_msg::to.
Referenced by ast_ari_endpoints_send_message(), and ast_ari_endpoints_send_message_to_endpoint().
|
static |
Definition at line 312 of file resource_endpoints.c.
References ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_json_null(), ast_refer_alloc(), ast_refer_destroy(), ast_refer_send(), ast_refer_set_from(), ast_refer_set_refer_to(), ast_refer_set_to(), ast_refer_set_to_self(), ast_refer_set_var_outbound(), ast_strlen_zero(), current, ast_refer::from, ast_ari_response::message, ast_refer::refer_to, ast_ari_response::response_code, ast_ari_response::response_text, ast_refer::to, and ast_refer::to_self.
Referenced by ast_ari_endpoints_refer(), and ast_ari_endpoints_refer_to_endpoint().