Asterisk - The Open Source Telephony Project
21.4.1
|
Endpoint resources. More...
#include "asterisk.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/stasis_app.h"
#include "ari/resource_endpoints.h"
Go to the source code of this file.
Macros | |
#define | MAX_VALS 128 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | ast_ari_endpoints_get_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Parameter parsing callback for /endpoints/{tech}/{resource}. More... | |
static void | ast_ari_endpoints_list_by_tech_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Parameter parsing callback for /endpoints/{tech}. More... | |
static void | ast_ari_endpoints_list_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Parameter parsing callback for /endpoints. More... | |
static void | ast_ari_endpoints_refer_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Parameter parsing callback for /endpoints/refer. More... | |
int | ast_ari_endpoints_refer_parse_body (struct ast_json *body, struct ast_ari_endpoints_refer_args *args) |
Body parsing function for /endpoints/refer. More... | |
static void | ast_ari_endpoints_refer_to_endpoint_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Parameter parsing callback for /endpoints/{tech}/{resource}/refer. More... | |
int | ast_ari_endpoints_refer_to_endpoint_parse_body (struct ast_json *body, struct ast_ari_endpoints_refer_to_endpoint_args *args) |
Body parsing function for /endpoints/{tech}/{resource}/refer. More... | |
static void | ast_ari_endpoints_send_message_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Parameter parsing callback for /endpoints/sendMessage. More... | |
int | ast_ari_endpoints_send_message_parse_body (struct ast_json *body, struct ast_ari_endpoints_send_message_args *args) |
Body parsing function for /endpoints/sendMessage. More... | |
static void | ast_ari_endpoints_send_message_to_endpoint_cb (struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response) |
Parameter parsing callback for /endpoints/{tech}/{resource}/sendMessage. More... | |
int | ast_ari_endpoints_send_message_to_endpoint_parse_body (struct ast_json *body, struct ast_ari_endpoints_send_message_to_endpoint_args *args) |
Body parsing function for /endpoints/{tech}/{resource}/sendMessage. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "RESTful API module - Endpoint resources" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "da6642af068ee5e6490c5b1d2cc1d238" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari,res_ari_model,res_stasis", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct stasis_rest_handlers | endpoints |
REST handler for /api-docs/endpoints.json. | |
static struct stasis_rest_handlers | endpoints_refer |
REST handler for /api-docs/endpoints.json. | |
static struct stasis_rest_handlers | endpoints_sendMessage |
REST handler for /api-docs/endpoints.json. | |
static struct stasis_rest_handlers | endpoints_tech |
REST handler for /api-docs/endpoints.json. | |
static struct stasis_rest_handlers | endpoints_tech_resource |
REST handler for /api-docs/endpoints.json. | |
static struct stasis_rest_handlers | endpoints_tech_resource_refer |
REST handler for /api-docs/endpoints.json. | |
static struct stasis_rest_handlers | endpoints_tech_resource_sendMessage |
REST handler for /api-docs/endpoints.json. | |
Endpoint resources.
Definition in file res_ari_endpoints.c.
|
static |
Parameter parsing callback for /endpoints/{tech}/{resource}.
ser | TCP/TLS session object | |
get_params | GET parameters in the HTTP request. | |
path_vars | Path variables extracted from the request. | |
headers | HTTP headers. | |
body | ||
[out] | response | Response to the HTTP request. |
Definition at line 359 of file res_ari_endpoints.c.
References ast_ari_endpoints_get(), ast_ari_response_error(), ast_ari_validate_endpoint(), ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_endpoints_get_args::resource, ast_ari_response::response_code, ast_ari_endpoints_get_args::tech, and ast_variable::value.
|
static |
Parameter parsing callback for /endpoints/{tech}.
ser | TCP/TLS session object | |
get_params | GET parameters in the HTTP request. | |
path_vars | Path variables extracted from the request. | |
headers | HTTP headers. | |
body | ||
[out] | response | Response to the HTTP request. |
Definition at line 299 of file res_ari_endpoints.c.
References ast_ari_endpoints_list_by_tech(), ast_ari_response_error(), ast_ari_validate_endpoint_fn(), ast_ari_validate_list(), ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_response::response_code, ast_ari_endpoints_list_by_tech_args::tech, and ast_variable::value.
|
static |
Parameter parsing callback for /endpoints.
ser | TCP/TLS session object | |
get_params | GET parameters in the HTTP request. | |
path_vars | Path variables extracted from the request. | |
headers | HTTP headers. | |
body | ||
[out] | response | Response to the HTTP request. |
Definition at line 62 of file res_ari_endpoints.c.
References ast_ari_endpoints_list(), ast_ari_response_error(), ast_ari_validate_endpoint_fn(), ast_ari_validate_list(), ast_ari_response::message, and ast_ari_response::response_code.
|
static |
Parameter parsing callback for /endpoints/refer.
ser | TCP/TLS session object | |
get_params | GET parameters in the HTTP request. | |
path_vars | Path variables extracted from the request. | |
headers | HTTP headers. | |
body | ||
[out] | response | Response to the HTTP request. |
Definition at line 228 of file res_ari_endpoints.c.
References ast_ari_endpoints_refer(), ast_ari_response_error(), ast_ari_validate_void(), ast_true(), ast_ari_endpoints_refer_args::from, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_endpoints_refer_args::refer_to, ast_ari_response::response_code, ast_ari_endpoints_refer_args::to, ast_ari_endpoints_refer_args::to_self, ast_variable::value, and ast_ari_endpoints_refer_args::variables.
int ast_ari_endpoints_refer_parse_body | ( | struct ast_json * | body, |
struct ast_ari_endpoints_refer_args * | args | ||
) |
Body parsing function for /endpoints/refer.
body | The JSON body from which to parse parameters. | |
[out] | args | The args structure to parse into. |
zero | on success |
non-zero | on failure |
Definition at line 194 of file res_ari_endpoints.c.
References ast_json_is_true(), ast_json_object_get(), ast_json_string_get(), ast_ari_endpoints_refer_args::from, ast_ari_endpoints_refer_args::refer_to, ast_ari_endpoints_refer_args::to, and ast_ari_endpoints_refer_args::to_self.
Referenced by ast_ari_endpoints_refer().
|
static |
Parameter parsing callback for /endpoints/{tech}/{resource}/refer.
ser | TCP/TLS session object | |
get_params | GET parameters in the HTTP request. | |
path_vars | Path variables extracted from the request. | |
headers | HTTP headers. | |
body | ||
[out] | response | Response to the HTTP request. |
Definition at line 535 of file res_ari_endpoints.c.
References ast_ari_endpoints_refer_to_endpoint(), ast_ari_response_error(), ast_ari_validate_void(), ast_true(), ast_ari_endpoints_refer_to_endpoint_args::from, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_endpoints_refer_to_endpoint_args::refer_to, ast_ari_endpoints_refer_to_endpoint_args::resource, ast_ari_response::response_code, ast_ari_endpoints_refer_to_endpoint_args::tech, ast_ari_endpoints_refer_to_endpoint_args::to_self, ast_variable::value, and ast_ari_endpoints_refer_to_endpoint_args::variables.
int ast_ari_endpoints_refer_to_endpoint_parse_body | ( | struct ast_json * | body, |
struct ast_ari_endpoints_refer_to_endpoint_args * | args | ||
) |
Body parsing function for /endpoints/{tech}/{resource}/refer.
body | The JSON body from which to parse parameters. | |
[out] | args | The args structure to parse into. |
zero | on success |
non-zero | on failure |
Definition at line 505 of file res_ari_endpoints.c.
References ast_json_is_true(), ast_json_object_get(), ast_json_string_get(), ast_ari_endpoints_refer_to_endpoint_args::from, ast_ari_endpoints_refer_to_endpoint_args::refer_to, and ast_ari_endpoints_refer_to_endpoint_args::to_self.
Referenced by ast_ari_endpoints_refer_to_endpoint().
|
static |
Parameter parsing callback for /endpoints/sendMessage.
ser | TCP/TLS session object | |
get_params | GET parameters in the HTTP request. | |
path_vars | Path variables extracted from the request. | |
headers | HTTP headers. | |
body | ||
[out] | response | Response to the HTTP request. |
Definition at line 135 of file res_ari_endpoints.c.
References ast_ari_endpoints_send_message(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_endpoints_send_message_args::body, ast_ari_endpoints_send_message_args::from, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_response::response_code, ast_ari_endpoints_send_message_args::to, and ast_variable::value.
int ast_ari_endpoints_send_message_parse_body | ( | struct ast_json * | body, |
struct ast_ari_endpoints_send_message_args * | args | ||
) |
Body parsing function for /endpoints/sendMessage.
body | The JSON body from which to parse parameters. | |
[out] | args | The args structure to parse into. |
zero | on success |
non-zero | on failure |
Definition at line 105 of file res_ari_endpoints.c.
References ast_json_object_get(), ast_json_string_get(), ast_ari_endpoints_send_message_args::body, ast_ari_endpoints_send_message_args::from, and ast_ari_endpoints_send_message_args::to.
Referenced by ast_ari_endpoints_send_message().
|
static |
Parameter parsing callback for /endpoints/{tech}/{resource}/sendMessage.
ser | TCP/TLS session object | |
get_params | GET parameters in the HTTP request. | |
path_vars | Path variables extracted from the request. | |
headers | HTTP headers. | |
body | ||
[out] | response | Response to the HTTP request. |
Definition at line 440 of file res_ari_endpoints.c.
References ast_ari_endpoints_send_message_to_endpoint(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_endpoints_send_message_to_endpoint_args::body, ast_ari_endpoints_send_message_to_endpoint_args::from, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_endpoints_send_message_to_endpoint_args::resource, ast_ari_response::response_code, ast_ari_endpoints_send_message_to_endpoint_args::tech, and ast_variable::value.
int ast_ari_endpoints_send_message_to_endpoint_parse_body | ( | struct ast_json * | body, |
struct ast_ari_endpoints_send_message_to_endpoint_args * | args | ||
) |
Body parsing function for /endpoints/{tech}/{resource}/sendMessage.
body | The JSON body from which to parse parameters. | |
[out] | args | The args structure to parse into. |
zero | on success |
non-zero | on failure |
Definition at line 414 of file res_ari_endpoints.c.
References ast_json_object_get(), ast_json_string_get(), ast_ari_endpoints_send_message_to_endpoint_args::body, and ast_ari_endpoints_send_message_to_endpoint_args::from.
Referenced by ast_ari_endpoints_send_message_to_endpoint().