47#if defined(AST_DEVMODE)
68#if defined(AST_DEVMODE)
74#if defined(AST_DEVMODE)
86 if (200 <= code && code <= 299) {
98 "Internal Server Error",
"Response validation failed");
102fin: __attribute__((unused))
121#if defined(AST_DEVMODE)
126 for (i = path_vars; i; i = i->
next) {
127 if (strcmp(i->
name,
"applicationName") == 0) {
133#if defined(AST_DEVMODE)
146 if (200 <= code && code <= 299) {
150 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}\n", code);
156 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}\n");
158 "Internal Server Error",
"Response validation failed");
162fin: __attribute__((unused))
183 if (!
args->event_source) {
187 for (i = 0; i <
args->event_source_count; ++i) {
192 args->event_source_count = 1;
194 if (!
args->event_source) {
219#if defined(AST_DEVMODE)
224 for (i = get_params; i; i = i->
next) {
225 if (strcmp(i->
name,
"eventSource") == 0) {
231 if (!
args.event_source_parse) {
236 if (strlen(
args.event_source_parse) == 0) {
238 args.event_source_count = 1;
239 vals[0] =
args.event_source_parse;
242 args.event_source_parse,
',', vals,
246 if (
args.event_source_count == 0) {
254 "Too many values for event_source");
259 if (!
args.event_source) {
264 for (j = 0; j <
args.event_source_count; ++j) {
265 args.event_source[j] = (vals[j]);
270 for (i = path_vars; i; i = i->
next) {
271 if (strcmp(i->
name,
"applicationName") == 0) {
281#if defined(AST_DEVMODE)
296 if (200 <= code && code <= 299) {
300 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}/subscription\n", code);
306 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}/subscription\n");
308 "Internal Server Error",
"Response validation failed");
312fin: __attribute__((unused))
335 if (!
args->event_source) {
339 for (i = 0; i <
args->event_source_count; ++i) {
344 args->event_source_count = 1;
346 if (!
args->event_source) {
371#if defined(AST_DEVMODE)
376 for (i = get_params; i; i = i->
next) {
377 if (strcmp(i->
name,
"eventSource") == 0) {
383 if (!
args.event_source_parse) {
388 if (strlen(
args.event_source_parse) == 0) {
390 args.event_source_count = 1;
391 vals[0] =
args.event_source_parse;
394 args.event_source_parse,
',', vals,
398 if (
args.event_source_count == 0) {
406 "Too many values for event_source");
411 if (!
args.event_source) {
416 for (j = 0; j <
args.event_source_count; ++j) {
417 args.event_source[j] = (vals[j]);
422 for (i = path_vars; i; i = i->
next) {
423 if (strcmp(i->
name,
"applicationName") == 0) {
433#if defined(AST_DEVMODE)
449 if (200 <= code && code <= 299) {
453 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}/subscription\n", code);
459 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}/subscription\n");
461 "Internal Server Error",
"Response validation failed");
465fin: __attribute__((unused))
494#if defined(AST_DEVMODE)
499 for (i = path_vars; i; i = i->
next) {
500 if (strcmp(i->
name,
"applicationName") == 0) {
507#if defined(AST_DEVMODE)
521 if (200 <= code && code <= 299) {
525 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}/eventFilter\n", code);
531 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}/eventFilter\n");
533 "Internal Server Error",
"Response validation failed");
537fin: __attribute__((unused))
604 .
requires =
"res_ari,res_ari_model,res_stasis",
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)
ari_validator ast_ari_validate_application_fn(void)
Function pointer to ast_ari_validate_application().
int ast_ari_validate_application(struct ast_json *json)
Validator for Application.
Generated file - Build validators for ARI model objects.
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.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_malloc(len)
A wrapper for malloc()
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define ast_app_separate_args(a, b, c, d)
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
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.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
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.
int ast_ari_applications_filter_parse_body(struct ast_json *body, struct ast_ari_applications_filter_args *args)
Body parsing function for /applications/{applicationName}/eventFilter.
static void ast_ari_applications_unsubscribe_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 /applications/{applicationName}/subscription.
int ast_ari_applications_subscribe_parse_body(struct ast_json *body, struct ast_ari_applications_subscribe_args *args)
Body parsing function for /applications/{applicationName}/subscription.
static void ast_ari_applications_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 /applications.
static struct stasis_rest_handlers applications
REST handler for /api-docs/applications.json.
static struct stasis_rest_handlers applications_applicationName
REST handler for /api-docs/applications.json.
static void ast_ari_applications_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 /applications/{applicationName}.
static struct stasis_rest_handlers applications_applicationName_eventFilter
REST handler for /api-docs/applications.json.
int ast_ari_applications_unsubscribe_parse_body(struct ast_json *body, struct ast_ari_applications_unsubscribe_args *args)
Body parsing function for /applications/{applicationName}/subscription.
static int load_module(void)
static int unload_module(void)
static void ast_ari_applications_subscribe_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 /applications/{applicationName}/subscription.
static struct stasis_rest_handlers applications_applicationName_subscription
REST handler for /api-docs/applications.json.
static void ast_ari_applications_filter_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 /applications/{applicationName}/eventFilter.
void ast_ari_applications_subscribe(struct ast_variable *headers, struct ast_ari_applications_subscribe_args *args, struct ast_ari_response *response)
Subscribe an application to a event source.
void ast_ari_applications_get(struct ast_variable *headers, struct ast_ari_applications_get_args *args, struct ast_ari_response *response)
Get details of an application.
void ast_ari_applications_list(struct ast_variable *headers, struct ast_ari_applications_list_args *args, struct ast_ari_response *response)
List all applications.
void ast_ari_applications_filter(struct ast_variable *headers, struct ast_ari_applications_filter_args *args, struct ast_ari_response *response)
Filter application events types.
void ast_ari_applications_unsubscribe(struct ast_variable *headers, struct ast_ari_applications_unsubscribe_args *args, struct ast_ari_response *response)
Unsubscribe an application from an event source.
Generated file - declares stubs to be implemented in res/ari/resource_applications....
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