Asterisk - The Open Source Telephony Project  18.5.0
Macros | Functions | Variables
res_ari_asterisk.c File Reference

Asterisk resources. More...

#include "asterisk.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/stasis_app.h"
#include "ari/resource_asterisk.h"
#include "ari/ari_model_validators.h"
Include dependency graph for res_ari_asterisk.c:

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_moduleAST_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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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_infoast_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...
 

Detailed Description

Asterisk resources.

Author
David M. Lee, II dlee@.nosp@m.digi.nosp@m.um.co.nosp@m.m

Definition in file res_ari_asterisk.c.

Macro Definition Documentation

◆ MAX_VALS

#define MAX_VALS   128

Definition at line 51 of file res_ari_asterisk.c.

Referenced by ast_ari_asterisk_get_info_cb().

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 1298 of file res_ari_asterisk.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 1298 of file res_ari_asterisk.c.

◆ ast_ari_asterisk_add_log_cb()

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 
)
static

Parameter parsing callback for /asterisk/logging/{logChannelName}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 803 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_log, ast_ari_asterisk_add_log_args::configuration, ast_ari_asterisk_add_log_args::log_channel_name, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

807 {
809  struct ast_variable *i;
810 #if defined(AST_DEVMODE)
811  int is_valid;
812  int code;
813 #endif /* AST_DEVMODE */
814 
815  for (i = get_params; i; i = i->next) {
816  if (strcmp(i->name, "configuration") == 0) {
817  args.configuration = (i->value);
818  } else
819  {}
820  }
821  for (i = path_vars; i; i = i->next) {
822  if (strcmp(i->name, "logChannelName") == 0) {
823  args.log_channel_name = (i->value);
824  } else
825  {}
826  }
827  if (ast_ari_asterisk_add_log_parse_body(body, &args)) {
829  goto fin;
830  }
831  ast_ari_asterisk_add_log(headers, &args, response);
832 #if defined(AST_DEVMODE)
833  code = response->response_code;
834 
835  switch (code) {
836  case 0: /* Implementation is still a stub, or the code wasn't set */
837  is_valid = response->message == NULL;
838  break;
839  case 500: /* Internal Server Error */
840  case 501: /* Not Implemented */
841  case 400: /* Bad request body */
842  case 409: /* Log channel could not be created. */
843  is_valid = 1;
844  break;
845  default:
846  if (200 <= code && code <= 299) {
847  is_valid = ast_ari_validate_void(
848  response->message);
849  } else {
850  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/logging/{logChannelName}\n", code);
851  is_valid = 0;
852  }
853  }
854 
855  if (!is_valid) {
856  ast_log(LOG_ERROR, "Response validation failed for /asterisk/logging/{logChannelName}\n");
857  ast_ari_response_error(response, 500,
858  "Internal Server Error", "Response validation failed");
859  }
860 #endif /* AST_DEVMODE */
861 
862 fin: __attribute__((unused))
863  return;
864 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
Definition: res_ari.c:298
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}.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
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.
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_add_log_parse_body()

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}.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 783 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().

786 {
787  struct ast_json *field;
788  /* Parse query parameters out of it */
789  field = ast_json_object_get(body, "configuration");
790  if (field) {
791  args->configuration = ast_json_string_get(field);
792  }
793  return 0;
794 }
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
Abstract JSON element (object, array, string, int, ...).

◆ ast_ari_asterisk_delete_log_cb()

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 
)
static

Parameter parsing callback for /asterisk/logging/{logChannelName}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 872 of file res_ari_asterisk.c.

References ast_ari_asterisk_delete_log(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, ast_ari_asterisk_delete_log_args::log_channel_name, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

876 {
878  struct ast_variable *i;
879 #if defined(AST_DEVMODE)
880  int is_valid;
881  int code;
882 #endif /* AST_DEVMODE */
883 
884  for (i = path_vars; i; i = i->next) {
885  if (strcmp(i->name, "logChannelName") == 0) {
886  args.log_channel_name = (i->value);
887  } else
888  {}
889  }
890  ast_ari_asterisk_delete_log(headers, &args, response);
891 #if defined(AST_DEVMODE)
892  code = response->response_code;
893 
894  switch (code) {
895  case 0: /* Implementation is still a stub, or the code wasn't set */
896  is_valid = response->message == NULL;
897  break;
898  case 500: /* Internal Server Error */
899  case 501: /* Not Implemented */
900  case 404: /* Log channel does not exist. */
901  is_valid = 1;
902  break;
903  default:
904  if (200 <= code && code <= 299) {
905  is_valid = ast_ari_validate_void(
906  response->message);
907  } else {
908  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/logging/{logChannelName}\n", code);
909  is_valid = 0;
910  }
911  }
912 
913  if (!is_valid) {
914  ast_log(LOG_ERROR, "Response validation failed for /asterisk/logging/{logChannelName}\n");
915  ast_ari_response_error(response, 500,
916  "Internal Server Error", "Response validation failed");
917  }
918 #endif /* AST_DEVMODE */
919 
920 fin: __attribute__((unused))
921  return;
922 }
struct ast_variable * next
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.
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_delete_object_cb()

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 
)
static

Parameter parsing callback for /asterisk/config/dynamic/{configClass}/{objectType}/{id}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 199 of file res_ari_asterisk.c.

References ast_ari_asterisk_delete_object(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, ast_ari_asterisk_delete_object_args::config_class, ast_ari_asterisk_delete_object_args::id, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_asterisk_delete_object_args::object_type, ast_ari_response::response_code, and ast_variable::value.

203 {
205  struct ast_variable *i;
206 #if defined(AST_DEVMODE)
207  int is_valid;
208  int code;
209 #endif /* AST_DEVMODE */
210 
211  for (i = path_vars; i; i = i->next) {
212  if (strcmp(i->name, "configClass") == 0) {
213  args.config_class = (i->value);
214  } else
215  if (strcmp(i->name, "objectType") == 0) {
216  args.object_type = (i->value);
217  } else
218  if (strcmp(i->name, "id") == 0) {
219  args.id = (i->value);
220  } else
221  {}
222  }
223  ast_ari_asterisk_delete_object(headers, &args, response);
224 #if defined(AST_DEVMODE)
225  code = response->response_code;
226 
227  switch (code) {
228  case 0: /* Implementation is still a stub, or the code wasn't set */
229  is_valid = response->message == NULL;
230  break;
231  case 500: /* Internal Server Error */
232  case 501: /* Not Implemented */
233  case 403: /* Could not delete object */
234  case 404: /* {configClass|objectType|id} not found */
235  is_valid = 1;
236  break;
237  default:
238  if (200 <= code && code <= 299) {
239  is_valid = ast_ari_validate_void(
240  response->message);
241  } else {
242  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n", code);
243  is_valid = 0;
244  }
245  }
246 
247  if (!is_valid) {
248  ast_log(LOG_ERROR, "Response validation failed for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n");
249  ast_ari_response_error(response, 500,
250  "Internal Server Error", "Response validation failed");
251  }
252 #endif /* AST_DEVMODE */
253 
254 fin: __attribute__((unused))
255  return;
256 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_get_global_var_cb()

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 
)
static

Parameter parsing callback for /asterisk/variable.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 1001 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_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, ast_variable::value, and ast_ari_asterisk_get_global_var_args::variable.

1005 {
1007  struct ast_variable *i;
1008 #if defined(AST_DEVMODE)
1009  int is_valid;
1010  int code;
1011 #endif /* AST_DEVMODE */
1012 
1013  for (i = get_params; i; i = i->next) {
1014  if (strcmp(i->name, "variable") == 0) {
1015  args.variable = (i->value);
1016  } else
1017  {}
1018  }
1019  if (ast_ari_asterisk_get_global_var_parse_body(body, &args)) {
1021  goto fin;
1022  }
1023  ast_ari_asterisk_get_global_var(headers, &args, response);
1024 #if defined(AST_DEVMODE)
1025  code = response->response_code;
1026 
1027  switch (code) {
1028  case 0: /* Implementation is still a stub, or the code wasn't set */
1029  is_valid = response->message == NULL;
1030  break;
1031  case 500: /* Internal Server Error */
1032  case 501: /* Not Implemented */
1033  case 400: /* Missing variable parameter. */
1034  is_valid = 1;
1035  break;
1036  default:
1037  if (200 <= code && code <= 299) {
1038  is_valid = ast_ari_validate_variable(
1039  response->message);
1040  } else {
1041  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/variable\n", code);
1042  is_valid = 0;
1043  }
1044  }
1045 
1046  if (!is_valid) {
1047  ast_log(LOG_ERROR, "Response validation failed for /asterisk/variable\n");
1048  ast_ari_response_error(response, 500,
1049  "Internal Server Error", "Response validation failed");
1050  }
1051 #endif /* AST_DEVMODE */
1052 
1053 fin: __attribute__((unused))
1054  return;
1055 }
struct ast_variable * next
int ast_ari_validate_variable(struct ast_json *json)
Validator for 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.
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.
const char * args
#define NULL
Definition: resample.c:96
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
Definition: res_ari.c:298
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_get_global_var_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 981 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().

984 {
985  struct ast_json *field;
986  /* Parse query parameters out of it */
987  field = ast_json_object_get(body, "variable");
988  if (field) {
989  args->variable = ast_json_string_get(field);
990  }
991  return 0;
992 }
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
Abstract JSON element (object, array, string, int, ...).

◆ ast_ari_asterisk_get_info_cb()

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 
)
static

Parameter parsing callback for /asterisk/info.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 302 of file res_ari_asterisk.c.

References 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_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.

306 {
308  struct ast_variable *i;
309 #if defined(AST_DEVMODE)
310  int is_valid;
311  int code;
312 #endif /* AST_DEVMODE */
313 
314  for (i = get_params; i; i = i->next) {
315  if (strcmp(i->name, "only") == 0) {
316  /* Parse comma separated list */
317  char *vals[MAX_VALS];
318  size_t j;
319 
320  args.only_parse = ast_strdup(i->value);
321  if (!args.only_parse) {
323  goto fin;
324  }
325 
326  if (strlen(args.only_parse) == 0) {
327  /* ast_app_separate_args can't handle "" */
328  args.only_count = 1;
329  vals[0] = args.only_parse;
330  } else {
332  args.only_parse, ',', vals,
333  ARRAY_LEN(vals));
334  }
335 
336  if (args.only_count == 0) {
338  goto fin;
339  }
340 
341  if (args.only_count >= MAX_VALS) {
342  ast_ari_response_error(response, 400,
343  "Bad Request",
344  "Too many values for only");
345  goto fin;
346  }
347 
348  args.only = ast_malloc(sizeof(*args.only) * args.only_count);
349  if (!args.only) {
351  goto fin;
352  }
353 
354  for (j = 0; j < args.only_count; ++j) {
355  args.only[j] = (vals[j]);
356  }
357  } else
358  {}
359  }
360  if (ast_ari_asterisk_get_info_parse_body(body, &args)) {
362  goto fin;
363  }
364  ast_ari_asterisk_get_info(headers, &args, response);
365 #if defined(AST_DEVMODE)
366  code = response->response_code;
367 
368  switch (code) {
369  case 0: /* Implementation is still a stub, or the code wasn't set */
370  is_valid = response->message == NULL;
371  break;
372  case 500: /* Internal Server Error */
373  case 501: /* Not Implemented */
374  is_valid = 1;
375  break;
376  default:
377  if (200 <= code && code <= 299) {
379  response->message);
380  } else {
381  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/info\n", code);
382  is_valid = 0;
383  }
384  }
385 
386  if (!is_valid) {
387  ast_log(LOG_ERROR, "Response validation failed for /asterisk/info\n");
388  ast_ari_response_error(response, 500,
389  "Internal Server Error", "Response validation failed");
390  }
391 #endif /* AST_DEVMODE */
392 
393 fin: __attribute__((unused))
394  ast_free(args.only_parse);
395  ast_free(args.only);
396  return;
397 }
struct ast_variable * next
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
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.
Structure for variables, used for configurations and for channel variables.
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:243
const char * args
#define NULL
Definition: resample.c:96
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
Definition: res_ari.c:298
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define MAX_VALS
#define ast_malloc(len)
A wrapper for malloc()
Definition: astmm.h:193
#define LOG_ERROR
Definition: logger.h:285
#define ast_free(a)
Definition: astmm.h:182
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93
int ast_ari_validate_asterisk_info(struct ast_json *json)
Validator for AsteriskInfo.
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.
#define ast_app_separate_args(a, b, c, d)

◆ ast_ari_asterisk_get_info_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 257 of file res_ari_asterisk.c.

References ast_free, AST_JSON_ARRAY, 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().

260 {
261  struct ast_json *field;
262  /* Parse query parameters out of it */
263  field = ast_json_object_get(body, "only");
264  if (field) {
265  /* If they were silly enough to both pass in a query param and a
266  * JSON body, free up the query value.
267  */
268  ast_free(args->only);
269  if (ast_json_typeof(field) == AST_JSON_ARRAY) {
270  /* Multiple param passed as array */
271  size_t i;
272  args->only_count = ast_json_array_size(field);
273  args->only = ast_malloc(sizeof(*args->only) * args->only_count);
274 
275  if (!args->only) {
276  return -1;
277  }
278 
279  for (i = 0; i < args->only_count; ++i) {
280  args->only[i] = ast_json_string_get(ast_json_array_get(field, i));
281  }
282  } else {
283  /* Multiple param passed as single value */
284  args->only_count = 1;
285  args->only = ast_malloc(sizeof(*args->only) * args->only_count);
286  if (!args->only) {
287  return -1;
288  }
289  args->only[0] = ast_json_string_get(field);
290  }
291  }
292  return 0;
293 }
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
#define ast_malloc(len)
A wrapper for malloc()
Definition: astmm.h:193
#define ast_free(a)
Definition: astmm.h:182
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
Definition: json.c:78
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
Definition: json.c:356
Abstract JSON element (object, array, string, int, ...).
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
Definition: json.c:360

◆ ast_ari_asterisk_get_module_cb()

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 
)
static

Parameter parsing callback for /asterisk/modules/{moduleName}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 505 of file res_ari_asterisk.c.

References ast_ari_asterisk_get_module(), ast_ari_response_error(), ast_ari_validate_module(), ast_log, LOG_ERROR, ast_ari_response::message, ast_ari_asterisk_get_module_args::module_name, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

509 {
511  struct ast_variable *i;
512 #if defined(AST_DEVMODE)
513  int is_valid;
514  int code;
515 #endif /* AST_DEVMODE */
516 
517  for (i = path_vars; i; i = i->next) {
518  if (strcmp(i->name, "moduleName") == 0) {
519  args.module_name = (i->value);
520  } else
521  {}
522  }
523  ast_ari_asterisk_get_module(headers, &args, response);
524 #if defined(AST_DEVMODE)
525  code = response->response_code;
526 
527  switch (code) {
528  case 0: /* Implementation is still a stub, or the code wasn't set */
529  is_valid = response->message == NULL;
530  break;
531  case 500: /* Internal Server Error */
532  case 501: /* Not Implemented */
533  case 404: /* Module could not be found in running modules. */
534  case 409: /* Module information could not be retrieved. */
535  is_valid = 1;
536  break;
537  default:
538  if (200 <= code && code <= 299) {
539  is_valid = ast_ari_validate_module(
540  response->message);
541  } else {
542  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
543  is_valid = 0;
544  }
545  }
546 
547  if (!is_valid) {
548  ast_log(LOG_ERROR, "Response validation failed for /asterisk/modules/{moduleName}\n");
549  ast_ari_response_error(response, 500,
550  "Internal Server Error", "Response validation failed");
551  }
552 #endif /* AST_DEVMODE */
553 
554 fin: __attribute__((unused))
555  return;
556 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
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 response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93
int ast_ari_validate_module(struct ast_json *json)
Validator for Module.

◆ ast_ari_asterisk_get_object_cb()

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 
)
static

Parameter parsing callback for /asterisk/config/dynamic/{configClass}/{objectType}/{id}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 60 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_log, ast_ari_asterisk_get_object_args::config_class, ast_ari_asterisk_get_object_args::id, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_asterisk_get_object_args::object_type, ast_ari_response::response_code, and ast_variable::value.

64 {
66  struct ast_variable *i;
67 #if defined(AST_DEVMODE)
68  int is_valid;
69  int code;
70 #endif /* AST_DEVMODE */
71 
72  for (i = path_vars; i; i = i->next) {
73  if (strcmp(i->name, "configClass") == 0) {
74  args.config_class = (i->value);
75  } else
76  if (strcmp(i->name, "objectType") == 0) {
77  args.object_type = (i->value);
78  } else
79  if (strcmp(i->name, "id") == 0) {
80  args.id = (i->value);
81  } else
82  {}
83  }
84  ast_ari_asterisk_get_object(headers, &args, response);
85 #if defined(AST_DEVMODE)
86  code = response->response_code;
87 
88  switch (code) {
89  case 0: /* Implementation is still a stub, or the code wasn't set */
90  is_valid = response->message == NULL;
91  break;
92  case 500: /* Internal Server Error */
93  case 501: /* Not Implemented */
94  case 404: /* {configClass|objectType|id} not found */
95  is_valid = 1;
96  break;
97  default:
98  if (200 <= code && code <= 299) {
99  is_valid = ast_ari_validate_list(response->message,
101  } else {
102  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n", code);
103  is_valid = 0;
104  }
105  }
106 
107  if (!is_valid) {
108  ast_log(LOG_ERROR, "Response validation failed for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n");
109  ast_ari_response_error(response, 500,
110  "Internal Server Error", "Response validation failed");
111  }
112 #endif /* AST_DEVMODE */
113 
114 fin: __attribute__((unused))
115  return;
116 }
struct ast_variable * next
ari_validator ast_ari_validate_config_tuple_fn(void)
Function pointer to ast_ari_validate_config_tuple().
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93
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.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.

◆ ast_ari_asterisk_list_log_channels_cb()

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 
)
static

Parameter parsing callback for /asterisk/logging.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 740 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_log, LOG_ERROR, ast_ari_response::message, NULL, and ast_ari_response::response_code.

744 {
746 #if defined(AST_DEVMODE)
747  int is_valid;
748  int code;
749 #endif /* AST_DEVMODE */
750 
751  ast_ari_asterisk_list_log_channels(headers, &args, response);
752 #if defined(AST_DEVMODE)
753  code = response->response_code;
754 
755  switch (code) {
756  case 0: /* Implementation is still a stub, or the code wasn't set */
757  is_valid = response->message == NULL;
758  break;
759  case 500: /* Internal Server Error */
760  case 501: /* Not Implemented */
761  is_valid = 1;
762  break;
763  default:
764  if (200 <= code && code <= 299) {
765  is_valid = ast_ari_validate_list(response->message,
767  } else {
768  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/logging\n", code);
769  is_valid = 0;
770  }
771  }
772 
773  if (!is_valid) {
774  ast_log(LOG_ERROR, "Response validation failed for /asterisk/logging\n");
775  ast_ari_response_error(response, 500,
776  "Internal Server Error", "Response validation failed");
777  }
778 #endif /* AST_DEVMODE */
779 
780 fin: __attribute__((unused))
781  return;
782 }
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
ari_validator ast_ari_validate_log_channel_fn(void)
Function pointer to ast_ari_validate_log_channel().
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.
Definition: res_ari.c:259
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
Definition: ari.h:93
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.

◆ ast_ari_asterisk_list_modules_cb()

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 
)
static

Parameter parsing callback for /asterisk/modules.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 455 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_log, LOG_ERROR, ast_ari_response::message, NULL, and ast_ari_response::response_code.

459 {
461 #if defined(AST_DEVMODE)
462  int is_valid;
463  int code;
464 #endif /* AST_DEVMODE */
465 
466  ast_ari_asterisk_list_modules(headers, &args, response);
467 #if defined(AST_DEVMODE)
468  code = response->response_code;
469 
470  switch (code) {
471  case 0: /* Implementation is still a stub, or the code wasn't set */
472  is_valid = response->message == NULL;
473  break;
474  case 500: /* Internal Server Error */
475  case 501: /* Not Implemented */
476  is_valid = 1;
477  break;
478  default:
479  if (200 <= code && code <= 299) {
480  is_valid = ast_ari_validate_list(response->message,
482  } else {
483  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/modules\n", code);
484  is_valid = 0;
485  }
486  }
487 
488  if (!is_valid) {
489  ast_log(LOG_ERROR, "Response validation failed for /asterisk/modules\n");
490  ast_ari_response_error(response, 500,
491  "Internal Server Error", "Response validation failed");
492  }
493 #endif /* AST_DEVMODE */
494 
495 fin: __attribute__((unused))
496  return;
497 }
ari_validator ast_ari_validate_module_fn(void)
Function pointer to ast_ari_validate_module().
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.
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.

◆ ast_ari_asterisk_load_module_cb()

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 
)
static

Parameter parsing callback for /asterisk/modules/{moduleName}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 564 of file res_ari_asterisk.c.

References ast_ari_asterisk_load_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_ari_asterisk_load_module_args::module_name, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

568 {
570  struct ast_variable *i;
571 #if defined(AST_DEVMODE)
572  int is_valid;
573  int code;
574 #endif /* AST_DEVMODE */
575 
576  for (i = path_vars; i; i = i->next) {
577  if (strcmp(i->name, "moduleName") == 0) {
578  args.module_name = (i->value);
579  } else
580  {}
581  }
582  ast_ari_asterisk_load_module(headers, &args, response);
583 #if defined(AST_DEVMODE)
584  code = response->response_code;
585 
586  switch (code) {
587  case 0: /* Implementation is still a stub, or the code wasn't set */
588  is_valid = response->message == NULL;
589  break;
590  case 500: /* Internal Server Error */
591  case 501: /* Not Implemented */
592  case 409: /* Module could not be loaded. */
593  is_valid = 1;
594  break;
595  default:
596  if (200 <= code && code <= 299) {
597  is_valid = ast_ari_validate_void(
598  response->message);
599  } else {
600  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
601  is_valid = 0;
602  }
603  }
604 
605  if (!is_valid) {
606  ast_log(LOG_ERROR, "Response validation failed for /asterisk/modules/{moduleName}\n");
607  ast_ari_response_error(response, 500,
608  "Internal Server Error", "Response validation failed");
609  }
610 #endif /* AST_DEVMODE */
611 
612 fin: __attribute__((unused))
613  return;
614 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
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.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_ping_cb()

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 
)
static

Parameter parsing callback for /asterisk/ping.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 405 of file res_ari_asterisk.c.

References 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.

409 {
410  struct ast_ari_asterisk_ping_args args = {};
411 #if defined(AST_DEVMODE)
412  int is_valid;
413  int code;
414 #endif /* AST_DEVMODE */
415 
416  ast_ari_asterisk_ping(headers, &args, response);
417 #if defined(AST_DEVMODE)
418  code = response->response_code;
419 
420  switch (code) {
421  case 0: /* Implementation is still a stub, or the code wasn't set */
422  is_valid = response->message == NULL;
423  break;
424  case 500: /* Internal Server Error */
425  case 501: /* Not Implemented */
426  is_valid = 1;
427  break;
428  default:
429  if (200 <= code && code <= 299) {
431  response->message);
432  } else {
433  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/ping\n", code);
434  is_valid = 0;
435  }
436  }
437 
438  if (!is_valid) {
439  ast_log(LOG_ERROR, "Response validation failed for /asterisk/ping\n");
440  ast_ari_response_error(response, 500,
441  "Internal Server Error", "Response validation failed");
442  }
443 #endif /* AST_DEVMODE */
444 
445 fin: __attribute__((unused))
446  return;
447 }
int ast_ari_validate_asterisk_ping(struct ast_json *json)
Validator for AsteriskPing.
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
void ast_ari_asterisk_ping(struct ast_variable *headers, struct ast_ari_asterisk_ping_args *args, struct ast_ari_response *response)
Response pong message.
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_reload_module_cb()

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 
)
static

Parameter parsing callback for /asterisk/modules/{moduleName}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 681 of file res_ari_asterisk.c.

References ast_ari_asterisk_reload_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_ari_asterisk_reload_module_args::module_name, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

685 {
687  struct ast_variable *i;
688 #if defined(AST_DEVMODE)
689  int is_valid;
690  int code;
691 #endif /* AST_DEVMODE */
692 
693  for (i = path_vars; i; i = i->next) {
694  if (strcmp(i->name, "moduleName") == 0) {
695  args.module_name = (i->value);
696  } else
697  {}
698  }
699  ast_ari_asterisk_reload_module(headers, &args, response);
700 #if defined(AST_DEVMODE)
701  code = response->response_code;
702 
703  switch (code) {
704  case 0: /* Implementation is still a stub, or the code wasn't set */
705  is_valid = response->message == NULL;
706  break;
707  case 500: /* Internal Server Error */
708  case 501: /* Not Implemented */
709  case 404: /* Module not found in running modules. */
710  case 409: /* Module could not be reloaded. */
711  is_valid = 1;
712  break;
713  default:
714  if (200 <= code && code <= 299) {
715  is_valid = ast_ari_validate_void(
716  response->message);
717  } else {
718  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
719  is_valid = 0;
720  }
721  }
722 
723  if (!is_valid) {
724  ast_log(LOG_ERROR, "Response validation failed for /asterisk/modules/{moduleName}\n");
725  ast_ari_response_error(response, 500,
726  "Internal Server Error", "Response validation failed");
727  }
728 #endif /* AST_DEVMODE */
729 
730 fin: __attribute__((unused))
731  return;
732 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
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.
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_rotate_log_cb()

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 
)
static

Parameter parsing callback for /asterisk/logging/{logChannelName}/rotate.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 930 of file res_ari_asterisk.c.

References ast_ari_asterisk_rotate_log(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, ast_ari_asterisk_rotate_log_args::log_channel_name, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

934 {
936  struct ast_variable *i;
937 #if defined(AST_DEVMODE)
938  int is_valid;
939  int code;
940 #endif /* AST_DEVMODE */
941 
942  for (i = path_vars; i; i = i->next) {
943  if (strcmp(i->name, "logChannelName") == 0) {
944  args.log_channel_name = (i->value);
945  } else
946  {}
947  }
948  ast_ari_asterisk_rotate_log(headers, &args, response);
949 #if defined(AST_DEVMODE)
950  code = response->response_code;
951 
952  switch (code) {
953  case 0: /* Implementation is still a stub, or the code wasn't set */
954  is_valid = response->message == NULL;
955  break;
956  case 500: /* Internal Server Error */
957  case 501: /* Not Implemented */
958  case 404: /* Log channel does not exist. */
959  is_valid = 1;
960  break;
961  default:
962  if (200 <= code && code <= 299) {
963  is_valid = ast_ari_validate_void(
964  response->message);
965  } else {
966  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/logging/{logChannelName}/rotate\n", code);
967  is_valid = 0;
968  }
969  }
970 
971  if (!is_valid) {
972  ast_log(LOG_ERROR, "Response validation failed for /asterisk/logging/{logChannelName}/rotate\n");
973  ast_ari_response_error(response, 500,
974  "Internal Server Error", "Response validation failed");
975  }
976 #endif /* AST_DEVMODE */
977 
978 fin: __attribute__((unused))
979  return;
980 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93
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.

◆ ast_ari_asterisk_set_global_var_cb()

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 
)
static

Parameter parsing callback for /asterisk/variable.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 1080 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_log, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, 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.

1084 {
1086  struct ast_variable *i;
1087 #if defined(AST_DEVMODE)
1088  int is_valid;
1089  int code;
1090 #endif /* AST_DEVMODE */
1091 
1092  for (i = get_params; i; i = i->next) {
1093  if (strcmp(i->name, "variable") == 0) {
1094  args.variable = (i->value);
1095  } else
1096  if (strcmp(i->name, "value") == 0) {
1097  args.value = (i->value);
1098  } else
1099  {}
1100  }
1101  if (ast_ari_asterisk_set_global_var_parse_body(body, &args)) {
1103  goto fin;
1104  }
1105  ast_ari_asterisk_set_global_var(headers, &args, response);
1106 #if defined(AST_DEVMODE)
1107  code = response->response_code;
1108 
1109  switch (code) {
1110  case 0: /* Implementation is still a stub, or the code wasn't set */
1111  is_valid = response->message == NULL;
1112  break;
1113  case 500: /* Internal Server Error */
1114  case 501: /* Not Implemented */
1115  case 400: /* Missing variable parameter. */
1116  is_valid = 1;
1117  break;
1118  default:
1119  if (200 <= code && code <= 299) {
1120  is_valid = ast_ari_validate_void(
1121  response->message);
1122  } else {
1123  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/variable\n", code);
1124  is_valid = 0;
1125  }
1126  }
1127 
1128  if (!is_valid) {
1129  ast_log(LOG_ERROR, "Response validation failed for /asterisk/variable\n");
1130  ast_ari_response_error(response, 500,
1131  "Internal Server Error", "Response validation failed");
1132  }
1133 #endif /* AST_DEVMODE */
1134 
1135 fin: __attribute__((unused))
1136  return;
1137 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
Definition: res_ari.c:298
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93
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.
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.

◆ ast_ari_asterisk_set_global_var_parse_body()

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.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 1056 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().

1059 {
1060  struct ast_json *field;
1061  /* Parse query parameters out of it */
1062  field = ast_json_object_get(body, "variable");
1063  if (field) {
1064  args->variable = ast_json_string_get(field);
1065  }
1066  field = ast_json_object_get(body, "value");
1067  if (field) {
1068  args->value = ast_json_string_get(field);
1069  }
1070  return 0;
1071 }
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
Abstract JSON element (object, array, string, int, ...).

◆ ast_ari_asterisk_unload_module_cb()

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 
)
static

Parameter parsing callback for /asterisk/modules/{moduleName}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 622 of file res_ari_asterisk.c.

References ast_ari_asterisk_unload_module(), ast_ari_response_error(), ast_ari_validate_void(), ast_log, LOG_ERROR, ast_ari_response::message, ast_ari_asterisk_unload_module_args::module_name, ast_variable::name, ast_variable::next, NULL, ast_ari_response::response_code, and ast_variable::value.

626 {
628  struct ast_variable *i;
629 #if defined(AST_DEVMODE)
630  int is_valid;
631  int code;
632 #endif /* AST_DEVMODE */
633 
634  for (i = path_vars; i; i = i->next) {
635  if (strcmp(i->name, "moduleName") == 0) {
636  args.module_name = (i->value);
637  } else
638  {}
639  }
640  ast_ari_asterisk_unload_module(headers, &args, response);
641 #if defined(AST_DEVMODE)
642  code = response->response_code;
643 
644  switch (code) {
645  case 0: /* Implementation is still a stub, or the code wasn't set */
646  is_valid = response->message == NULL;
647  break;
648  case 500: /* Internal Server Error */
649  case 501: /* Not Implemented */
650  case 404: /* Module not found in running modules. */
651  case 409: /* Module could not be unloaded. */
652  is_valid = 1;
653  break;
654  default:
655  if (200 <= code && code <= 299) {
656  is_valid = ast_ari_validate_void(
657  response->message);
658  } else {
659  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/modules/{moduleName}\n", code);
660  is_valid = 0;
661  }
662  }
663 
664  if (!is_valid) {
665  ast_log(LOG_ERROR, "Response validation failed for /asterisk/modules/{moduleName}\n");
666  ast_ari_response_error(response, 500,
667  "Internal Server Error", "Response validation failed");
668  }
669 #endif /* AST_DEVMODE */
670 
671 fin: __attribute__((unused))
672  return;
673 }
struct ast_variable * next
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
Definition: res_ari_model.c:91
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
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.
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93

◆ ast_ari_asterisk_update_object_cb()

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 
)
static

Parameter parsing callback for /asterisk/config/dynamic/{configClass}/{objectType}/{id}.

Parameters
get_paramsGET parameters in the HTTP request.
path_varsPath variables extracted from the request.
headersHTTP headers.
[out]responseResponse to the HTTP request.

Definition at line 132 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_log, ast_ari_asterisk_update_object_args::config_class, ast_ari_asterisk_update_object_args::fields, ast_ari_asterisk_update_object_args::id, LOG_ERROR, ast_ari_response::message, ast_variable::name, ast_variable::next, NULL, ast_ari_asterisk_update_object_args::object_type, ast_ari_response::response_code, and ast_variable::value.

136 {
138  struct ast_variable *i;
139 #if defined(AST_DEVMODE)
140  int is_valid;
141  int code;
142 #endif /* AST_DEVMODE */
143 
144  for (i = path_vars; i; i = i->next) {
145  if (strcmp(i->name, "configClass") == 0) {
146  args.config_class = (i->value);
147  } else
148  if (strcmp(i->name, "objectType") == 0) {
149  args.object_type = (i->value);
150  } else
151  if (strcmp(i->name, "id") == 0) {
152  args.id = (i->value);
153  } else
154  {}
155  }
156  args.fields = body;
157  ast_ari_asterisk_update_object(headers, &args, response);
158 #if defined(AST_DEVMODE)
159  code = response->response_code;
160 
161  switch (code) {
162  case 0: /* Implementation is still a stub, or the code wasn't set */
163  is_valid = response->message == NULL;
164  break;
165  case 500: /* Internal Server Error */
166  case 501: /* Not Implemented */
167  case 400: /* Bad request body */
168  case 403: /* Could not create or update object */
169  case 404: /* {configClass|objectType} not found */
170  is_valid = 1;
171  break;
172  default:
173  if (200 <= code && code <= 299) {
174  is_valid = ast_ari_validate_list(response->message,
176  } else {
177  ast_log(LOG_ERROR, "Invalid error response %d for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n", code);
178  is_valid = 0;
179  }
180  }
181 
182  if (!is_valid) {
183  ast_log(LOG_ERROR, "Response validation failed for /asterisk/config/dynamic/{configClass}/{objectType}/{id}\n");
184  ast_ari_response_error(response, 500,
185  "Internal Server Error", "Response validation failed");
186  }
187 #endif /* AST_DEVMODE */
188 
189 fin: __attribute__((unused))
190  return;
191 }
struct ast_variable * next
ari_validator ast_ari_validate_config_tuple_fn(void)
Function pointer to ast_ari_validate_config_tuple().
Structure for variables, used for configurations and for channel variables.
const char * args
#define NULL
Definition: resample.c:96
int response_code
Definition: ari.h:98
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
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.
Definition: res_ari.c:259
struct ast_json * message
Definition: ari.h:93
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.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.

◆ ast_ari_asterisk_update_object_parse_body()

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}.

Parameters
bodyThe JSON body from which to parse parameters.
[out]argsThe args structure to parse into.
Return values
zeroon success
non-zeroon failure

Definition at line 117 of file res_ari_asterisk.c.

120 {
121  /* Parse query parameters out of it */
122  return 0;
123 }

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 1298 of file res_ari_asterisk.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 1279 of file res_ari_asterisk.c.

References ast_ari_add_handler(), AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, and unload_module().

1280 {
1281  int res = 0;
1282 
1283 
1284  res |= ast_ari_add_handler(&asterisk);
1285  if (res) {
1286  unload_module();
1287  return AST_MODULE_LOAD_DECLINE;
1288  }
1289 
1290  return AST_MODULE_LOAD_SUCCESS;
1291 }
static struct stasis_rest_handlers asterisk
REST handler for /api-docs/asterisk.json.
static int unload_module(void)
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:179
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 1273 of file res_ari_asterisk.c.

References ast_ari_remove_handler().

Referenced by load_module().

1274 {
1276  return 0;
1277 }
static struct stasis_rest_handlers asterisk
REST handler for /api-docs/asterisk.json.
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
Definition: res_ari.c:202

Variable Documentation

◆ __mod_info

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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_ari,res_ari_model,res_stasis", }
static

Definition at line 1298 of file res_ari_asterisk.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 1298 of file res_ari_asterisk.c.

◆ asterisk

struct stasis_rest_handlers asterisk
static

REST handler for /api-docs/asterisk.json.

Definition at line 1265 of file res_ari_asterisk.c.

◆ asterisk_config

struct stasis_rest_handlers asterisk_config
static

REST handler for /api-docs/asterisk.json.

Definition at line 1178 of file res_ari_asterisk.c.

◆ asterisk_config_dynamic

struct stasis_rest_handlers asterisk_config_dynamic
static

REST handler for /api-docs/asterisk.json.

Definition at line 1170 of file res_ari_asterisk.c.

◆ asterisk_config_dynamic_configClass

struct stasis_rest_handlers asterisk_config_dynamic_configClass
static

REST handler for /api-docs/asterisk.json.

Definition at line 1161 of file res_ari_asterisk.c.

◆ asterisk_config_dynamic_configClass_objectType

struct stasis_rest_handlers asterisk_config_dynamic_configClass_objectType
static

REST handler for /api-docs/asterisk.json.

Definition at line 1152 of file res_ari_asterisk.c.

◆ asterisk_config_dynamic_configClass_objectType_id

struct stasis_rest_handlers asterisk_config_dynamic_configClass_objectType_id
static

REST handler for /api-docs/asterisk.json.

Definition at line 1140 of file res_ari_asterisk.c.

◆ asterisk_info

struct stasis_rest_handlers asterisk_info
static

REST handler for /api-docs/asterisk.json.

Definition at line 1186 of file res_ari_asterisk.c.

◆ asterisk_logging

struct stasis_rest_handlers asterisk_logging
static

REST handler for /api-docs/asterisk.json.

Definition at line 1246 of file res_ari_asterisk.c.

◆ asterisk_logging_logChannelName

struct stasis_rest_handlers asterisk_logging_logChannelName
static

REST handler for /api-docs/asterisk.json.

Definition at line 1235 of file res_ari_asterisk.c.

◆ asterisk_logging_logChannelName_rotate

struct stasis_rest_handlers asterisk_logging_logChannelName_rotate
static

REST handler for /api-docs/asterisk.json.

Definition at line 1226 of file res_ari_asterisk.c.

◆ asterisk_modules

struct stasis_rest_handlers asterisk_modules
static

REST handler for /api-docs/asterisk.json.

Definition at line 1217 of file res_ari_asterisk.c.

◆ asterisk_modules_moduleName

struct stasis_rest_handlers asterisk_modules_moduleName
static

REST handler for /api-docs/asterisk.json.

Definition at line 1204 of file res_ari_asterisk.c.

◆ asterisk_ping

struct stasis_rest_handlers asterisk_ping
static

REST handler for /api-docs/asterisk.json.

Definition at line 1195 of file res_ari_asterisk.c.

◆ asterisk_variable

struct stasis_rest_handlers asterisk_variable
static

REST handler for /api-docs/asterisk.json.

Definition at line 1255 of file res_ari_asterisk.c.