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))
138 #if defined(AST_DEVMODE) 143 for (i = get_params; i; i = i->
next) {
144 if (strcmp(i->
name,
"to") == 0) {
147 if (strcmp(i->
name,
"from") == 0) {
150 if (strcmp(i->
name,
"body") == 0) {
157 #if defined(AST_DEVMODE) 171 if (200 <= code && code <= 299) {
175 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/sendMessage\n", code);
181 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/sendMessage\n");
183 "Internal Server Error",
"Response validation failed");
187 fin: __attribute__((unused))
204 #if defined(AST_DEVMODE) 209 for (i = path_vars; i; i = i->
next) {
210 if (strcmp(i->
name,
"tech") == 0) {
216 #if defined(AST_DEVMODE) 229 if (200 <= code && code <= 299) {
233 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}\n", code);
241 "Internal Server Error",
"Response validation failed");
245 fin: __attribute__((unused))
262 #if defined(AST_DEVMODE) 267 for (i = path_vars; i; i = i->
next) {
268 if (strcmp(i->
name,
"tech") == 0) {
271 if (strcmp(i->
name,
"resource") == 0) {
277 #if defined(AST_DEVMODE) 291 if (200 <= code && code <= 299) {
295 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}/{resource}\n", code);
301 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/{tech}/{resource}\n");
303 "Internal Server Error",
"Response validation failed");
307 fin: __attribute__((unused))
341 #if defined(AST_DEVMODE) 346 for (i = get_params; i; i = i->
next) {
347 if (strcmp(i->
name,
"from") == 0) {
350 if (strcmp(i->
name,
"body") == 0) {
355 for (i = path_vars; i; i = i->
next) {
356 if (strcmp(i->
name,
"tech") == 0) {
359 if (strcmp(i->
name,
"resource") == 0) {
366 #if defined(AST_DEVMODE) 380 if (200 <= code && code <= 299) {
384 ast_log(
LOG_ERROR,
"Invalid error response %d for /endpoints/{tech}/{resource}/sendMessage\n", code);
390 ast_log(
LOG_ERROR,
"Response validation failed for /endpoints/{tech}/{resource}/sendMessage\n");
392 "Internal Server Error",
"Response validation failed");
396 fin: __attribute__((unused))
472 .requires =
"res_ari,res_ari_model,res_stasis",
static int unload_module(void)
struct ast_json * variables
struct ast_variable * next
Asterisk main include file. File version handling, generic pbx functions.
static struct stasis_rest_handlers endpoints_sendMessage
REST handler for /api-docs/endpoints.json.
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.
struct ast_json * variables
Structure for variables, used for configurations and for channel variables.
static struct stasis_rest_handlers endpoints_tech_resource_sendMessage
REST handler for /api-docs/endpoints.json.
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.
Generated file - Build validators for ARI model objects.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
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.
void ast_ari_endpoints_list(struct ast_variable *headers, struct ast_ari_endpoints_list_args *args, struct ast_ari_response *response)
List all endpoints.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
describes a server instance
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.
static int load_module(void)
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
int ast_ari_validate_endpoint(struct ast_json *json)
Validator for Endpoint.
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.
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
static struct stasis_rest_handlers endpoints
REST handler for /api-docs/endpoints.json.
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.
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.
Module has failed to load, may be in an inconsistent state.
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_tech
REST handler for /api-docs/endpoints.json.
struct ast_json * message
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.
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",)
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.
const char * path_segment
Generated file - declares stubs to be implemented in res/ari/resource_endpoints.c.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
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}.
Abstract JSON element (object, array, string, int, ...).
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.
Stasis Application API. See Stasis Application API for detailed documentation.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
#define ASTERISK_GPL_KEY
The text the key() function should return.
ari_validator ast_ari_validate_endpoint_fn(void)
Function pointer to ast_ari_validate_endpoint().
Asterisk module definitions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static struct stasis_rest_handlers endpoints_tech_resource
REST handler for /api-docs/endpoints.json.
Handler for a single RESTful path segment.