47 #if defined(AST_DEVMODE) 67 #if defined(AST_DEVMODE) 72 for (i = path_vars; i; i = i->
next) {
73 if (strcmp(i->
name,
"configClass") == 0) {
76 if (strcmp(i->
name,
"objectType") == 0) {
79 if (strcmp(i->
name,
"id") == 0) {
85 #if defined(AST_DEVMODE) 98 if (200 <= code && code <= 299) {
102 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n", code);
108 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n");
110 "Internal Server Error",
"Response validation failed");
114 fin: __attribute__((unused))
139 #if defined(AST_DEVMODE) 144 for (i = path_vars; i; i = i->
next) {
145 if (strcmp(i->
name,
"configClass") == 0) {
148 if (strcmp(i->
name,
"objectType") == 0) {
151 if (strcmp(i->
name,
"id") == 0) {
158 #if defined(AST_DEVMODE) 173 if (200 <= code && code <= 299) {
177 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n", code);
183 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n");
185 "Internal Server Error",
"Response validation failed");
189 fin: __attribute__((unused))
206 #if defined(AST_DEVMODE) 211 for (i = path_vars; i; i = i->
next) {
212 if (strcmp(i->
name,
"configClass") == 0) {
215 if (strcmp(i->
name,
"objectType") == 0) {
218 if (strcmp(i->
name,
"id") == 0) {
224 #if defined(AST_DEVMODE) 238 if (200 <= code && code <= 299) {
242 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n", code);
248 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n");
250 "Internal Server Error",
"Response validation failed");
254 fin: __attribute__((unused))
309 #if defined(AST_DEVMODE) 314 for (i = get_params; i; i = i->
next) {
315 if (strcmp(i->
name,
"only") == 0) {
344 "Too many values for only");
355 args.
only[j] = (vals[j]);
365 #if defined(AST_DEVMODE) 377 if (200 <= code && code <= 299) {
389 "Internal Server Error",
"Response validation failed");
393 fin: __attribute__((unused))
411 #if defined(AST_DEVMODE) 417 #if defined(AST_DEVMODE) 429 if (200 <= code && code <= 299) {
441 "Internal Server Error",
"Response validation failed");
445 fin: __attribute__((unused))
461 #if defined(AST_DEVMODE) 467 #if defined(AST_DEVMODE) 479 if (200 <= code && code <= 299) {
483 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/modules\n", code);
491 "Internal Server Error",
"Response validation failed");
495 fin: __attribute__((unused))
512 #if defined(AST_DEVMODE) 517 for (i = path_vars; i; i = i->
next) {
518 if (strcmp(i->
name,
"moduleName") == 0) {
524 #if defined(AST_DEVMODE) 538 if (200 <= code && code <= 299) {
542 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
548 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/modules/{moduleName}\n");
550 "Internal Server Error",
"Response validation failed");
554 fin: __attribute__((unused))
571 #if defined(AST_DEVMODE) 576 for (i = path_vars; i; i = i->
next) {
577 if (strcmp(i->
name,
"moduleName") == 0) {
583 #if defined(AST_DEVMODE) 596 if (200 <= code && code <= 299) {
600 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
606 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/modules/{moduleName}\n");
608 "Internal Server Error",
"Response validation failed");
612 fin: __attribute__((unused))
629 #if defined(AST_DEVMODE) 634 for (i = path_vars; i; i = i->
next) {
635 if (strcmp(i->
name,
"moduleName") == 0) {
641 #if defined(AST_DEVMODE) 655 if (200 <= code && code <= 299) {
659 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
665 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/modules/{moduleName}\n");
667 "Internal Server Error",
"Response validation failed");
671 fin: __attribute__((unused))
688 #if defined(AST_DEVMODE) 693 for (i = path_vars; i; i = i->
next) {
694 if (strcmp(i->
name,
"moduleName") == 0) {
700 #if defined(AST_DEVMODE) 714 if (200 <= code && code <= 299) {
718 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
724 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/modules/{moduleName}\n");
726 "Internal Server Error",
"Response validation failed");
730 fin: __attribute__((unused))
746 #if defined(AST_DEVMODE) 752 #if defined(AST_DEVMODE) 764 if (200 <= code && code <= 299) {
768 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/logging\n", code);
776 "Internal Server Error",
"Response validation failed");
780 fin: __attribute__((unused))
810 #if defined(AST_DEVMODE) 815 for (i = get_params; i; i = i->
next) {
816 if (strcmp(i->
name,
"configuration") == 0) {
821 for (i = path_vars; i; i = i->
next) {
822 if (strcmp(i->
name,
"logChannelName") == 0) {
832 #if defined(AST_DEVMODE) 846 if (200 <= code && code <= 299) {
850 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/logging/{logChannelName}\n", code);
856 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/logging/{logChannelName}\n");
858 "Internal Server Error",
"Response validation failed");
862 fin: __attribute__((unused))
879 #if defined(AST_DEVMODE) 884 for (i = path_vars; i; i = i->
next) {
885 if (strcmp(i->
name,
"logChannelName") == 0) {
891 #if defined(AST_DEVMODE) 904 if (200 <= code && code <= 299) {
908 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/logging/{logChannelName}\n", code);
914 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/logging/{logChannelName}\n");
916 "Internal Server Error",
"Response validation failed");
920 fin: __attribute__((unused))
937 #if defined(AST_DEVMODE) 942 for (i = path_vars; i; i = i->
next) {
943 if (strcmp(i->
name,
"logChannelName") == 0) {
949 #if defined(AST_DEVMODE) 962 if (200 <= code && code <= 299) {
966 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/logging/{logChannelName}/rotate\n", code);
972 ast_log(
LOG_ERROR,
"Response validation failed for /asterisk/logging/{logChannelName}/rotate\n");
974 "Internal Server Error",
"Response validation failed");
978 fin: __attribute__((unused))
1008 #if defined(AST_DEVMODE) 1013 for (i = get_params; i; i = i->
next) {
1014 if (strcmp(i->
name,
"variable") == 0) {
1024 #if defined(AST_DEVMODE) 1037 if (200 <= code && code <= 299) {
1041 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/variable\n", code);
1049 "Internal Server Error",
"Response validation failed");
1053 fin: __attribute__((unused))
1087 #if defined(AST_DEVMODE) 1092 for (i = get_params; i; i = i->
next) {
1093 if (strcmp(i->
name,
"variable") == 0) {
1096 if (strcmp(i->
name,
"value") == 0) {
1106 #if defined(AST_DEVMODE) 1119 if (200 <= code && code <= 299) {
1123 ast_log(
LOG_ERROR,
"Invalid error response %d for /asterisk/variable\n", code);
1131 "Internal Server Error",
"Response validation failed");
1135 fin: __attribute__((unused))
1297 .requires =
"res_ari,res_ari_model,res_stasis",
struct ast_variable * next
int ast_ari_validate_variable(struct ast_json *json)
Validator for Variable.
static struct stasis_rest_handlers asterisk_modules_moduleName
REST handler for /api-docs/asterisk.json.
Asterisk main include file. File version handling, generic pbx functions.
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.
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.
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}.
const char * config_class
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.
static struct stasis_rest_handlers asterisk
REST handler for /api-docs/asterisk.json.
ari_validator ast_ari_validate_module_fn(void)
Function pointer to ast_ari_validate_module().
void ast_ari_asterisk_get_info(struct ast_variable *headers, struct ast_ari_asterisk_get_info_args *args, struct ast_ari_response *response)
Gets Asterisk system information.
void ast_ari_asterisk_delete_log(struct ast_variable *headers, struct ast_ari_asterisk_delete_log_args *args, struct ast_ari_response *response)
Deletes a log channel.
static int unload_module(void)
ari_validator ast_ari_validate_config_tuple_fn(void)
Function pointer to ast_ari_validate_config_tuple().
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.
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}.
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}.
static struct stasis_rest_handlers asterisk_config_dynamic
REST handler for /api-docs/asterisk.json.
int ast_ari_validate_asterisk_ping(struct ast_json *json)
Validator for AsteriskPing.
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}.
Structure for variables, used for configurations and for channel variables.
void ast_ari_asterisk_get_global_var(struct ast_variable *headers, struct ast_ari_asterisk_get_global_var_args *args, struct ast_ari_response *response)
Get the value of a global variable.
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}.
void ast_ari_asterisk_list_modules(struct ast_variable *headers, struct ast_ari_asterisk_list_modules_args *args, struct ast_ari_response *response)
List Asterisk modules.
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.
Generated file - Build validators for ARI model objects.
#define ast_strdup(str)
A wrapper for strdup()
void ast_ari_asterisk_load_module(struct ast_variable *headers, struct ast_ari_asterisk_load_module_args *args, struct ast_ari_response *response)
Load an Asterisk module.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
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}.
void ast_ari_asterisk_get_module(struct ast_variable *headers, struct ast_ari_asterisk_get_module_args *args, struct ast_ari_response *response)
Get Asterisk module information.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
static struct stasis_rest_handlers asterisk_config
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
REST handler for /api-docs/asterisk.json.
void ast_ari_asterisk_unload_module(struct ast_variable *headers, struct ast_ari_asterisk_unload_module_args *args, struct ast_ari_response *response)
Unload an Asterisk module.
static int load_module(void)
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Generated file - declares stubs to be implemented in res/ari/resource_asterisk.c. ...
#define ast_malloc(len)
A wrapper for malloc()
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.
const char * log_channel_name
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}.
describes a server instance
void ast_ari_asterisk_reload_module(struct ast_variable *headers, struct ast_ari_asterisk_reload_module_args *args, struct ast_ari_response *response)
Reload an Asterisk module.
const char * configuration
static struct stasis_rest_handlers asterisk_modules
REST handler for /api-docs/asterisk.json.
const char * log_channel_name
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
void ast_ari_asterisk_ping(struct ast_variable *headers, struct ast_ari_asterisk_ping_args *args, struct ast_ari_response *response)
Response pong message.
ari_validator ast_ari_validate_log_channel_fn(void)
Function pointer to ast_ari_validate_log_channel().
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}.
void ast_ari_asterisk_delete_object(struct ast_variable *headers, struct ast_ari_asterisk_delete_object_args *args, struct ast_ari_response *response)
Delete a dynamic configuration object.
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
void ast_ari_response_error(struct ast_ari_response *response, int response_code, const char *response_text, const char *message_fmt,...)
Fill in an error ast_ari_response.
static struct stasis_rest_handlers asterisk_variable
REST handler for /api-docs/asterisk.json.
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
Module has failed to load, may be in an inconsistent state.
void ast_ari_asterisk_add_log(struct ast_variable *headers, struct ast_ari_asterisk_add_log_args *args, struct ast_ari_response *response)
Adds a log channel.
void ast_ari_asterisk_list_log_channels(struct ast_variable *headers, struct ast_ari_asterisk_list_log_channels_args *args, struct ast_ari_response *response)
Gets Asterisk log channel information.
struct ast_json * message
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}.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
void ast_ari_asterisk_rotate_log(struct ast_variable *headers, struct ast_ari_asterisk_rotate_log_args *args, struct ast_ari_response *response)
Rotates a log channel.
static struct stasis_rest_handlers asterisk_logging
REST handler for /api-docs/asterisk.json.
static struct stasis_rest_handlers asterisk_info
REST handler for /api-docs/asterisk.json.
const char * path_segment
int ast_ari_validate_asterisk_info(struct ast_json *json)
Validator for AsteriskInfo.
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.
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.
void ast_ari_asterisk_get_object(struct ast_variable *headers, struct ast_ari_asterisk_get_object_args *args, struct ast_ari_response *response)
Retrieve a dynamic configuration object.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
const char * config_class
static struct stasis_rest_handlers asterisk_config_dynamic_configClass_objectType_id
REST handler for /api-docs/asterisk.json.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
static struct stasis_rest_handlers asterisk_ping
REST handler for /api-docs/asterisk.json.
Abstract JSON element (object, array, string, int, ...).
int ast_ari_validate_module(struct ast_json *json)
Validator for Module.
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}.
Stasis Application API. See Stasis Application API for detailed documentation.
void ast_ari_asterisk_update_object(struct ast_variable *headers, struct ast_ari_asterisk_update_object_args *args, struct ast_ari_response *response)
Create or update a dynamic configuration object.
const char * log_channel_name
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
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}.
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.
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.
#define ASTERISK_GPL_KEY
The text the key() function should return.
const char * config_class
Asterisk module definitions.
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.
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
Handler for a single RESTful path segment.
void ast_ari_asterisk_set_global_var(struct ast_variable *headers, struct ast_ari_asterisk_set_global_var_args *args, struct ast_ari_response *response)
Set the value of a global variable.
#define ast_app_separate_args(a, b, c, d)