Asterisk - The Open Source Telephony Project
21.4.1
|
Asterisk resources. More...
#include "asterisk.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/stasis_app.h"
#include "ari/resource_asterisk.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_asterisk_add_log_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 /asterisk/logging/{logChannelName}. More... | |
int | ast_ari_asterisk_add_log_parse_body (struct ast_json *body, struct ast_ari_asterisk_add_log_args *args) |
Body parsing function for /asterisk/logging/{logChannelName}. More... | |
static void | ast_ari_asterisk_delete_log_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 /asterisk/logging/{logChannelName}. More... | |
static void | ast_ari_asterisk_delete_object_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 /asterisk/config/dynamic/{configClass}/{objectType}/{id}. More... | |
static void | ast_ari_asterisk_get_global_var_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 /asterisk/variable. More... | |
int | ast_ari_asterisk_get_global_var_parse_body (struct ast_json *body, struct ast_ari_asterisk_get_global_var_args *args) |
Body parsing function for /asterisk/variable. More... | |
static void | ast_ari_asterisk_get_info_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 /asterisk/info. More... | |
int | ast_ari_asterisk_get_info_parse_body (struct ast_json *body, struct ast_ari_asterisk_get_info_args *args) |
Body parsing function for /asterisk/info. More... | |
static void | ast_ari_asterisk_get_module_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 /asterisk/modules/{moduleName}. More... | |
static void | ast_ari_asterisk_get_object_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 /asterisk/config/dynamic/{configClass}/{objectType}/{id}. More... | |
static void | ast_ari_asterisk_list_log_channels_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 /asterisk/logging. More... | |
static void | ast_ari_asterisk_list_modules_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 /asterisk/modules. More... | |
static void | ast_ari_asterisk_load_module_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 /asterisk/modules/{moduleName}. More... | |
static void | ast_ari_asterisk_ping_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 /asterisk/ping. More... | |
static void | ast_ari_asterisk_reload_module_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 /asterisk/modules/{moduleName}. More... | |
static void | ast_ari_asterisk_rotate_log_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 /asterisk/logging/{logChannelName}/rotate. More... | |
static void | ast_ari_asterisk_set_global_var_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 /asterisk/variable. More... | |
int | ast_ari_asterisk_set_global_var_parse_body (struct ast_json *body, struct ast_ari_asterisk_set_global_var_args *args) |
Body parsing function for /asterisk/variable. More... | |
static void | ast_ari_asterisk_unload_module_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 /asterisk/modules/{moduleName}. More... | |
static void | ast_ari_asterisk_update_object_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 /asterisk/config/dynamic/{configClass}/{objectType}/{id}. More... | |
int | ast_ari_asterisk_update_object_parse_body (struct ast_json *body, struct ast_ari_asterisk_update_object_args *args) |
Body parsing function for /asterisk/config/dynamic/{configClass}/{objectType}/{id}. 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 - Asterisk 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 | asterisk |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_config |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_config_dynamic |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_config_dynamic_configClass |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_config_dynamic_configClass_objectType |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_config_dynamic_configClass_objectType_id |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_info |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_logging |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_logging_logChannelName |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_logging_logChannelName_rotate |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_modules |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_modules_moduleName |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_ping |
REST handler for /api-docs/asterisk.json. | |
static struct stasis_rest_handlers | asterisk_variable |
REST handler for /api-docs/asterisk.json. | |
Asterisk resources.
Definition in file res_ari_asterisk.c.
|
static |
Parameter parsing callback for /asterisk/logging/{logChannelName}.
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 827 of file res_ari_asterisk.c.
References ast_ari_asterisk_add_log(), ast_ari_asterisk_add_log_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_asterisk_add_log_args::configuration, ast_ari_asterisk_add_log_args::log_channel_name, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_response::response_code, and ast_variable::value.
int ast_ari_asterisk_add_log_parse_body | ( | struct ast_json * | body, |
struct ast_ari_asterisk_add_log_args * | args | ||
) |
Body parsing function for /asterisk/logging/{logChannelName}.
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 805 of file res_ari_asterisk.c.
References ast_json_object_get(), ast_json_string_get(), and ast_ari_asterisk_add_log_args::configuration.
Referenced by ast_ari_asterisk_add_log_cb().
|
static |
Parameter parsing callback for /asterisk/logging/{logChannelName}.
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 898 of file res_ari_asterisk.c.
References ast_ari_asterisk_delete_log(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_asterisk_delete_log_args::log_channel_name, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/config/dynamic/{configClass}/{objectType}/{id}.
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 205 of file res_ari_asterisk.c.
References ast_ari_asterisk_delete_object(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_asterisk_delete_object_args::config_class, ast_ari_asterisk_delete_object_args::id, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_asterisk_delete_object_args::object_type, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/variable.
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 1031 of file res_ari_asterisk.c.
References ast_ari_asterisk_get_global_var(), ast_ari_asterisk_get_global_var_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_variable(), ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_response::response_code, ast_variable::value, and ast_ari_asterisk_get_global_var_args::variable.
int ast_ari_asterisk_get_global_var_parse_body | ( | struct ast_json * | body, |
struct ast_ari_asterisk_get_global_var_args * | args | ||
) |
Body parsing function for /asterisk/variable.
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 1009 of file res_ari_asterisk.c.
References ast_json_object_get(), ast_json_string_get(), and ast_ari_asterisk_get_global_var_args::variable.
Referenced by ast_ari_asterisk_get_global_var_cb().
|
static |
Parameter parsing callback for /asterisk/info.
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 310 of file res_ari_asterisk.c.
References ast_ari_asterisk_get_info(), ast_ari_asterisk_get_info_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_asterisk_info(), ast_malloc, ast_strdup, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_asterisk_get_info_args::only, ast_ari_asterisk_get_info_args::only_count, ast_ari_asterisk_get_info_args::only_parse, ast_ari_response::response_code, and ast_variable::value.
int ast_ari_asterisk_get_info_parse_body | ( | struct ast_json * | body, |
struct ast_ari_asterisk_get_info_args * | args | ||
) |
Body parsing function for /asterisk/info.
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 263 of file res_ari_asterisk.c.
References ast_json_array_get(), ast_json_array_size(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), ast_malloc, ast_ari_asterisk_get_info_args::only, and ast_ari_asterisk_get_info_args::only_count.
Referenced by ast_ari_asterisk_get_info_cb().
|
static |
Parameter parsing callback for /asterisk/modules/{moduleName}.
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 519 of file res_ari_asterisk.c.
References ast_ari_asterisk_get_module(), ast_ari_response_error(), ast_ari_validate_module(), ast_ari_response::message, ast_ari_asterisk_get_module_args::module_name, ast_variable::name, ast_variable::next, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/config/dynamic/{configClass}/{objectType}/{id}.
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_asterisk.c.
References ast_ari_asterisk_get_object(), ast_ari_response_error(), ast_ari_validate_config_tuple_fn(), ast_ari_validate_list(), ast_ari_asterisk_get_object_args::config_class, ast_ari_asterisk_get_object_args::id, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_asterisk_get_object_args::object_type, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/logging.
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 762 of file res_ari_asterisk.c.
References ast_ari_asterisk_list_log_channels(), ast_ari_response_error(), ast_ari_validate_list(), ast_ari_validate_log_channel_fn(), ast_ari_response::message, and ast_ari_response::response_code.
|
static |
Parameter parsing callback for /asterisk/modules.
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 467 of file res_ari_asterisk.c.
References ast_ari_asterisk_list_modules(), ast_ari_response_error(), ast_ari_validate_list(), ast_ari_validate_module_fn(), ast_ari_response::message, and ast_ari_response::response_code.
|
static |
Parameter parsing callback for /asterisk/modules/{moduleName}.
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 580 of file res_ari_asterisk.c.
References ast_ari_asterisk_load_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_response::message, ast_ari_asterisk_load_module_args::module_name, ast_variable::name, ast_variable::next, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/ping.
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 415 of file res_ari_asterisk.c.
References ast_ari_asterisk_ping(), ast_ari_response_error(), ast_ari_validate_asterisk_ping(), ast_ari_response::message, and ast_ari_response::response_code.
|
static |
Parameter parsing callback for /asterisk/modules/{moduleName}.
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 701 of file res_ari_asterisk.c.
References ast_ari_asterisk_reload_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_response::message, ast_ari_asterisk_reload_module_args::module_name, ast_variable::name, ast_variable::next, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/logging/{logChannelName}/rotate.
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 958 of file res_ari_asterisk.c.
References ast_ari_asterisk_rotate_log(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_asterisk_rotate_log_args::log_channel_name, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/variable.
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 1112 of file res_ari_asterisk.c.
References ast_ari_asterisk_set_global_var(), ast_ari_asterisk_set_global_var_parse_body(), ast_ari_response_alloc_failed(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_response::response_code, ast_variable::value, ast_ari_asterisk_set_global_var_args::value, and ast_ari_asterisk_set_global_var_args::variable.
int ast_ari_asterisk_set_global_var_parse_body | ( | struct ast_json * | body, |
struct ast_ari_asterisk_set_global_var_args * | args | ||
) |
Body parsing function for /asterisk/variable.
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 1086 of file res_ari_asterisk.c.
References ast_json_object_get(), ast_json_string_get(), ast_ari_asterisk_set_global_var_args::value, and ast_ari_asterisk_set_global_var_args::variable.
Referenced by ast_ari_asterisk_set_global_var_cb().
|
static |
Parameter parsing callback for /asterisk/modules/{moduleName}.
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 640 of file res_ari_asterisk.c.
References ast_ari_asterisk_unload_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_ari_response::message, ast_ari_asterisk_unload_module_args::module_name, ast_variable::name, ast_variable::next, ast_ari_response::response_code, and ast_variable::value.
|
static |
Parameter parsing callback for /asterisk/config/dynamic/{configClass}/{objectType}/{id}.
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 136 of file res_ari_asterisk.c.
References ast_ari_asterisk_update_object(), ast_ari_response_error(), ast_ari_validate_config_tuple_fn(), ast_ari_validate_list(), ast_ari_asterisk_update_object_args::config_class, ast_ari_asterisk_update_object_args::fields, ast_ari_asterisk_update_object_args::id, ast_ari_response::message, ast_variable::name, ast_variable::next, ast_ari_asterisk_update_object_args::object_type, ast_ari_response::response_code, and ast_variable::value.
int ast_ari_asterisk_update_object_parse_body | ( | struct ast_json * | body, |
struct ast_ari_asterisk_update_object_args * | args | ||
) |
Body parsing function for /asterisk/config/dynamic/{configClass}/{objectType}/{id}.
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 119 of file res_ari_asterisk.c.