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))
142#if defined(AST_DEVMODE)
147 for (i = get_params; i; i = i->
next) {
148 if (strcmp(i->
name,
"to") == 0) {
151 if (strcmp(i->
name,
"from") == 0) {
154 if (strcmp(i->
name,
"body") == 0) {
159 args.variables = body;
161#if defined(AST_DEVMODE)
175 if (200 <= code && code <= 299) {
179 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/sendMessage\n", code);
185 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/sendMessage\n");
187 "Internal Server Error",
"Response validation failed");
191fin: __attribute__((unused))
235#if defined(AST_DEVMODE)
240 for (i = get_params; i; i = i->
next) {
241 if (strcmp(i->
name,
"to") == 0) {
244 if (strcmp(i->
name,
"from") == 0) {
247 if (strcmp(i->
name,
"refer_to") == 0) {
250 if (strcmp(i->
name,
"to_self") == 0) {
255 args.variables = body;
257#if defined(AST_DEVMODE)
271 if (200 <= code && code <= 299) {
275 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/refer\n", code);
283 "Internal Server Error",
"Response validation failed");
287fin: __attribute__((unused))
306#if defined(AST_DEVMODE)
311 for (i = path_vars; i; i = i->
next) {
312 if (strcmp(i->
name,
"tech") == 0) {
318#if defined(AST_DEVMODE)
331 if (200 <= code && code <= 299) {
335 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}\n", code);
343 "Internal Server Error",
"Response validation failed");
347fin: __attribute__((unused))
366#if defined(AST_DEVMODE)
371 for (i = path_vars; i; i = i->
next) {
372 if (strcmp(i->
name,
"tech") == 0) {
375 if (strcmp(i->
name,
"resource") == 0) {
381#if defined(AST_DEVMODE)
395 if (200 <= code && code <= 299) {
399 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}/{resource}\n", code);
405 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/{tech}/{resource}\n");
407 "Internal Server Error",
"Response validation failed");
411fin: __attribute__((unused))
447#if defined(AST_DEVMODE)
452 for (i = get_params; i; i = i->
next) {
453 if (strcmp(i->
name,
"from") == 0) {
456 if (strcmp(i->
name,
"body") == 0) {
461 for (i = path_vars; i; i = i->
next) {
462 if (strcmp(i->
name,
"tech") == 0) {
465 if (strcmp(i->
name,
"resource") == 0) {
470 args.variables = body;
472#if defined(AST_DEVMODE)
486 if (200 <= code && code <= 299) {
490 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}/{resource}/sendMessage\n", code);
496 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/{tech}/{resource}/sendMessage\n");
498 "Internal Server Error",
"Response validation failed");
502fin: __attribute__((unused))
542#if defined(AST_DEVMODE)
547 for (i = get_params; i; i = i->
next) {
548 if (strcmp(i->
name,
"from") == 0) {
551 if (strcmp(i->
name,
"refer_to") == 0) {
554 if (strcmp(i->
name,
"to_self") == 0) {
559 for (i = path_vars; i; i = i->
next) {
560 if (strcmp(i->
name,
"tech") == 0) {
563 if (strcmp(i->
name,
"resource") == 0) {
568 args.variables = body;
570#if defined(AST_DEVMODE)
584 if (200 <= code && code <= 299) {
588 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}/{resource}/refer\n", code);
594 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/{tech}/{resource}/refer\n");
596 "Internal Server Error",
"Response validation failed");
600fin: __attribute__((unused))
694 .
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.
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
int ast_ari_validate_endpoint(struct ast_json *json)
Validator for Endpoint.
ari_validator ast_ari_validate_endpoint_fn(void)
Function pointer to ast_ari_validate_endpoint().
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.
int ast_json_is_true(const struct ast_json *value)
Check if value is JSON true.
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_endpoints_send_message_parse_body(struct ast_json *body, struct ast_ari_endpoints_send_message_args *args)
Body parsing function for /endpoints/sendMessage.
static struct stasis_rest_handlers endpoints_tech_resource_refer
REST handler for /api-docs/endpoints.json.
int ast_ari_endpoints_refer_to_endpoint_parse_body(struct ast_json *body, struct ast_ari_endpoints_refer_to_endpoint_args *args)
Body parsing function for /endpoints/{tech}/{resource}/refer.
static void ast_ari_endpoints_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 /endpoints.
static struct stasis_rest_handlers endpoints_tech_resource_sendMessage
REST handler for /api-docs/endpoints.json.
static void ast_ari_endpoints_refer_to_endpoint_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 /endpoints/{tech}/{resource}/refer.
static void ast_ari_endpoints_refer_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 /endpoints/refer.
int ast_ari_endpoints_send_message_to_endpoint_parse_body(struct ast_json *body, struct ast_ari_endpoints_send_message_to_endpoint_args *args)
Body parsing function for /endpoints/{tech}/{resource}/sendMessage.
static void ast_ari_endpoints_list_by_tech_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 /endpoints/{tech}.
static struct stasis_rest_handlers endpoints_sendMessage
REST handler for /api-docs/endpoints.json.
static struct stasis_rest_handlers endpoints
REST handler for /api-docs/endpoints.json.
static void ast_ari_endpoints_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 /endpoints/{tech}/{resource}.
static void ast_ari_endpoints_send_message_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 /endpoints/sendMessage.
int ast_ari_endpoints_refer_parse_body(struct ast_json *body, struct ast_ari_endpoints_refer_args *args)
Body parsing function for /endpoints/refer.
static struct stasis_rest_handlers endpoints_refer
REST handler for /api-docs/endpoints.json.
static struct stasis_rest_handlers endpoints_tech
REST handler for /api-docs/endpoints.json.
static int load_module(void)
static int unload_module(void)
static void ast_ari_endpoints_send_message_to_endpoint_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 /endpoints/{tech}/{resource}/sendMessage.
static struct stasis_rest_handlers endpoints_tech_resource
REST handler for /api-docs/endpoints.json.
void ast_ari_endpoints_refer(struct ast_variable *headers, struct ast_ari_endpoints_refer_args *args, struct ast_ari_response *response)
Refer an endpoint or technology URI to some technology URI or endpoint.
void ast_ari_endpoints_send_message(struct ast_variable *headers, struct ast_ari_endpoints_send_message_args *args, struct ast_ari_response *response)
Send a message to some technology URI or endpoint.
void ast_ari_endpoints_list_by_tech(struct ast_variable *headers, struct ast_ari_endpoints_list_by_tech_args *args, struct ast_ari_response *response)
List available endoints for a given endpoint technology.
void ast_ari_endpoints_send_message_to_endpoint(struct ast_variable *headers, struct ast_ari_endpoints_send_message_to_endpoint_args *args, struct ast_ari_response *response)
Send a message to some endpoint in a technology.
void ast_ari_endpoints_refer_to_endpoint(struct ast_variable *headers, struct ast_ari_endpoints_refer_to_endpoint_args *args, struct ast_ari_response *response)
Refer an endpoint or technology URI to some technology URI or endpoint.
void ast_ari_endpoints_get(struct ast_variable *headers, struct ast_ari_endpoints_get_args *args, struct ast_ari_response *response)
Details for an endpoint.
void ast_ari_endpoints_list(struct ast_variable *headers, struct ast_ari_endpoints_list_args *args, struct ast_ari_response *response)
List all endpoints.
Generated file - declares stubs to be implemented in res/ari/resource_endpoints.c.
Stasis Application API. See Stasis Application API for detailed documentation.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
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