47 #if defined(AST_DEVMODE) 66 #if defined(AST_DEVMODE) 72 #if defined(AST_DEVMODE) 84 if (200 <= code && code <= 299) {
96 "Internal Server Error",
"Response validation failed");
100 fin: __attribute__((unused))
117 #if defined(AST_DEVMODE) 122 for (i = path_vars; i; i = i->
next) {
123 if (strcmp(i->
name,
"applicationName") == 0) {
129 #if defined(AST_DEVMODE) 142 if (200 <= code && code <= 299) {
146 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}\n", code);
152 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}\n");
154 "Internal Server Error",
"Response validation failed");
158 fin: __attribute__((unused))
213 #if defined(AST_DEVMODE) 218 for (i = get_params; i; i = i->
next) {
219 if (strcmp(i->
name,
"eventSource") == 0) {
248 "Too many values for event_source");
264 for (i = path_vars; i; i = i->
next) {
265 if (strcmp(i->
name,
"applicationName") == 0) {
275 #if defined(AST_DEVMODE) 290 if (200 <= code && code <= 299) {
294 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}/subscription\n", code);
300 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}/subscription\n");
302 "Internal Server Error",
"Response validation failed");
306 fin: __attribute__((unused))
363 #if defined(AST_DEVMODE) 368 for (i = get_params; i; i = i->
next) {
369 if (strcmp(i->
name,
"eventSource") == 0) {
398 "Too many values for event_source");
414 for (i = path_vars; i; i = i->
next) {
415 if (strcmp(i->
name,
"applicationName") == 0) {
425 #if defined(AST_DEVMODE) 441 if (200 <= code && code <= 299) {
445 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}/subscription\n", code);
451 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}/subscription\n");
453 "Internal Server Error",
"Response validation failed");
457 fin: __attribute__((unused))
484 #if defined(AST_DEVMODE) 489 for (i = path_vars; i; i = i->
next) {
490 if (strcmp(i->
name,
"applicationName") == 0) {
497 #if defined(AST_DEVMODE) 511 if (200 <= code && code <= 299) {
515 ast_log(
LOG_ERROR,
"Invalid error response %d for /applications/{applicationName}/eventFilter\n", code);
521 ast_log(
LOG_ERROR,
"Response validation failed for /applications/{applicationName}/eventFilter\n");
523 "Internal Server Error",
"Response validation failed");
527 fin: __attribute__((unused))
594 .requires =
"res_ari,res_ari_model,res_stasis",
struct ast_variable * next
Asterisk main include file. File version handling, generic pbx functions.
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_applicationName_eventFilter
REST handler for /api-docs/applications.json.
const char * application_name
void ast_ari_applications_list(struct ast_variable *headers, struct ast_ari_applications_list_args *args, struct ast_ari_response *response)
List all applications.
char * event_source_parse
Structure for variables, used for configurations and for channel variables.
char * event_source_parse
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.
static struct stasis_rest_handlers applications
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}.
Generated file - Build validators for ARI model objects.
#define ast_strdup(str)
A wrapper for strdup()
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
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_subscribe(struct ast_variable *headers, struct ast_ari_applications_subscribe_args *args, struct ast_ari_response *response)
Subscribe an application to a event source.
const char ** event_source
size_t event_source_count
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.
ari_validator ast_ari_validate_application_fn(void)
Function pointer to ast_ari_validate_application().
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.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
#define ast_malloc(len)
A wrapper for malloc()
describes a server instance
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.
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.
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.
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
static struct stasis_rest_handlers applications_applicationName_subscription
REST handler for /api-docs/applications.json.
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.
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.
struct ast_json * message
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",)
int ast_ari_validate_application(struct ast_json *json)
Validator for Application.
const char * application_name
const char * path_segment
static int unload_module(void)
static struct stasis_rest_handlers applications_applicationName
REST handler for /api-docs/applications.json.
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.
Abstract JSON element (object, array, string, int, ...).
Generated file - declares stubs to be implemented in res/ari/resource_applications.c.
static int load_module(void)
Stasis Application API. See Stasis Application API for detailed documentation.
const char ** event_source
const char * application_name
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
size_t event_source_count
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
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.
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_applications_filter(struct ast_variable *headers, struct ast_ari_applications_filter_args *args, struct ast_ari_response *response)
Filter application events types.
#define ast_app_separate_args(a, b, c, d)
const char * application_name