48#if defined(AST_DEVMODE)
69#if defined(AST_DEVMODE)
75#if defined(AST_DEVMODE)
87 if (200 <= code && code <= 299) {
99 "Internal Server Error",
"Response validation failed");
103fin: __attribute__((unused))
122#if defined(AST_DEVMODE)
127 for (i = path_vars; i; i = i->
next) {
128 if (strcmp(i->
name,
"deviceName") == 0) {
134#if defined(AST_DEVMODE)
146 if (200 <= code && code <= 299) {
150 ast_log(
LOG_ERROR,
"Invalid error response %d for /deviceStates/{deviceName}\n", code);
156 ast_log(
LOG_ERROR,
"Response validation failed for /deviceStates/{deviceName}\n");
158 "Internal Server Error",
"Response validation failed");
162fin: __attribute__((unused))
194#if defined(AST_DEVMODE)
199 for (i = get_params; i; i = i->
next) {
200 if (strcmp(i->
name,
"deviceState") == 0) {
205 for (i = path_vars; i; i = i->
next) {
206 if (strcmp(i->
name,
"deviceName") == 0) {
216#if defined(AST_DEVMODE)
230 if (200 <= code && code <= 299) {
234 ast_log(
LOG_ERROR,
"Invalid error response %d for /deviceStates/{deviceName}\n", code);
240 ast_log(
LOG_ERROR,
"Response validation failed for /deviceStates/{deviceName}\n");
242 "Internal Server Error",
"Response validation failed");
246fin: __attribute__((unused))
265#if defined(AST_DEVMODE)
270 for (i = path_vars; i; i = i->
next) {
271 if (strcmp(i->
name,
"deviceName") == 0) {
277#if defined(AST_DEVMODE)
291 if (200 <= code && code <= 299) {
295 ast_log(
LOG_ERROR,
"Invalid error response %d for /deviceStates/{deviceName}\n", code);
301 ast_log(
LOG_ERROR,
"Response validation failed for /deviceStates/{deviceName}\n");
303 "Internal Server Error",
"Response validation failed");
307fin: __attribute__((unused))
357 .
requires =
"res_ari,res_ari_model,res_stasis,res_stasis_device_state",
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.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
int ast_ari_validate_device_state(struct ast_json *json)
Validator for DeviceState.
ari_validator ast_ari_validate_device_state_fn(void)
Function pointer to ast_ari_validate_device_state().
Generated file - Build validators for ARI model objects.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
Asterisk main include file. File version handling, generic pbx functions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
static void ast_ari_device_states_get_cb(struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
Parameter parsing callback for /deviceStates/{deviceName}.
int ast_ari_device_states_update_parse_body(struct ast_json *body, struct ast_ari_device_states_update_args *args)
Body parsing function for /deviceStates/{deviceName}.
static struct stasis_rest_handlers deviceStates_deviceName
REST handler for /api-docs/deviceStates.json.
static void ast_ari_device_states_list_cb(struct ast_tcptls_session_instance *ser, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, struct ast_json *body, struct ast_ari_response *response)
Parameter parsing callback for /deviceStates.
static struct stasis_rest_handlers deviceStates
REST handler for /api-docs/deviceStates.json.
static int load_module(void)
static int unload_module(void)
static void ast_ari_device_states_delete_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 /deviceStates/{deviceName}.
static void ast_ari_device_states_update_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 /deviceStates/{deviceName}.
void ast_ari_device_states_update(struct ast_variable *headers, struct ast_ari_device_states_update_args *args, struct ast_ari_response *response)
Change the state of a device controlled by ARI. (Note - implicitly creates the device state).
void ast_ari_device_states_delete(struct ast_variable *headers, struct ast_ari_device_states_delete_args *args, struct ast_ari_response *response)
Destroy a device-state controlled by ARI.
void ast_ari_device_states_list(struct ast_variable *headers, struct ast_ari_device_states_list_args *args, struct ast_ari_response *response)
List all ARI controlled device states.
void ast_ari_device_states_get(struct ast_variable *headers, struct ast_ari_device_states_get_args *args, struct ast_ari_response *response)
Retrieve the current state of a device.
Generated file - declares stubs to be implemented in res/ari/resource_deviceStates....
Stasis Application API. See Stasis Application API for detailed documentation.
struct ast_json * message
Abstract JSON element (object, array, string, int, ...).
describes a server instance
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
Handler for a single RESTful path segment.
const char * path_segment