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");
102 fin: __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");
191 fin: __attribute__((unused))
210 #if defined(AST_DEVMODE)
215 for (i = path_vars; i; i = i->
next) {
216 if (strcmp(i->
name,
"tech") == 0) {
222 #if defined(AST_DEVMODE)
235 if (200 <= code && code <= 299) {
239 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}\n", code);
247 "Internal Server Error",
"Response validation failed");
251 fin: __attribute__((unused))
270 #if defined(AST_DEVMODE)
275 for (i = path_vars; i; i = i->
next) {
276 if (strcmp(i->
name,
"tech") == 0) {
279 if (strcmp(i->
name,
"resource") == 0) {
285 #if defined(AST_DEVMODE)
299 if (200 <= code && code <= 299) {
303 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}/{resource}\n", code);
309 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/{tech}/{resource}\n");
311 "Internal Server Error",
"Response validation failed");
315 fin: __attribute__((unused))
351 #if defined(AST_DEVMODE)
356 for (i = get_params; i; i = i->
next) {
357 if (strcmp(i->
name,
"from") == 0) {
360 if (strcmp(i->
name,
"body") == 0) {
365 for (i = path_vars; i; i = i->
next) {
366 if (strcmp(i->
name,
"tech") == 0) {
369 if (strcmp(i->
name,
"resource") == 0) {
374 args.variables = body;
376 #if defined(AST_DEVMODE)
390 if (200 <= code && code <= 299) {
394 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}/{resource}/sendMessage\n", code);
400 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/{tech}/{resource}/sendMessage\n");
402 "Internal Server Error",
"Response validation failed");
406 fin: __attribute__((unused))
482 .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.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
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 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.
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.
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_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_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.
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