48#if defined(AST_DEVMODE)
80 for (i = 0; i <
args->source_count; ++i) {
85 args->source_count = 1;
112#if defined(AST_DEVMODE)
117 for (i = get_params; i; i = i->
next) {
118 if (strcmp(i->
name,
"application") == 0) {
121 if (strcmp(i->
name,
"source") == 0) {
127 if (!
args.source_parse) {
132 if (strlen(
args.source_parse) == 0) {
134 args.source_count = 1;
135 vals[0] =
args.source_parse;
138 args.source_parse,
',', vals,
142 if (
args.source_count == 0) {
150 "Too many values for source");
160 for (j = 0; j <
args.source_count; ++j) {
161 args.source[j] = (vals[j]);
166 for (i = path_vars; i; i = i->
next) {
167 if (strcmp(i->
name,
"eventName") == 0) {
172 args.variables = body;
174#if defined(AST_DEVMODE)
189 if (200 <= code && code <= 299) {
193 ast_log(
LOG_ERROR,
"Invalid error response %d for /events/user/{eventName}\n", code);
199 ast_log(
LOG_ERROR,
"Response validation failed for /events/user/{eventName}\n");
201 "Internal Server Error",
"Response validation failed");
205fin: __attribute__((unused))
263 .
requires =
"res_ari,res_ari_model,res_stasis,res_http_websocket",
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)
Generated file - Build validators for ARI model objects.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
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_events_user_event_parse_body(struct ast_json *body, struct ast_ari_events_user_event_args *args)
Body parsing function for /events/user/{eventName}.
static struct stasis_rest_handlers events
REST handler for /api-docs/events.json.
static struct stasis_rest_handlers events_user_eventName
REST handler for /api-docs/events.json.
static struct stasis_rest_handlers events_user
REST handler for /api-docs/events.json.
static void ast_ari_events_user_event_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 /events/user/{eventName}.
static int load_module(void)
static int unload_module(void)
void ast_ari_events_user_event(struct ast_variable *headers, struct ast_ari_events_user_event_args *args, struct ast_ari_response *response)
Generate a user event.
Generated file - declares stubs to be implemented in res/ari/resource_events.c.
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