Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
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 = AST_BUILDOPT_SUM, .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. More... | |
static struct stasis_rest_handlers | asterisk_config |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_config_dynamic |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_config_dynamic_configClass |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_config_dynamic_configClass_objectType |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_config_dynamic_configClass_objectType_id |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_info |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_logging |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_logging_logChannelName |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_logging_logChannelName_rotate |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_modules |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_modules_moduleName |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_ping |
REST handler for /api-docs/asterisk.json. More... | |
static struct stasis_rest_handlers | asterisk_variable |
REST handler for /api-docs/asterisk.json. More... | |
Asterisk resources.
Definition in file res_ari_asterisk.c.
#define MAX_VALS 128 |
Definition at line 51 of file res_ari_asterisk.c.
|
static |
Definition at line 1330 of file res_ari_asterisk.c.
|
static |
Definition at line 1330 of 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 args, 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_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_json_object_get(), and ast_json_string_get().
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 args, ast_ari_asterisk_delete_log(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_ari_asterisk_delete_object(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, 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_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.
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 args, ast_json_object_get(), and ast_json_string_get().
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 args, ARRAY_LEN, ast_app_separate_args, 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_free, ast_log, ast_malloc, ast_strdup, LOG_ERROR, MAX_VALS, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_free, AST_JSON_ARRAY, ast_json_array_get(), ast_json_array_size(), ast_json_object_get(), ast_json_string_get(), ast_json_typeof(), and ast_malloc.
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 args, ast_ari_asterisk_get_module(), ast_ari_response_error(), ast_ari_validate_module(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_ari_asterisk_get_object(), ast_ari_response_error(), ast_ari_validate_config_tuple_fn(), ast_ari_validate_list(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_ari_asterisk_list_log_channels(), ast_ari_response_error(), ast_ari_validate_list(), ast_ari_validate_log_channel_fn(), ast_log, LOG_ERROR, ast_ari_response::message, NULL, 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 args, ast_ari_asterisk_list_modules(), ast_ari_response_error(), ast_ari_validate_list(), ast_ari_validate_module_fn(), ast_log, LOG_ERROR, ast_ari_response::message, NULL, 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 args, ast_ari_asterisk_load_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_ari_asterisk_ping(), ast_ari_response_error(), ast_ari_validate_asterisk_ping(), ast_log, LOG_ERROR, ast_ari_response::message, NULL, 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 args, ast_ari_asterisk_reload_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_ari_asterisk_rotate_log(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, 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_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.
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 args, ast_json_object_get(), and ast_json_string_get().
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 args, ast_ari_asterisk_unload_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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 args, ast_ari_asterisk_update_object(), ast_ari_response_error(), ast_ari_validate_config_tuple_fn(), ast_ari_validate_list(), ast_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1330 of file res_ari_asterisk.c.
|
static |
Definition at line 1311 of file res_ari_asterisk.c.
References ast_ari_add_handler(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, asterisk, and unload_module().
|
static |
Definition at line 1305 of file res_ari_asterisk.c.
References ast_ari_remove_handler(), and asterisk.
Referenced by load_module().
|
static |
Definition at line 1330 of file res_ari_asterisk.c.
|
static |
Definition at line 1330 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1297 of file res_ari_asterisk.c.
Referenced by load_module(), and unload_module().
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1210 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1202 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1193 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1184 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1172 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1218 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1278 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1267 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1258 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1249 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1236 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1227 of file res_ari_asterisk.c.
|
static |
REST handler for /api-docs/asterisk.json.
Definition at line 1287 of file res_ari_asterisk.c.