49#if defined(AST_DEVMODE)
70#if defined(AST_DEVMODE)
76#if defined(AST_DEVMODE)
88 if (200 <= code && code <= 299) {
100 "Internal Server Error",
"Response validation failed");
104fin: __attribute__((unused))
144#if defined(AST_DEVMODE)
149 for (i = get_params; i; i = i->
next) {
150 if (strcmp(i->
name,
"type") == 0) {
153 if (strcmp(i->
name,
"bridgeId") == 0) {
156 if (strcmp(i->
name,
"name") == 0) {
166#if defined(AST_DEVMODE)
178 if (200 <= code && code <= 299) {
190 "Internal Server Error",
"Response validation failed");
194fin: __attribute__((unused))
230#if defined(AST_DEVMODE)
235 for (i = get_params; i; i = i->
next) {
236 if (strcmp(i->
name,
"type") == 0) {
239 if (strcmp(i->
name,
"name") == 0) {
244 for (i = path_vars; i; i = i->
next) {
245 if (strcmp(i->
name,
"bridgeId") == 0) {
255#if defined(AST_DEVMODE)
267 if (200 <= code && code <= 299) {
271 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}\n", code);
279 "Internal Server Error",
"Response validation failed");
283fin: __attribute__((unused))
302#if defined(AST_DEVMODE)
307 for (i = path_vars; i; i = i->
next) {
308 if (strcmp(i->
name,
"bridgeId") == 0) {
314#if defined(AST_DEVMODE)
327 if (200 <= code && code <= 299) {
331 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}\n", code);
339 "Internal Server Error",
"Response validation failed");
343fin: __attribute__((unused))
362#if defined(AST_DEVMODE)
367 for (i = path_vars; i; i = i->
next) {
368 if (strcmp(i->
name,
"bridgeId") == 0) {
374#if defined(AST_DEVMODE)
387 if (200 <= code && code <= 299) {
391 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}\n", code);
399 "Internal Server Error",
"Response validation failed");
403fin: __attribute__((unused))
424 if (!
args->channel) {
428 for (i = 0; i <
args->channel_count; ++i) {
433 args->channel_count = 1;
435 if (!
args->channel) {
476#if defined(AST_DEVMODE)
481 for (i = get_params; i; i = i->
next) {
482 if (strcmp(i->
name,
"channel") == 0) {
488 if (!
args.channel_parse) {
493 if (strlen(
args.channel_parse) == 0) {
495 args.channel_count = 1;
496 vals[0] =
args.channel_parse;
499 args.channel_parse,
',', vals,
503 if (
args.channel_count == 0) {
511 "Too many values for channel");
521 for (j = 0; j <
args.channel_count; ++j) {
522 args.channel[j] = (vals[j]);
525 if (strcmp(i->
name,
"role") == 0) {
528 if (strcmp(i->
name,
"absorbDTMF") == 0) {
531 if (strcmp(i->
name,
"mute") == 0) {
534 if (strcmp(i->
name,
"inhibitConnectedLineUpdates") == 0) {
539 for (i = path_vars; i; i = i->
next) {
540 if (strcmp(i->
name,
"bridgeId") == 0) {
550#if defined(AST_DEVMODE)
566 if (200 <= code && code <= 299) {
570 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/addChannel\n", code);
576 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/addChannel\n");
578 "Internal Server Error",
"Response validation failed");
582fin: __attribute__((unused))
605 if (!
args->channel) {
609 for (i = 0; i <
args->channel_count; ++i) {
614 args->channel_count = 1;
616 if (!
args->channel) {
641#if defined(AST_DEVMODE)
646 for (i = get_params; i; i = i->
next) {
647 if (strcmp(i->
name,
"channel") == 0) {
653 if (!
args.channel_parse) {
658 if (strlen(
args.channel_parse) == 0) {
660 args.channel_count = 1;
661 vals[0] =
args.channel_parse;
664 args.channel_parse,
',', vals,
668 if (
args.channel_count == 0) {
676 "Too many values for channel");
686 for (j = 0; j <
args.channel_count; ++j) {
687 args.channel[j] = (vals[j]);
692 for (i = path_vars; i; i = i->
next) {
693 if (strcmp(i->
name,
"bridgeId") == 0) {
703#if defined(AST_DEVMODE)
719 if (200 <= code && code <= 299) {
723 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/removeChannel\n", code);
729 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/removeChannel\n");
731 "Internal Server Error",
"Response validation failed");
735fin: __attribute__((unused))
756#if defined(AST_DEVMODE)
761 for (i = path_vars; i; i = i->
next) {
762 if (strcmp(i->
name,
"bridgeId") == 0) {
765 if (strcmp(i->
name,
"channelId") == 0) {
771#if defined(AST_DEVMODE)
786 if (200 <= code && code <= 299) {
790 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/videoSource/{channelId}\n", code);
796 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/videoSource/{channelId}\n");
798 "Internal Server Error",
"Response validation failed");
802fin: __attribute__((unused))
821#if defined(AST_DEVMODE)
826 for (i = path_vars; i; i = i->
next) {
827 if (strcmp(i->
name,
"bridgeId") == 0) {
833#if defined(AST_DEVMODE)
846 if (200 <= code && code <= 299) {
850 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/videoSource\n", code);
856 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/videoSource\n");
858 "Internal Server Error",
"Response validation failed");
862fin: __attribute__((unused))
894#if defined(AST_DEVMODE)
899 for (i = get_params; i; i = i->
next) {
900 if (strcmp(i->
name,
"mohClass") == 0) {
905 for (i = path_vars; i; i = i->
next) {
906 if (strcmp(i->
name,
"bridgeId") == 0) {
916#if defined(AST_DEVMODE)
930 if (200 <= code && code <= 299) {
934 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/moh\n", code);
940 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/moh\n");
942 "Internal Server Error",
"Response validation failed");
946fin: __attribute__((unused))
965#if defined(AST_DEVMODE)
970 for (i = path_vars; i; i = i->
next) {
971 if (strcmp(i->
name,
"bridgeId") == 0) {
977#if defined(AST_DEVMODE)
991 if (200 <= code && code <= 299) {
995 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/moh\n", code);
1001 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/moh\n");
1003 "Internal Server Error",
"Response validation failed");
1007fin: __attribute__((unused))
1032 for (i = 0; i <
args->media_count; ++i) {
1037 args->media_count = 1;
1080#if defined(AST_DEVMODE)
1085 for (i = get_params; i; i = i->
next) {
1086 if (strcmp(i->
name,
"media") == 0) {
1092 if (!
args.media_parse) {
1097 if (strlen(
args.media_parse) == 0) {
1099 args.media_count = 1;
1100 vals[0] =
args.media_parse;
1103 args.media_parse,
',', vals,
1107 if (
args.media_count == 0) {
1115 "Too many values for media");
1125 for (j = 0; j <
args.media_count; ++j) {
1126 args.media[j] = (vals[j]);
1129 if (strcmp(i->
name,
"lang") == 0) {
1132 if (strcmp(i->
name,
"offsetms") == 0) {
1135 if (strcmp(i->
name,
"skipms") == 0) {
1138 if (strcmp(i->
name,
"playbackId") == 0) {
1143 for (i = path_vars; i; i = i->
next) {
1144 if (strcmp(i->
name,
"bridgeId") == 0) {
1154#if defined(AST_DEVMODE)
1168 if (200 <= code && code <= 299) {
1172 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/play\n", code);
1178 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/play\n");
1180 "Internal Server Error",
"Response validation failed");
1184fin: __attribute__((unused))
1211 for (i = 0; i <
args->media_count; ++i) {
1216 args->media_count = 1;
1255#if defined(AST_DEVMODE)
1260 for (i = get_params; i; i = i->
next) {
1261 if (strcmp(i->
name,
"media") == 0) {
1267 if (!
args.media_parse) {
1272 if (strlen(
args.media_parse) == 0) {
1274 args.media_count = 1;
1275 vals[0] =
args.media_parse;
1278 args.media_parse,
',', vals,
1282 if (
args.media_count == 0) {
1290 "Too many values for media");
1300 for (j = 0; j <
args.media_count; ++j) {
1301 args.media[j] = (vals[j]);
1304 if (strcmp(i->
name,
"lang") == 0) {
1307 if (strcmp(i->
name,
"offsetms") == 0) {
1310 if (strcmp(i->
name,
"skipms") == 0) {
1315 for (i = path_vars; i; i = i->
next) {
1316 if (strcmp(i->
name,
"bridgeId") == 0) {
1319 if (strcmp(i->
name,
"playbackId") == 0) {
1329#if defined(AST_DEVMODE)
1343 if (200 <= code && code <= 299) {
1347 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/play/{playbackId}\n", code);
1353 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/play/{playbackId}\n");
1355 "Internal Server Error",
"Response validation failed");
1359fin: __attribute__((unused))
1417#if defined(AST_DEVMODE)
1422 for (i = get_params; i; i = i->
next) {
1423 if (strcmp(i->
name,
"name") == 0) {
1426 if (strcmp(i->
name,
"format") == 0) {
1429 if (strcmp(i->
name,
"maxDurationSeconds") == 0) {
1430 args.max_duration_seconds = atoi(i->
value);
1432 if (strcmp(i->
name,
"maxSilenceSeconds") == 0) {
1433 args.max_silence_seconds = atoi(i->
value);
1435 if (strcmp(i->
name,
"ifExists") == 0) {
1438 if (strcmp(i->
name,
"beep") == 0) {
1441 if (strcmp(i->
name,
"terminateOn") == 0) {
1446 for (i = path_vars; i; i = i->
next) {
1447 if (strcmp(i->
name,
"bridgeId") == 0) {
1457#if defined(AST_DEVMODE)
1473 if (200 <= code && code <= 299) {
1477 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/record\n", code);
1483 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/record\n");
1485 "Internal Server Error",
"Response validation failed");
1489fin: __attribute__((unused))
1615 .
requires =
"res_ari,res_ari_model,res_stasis,res_stasis_recording,res_stasis_playback",
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)
int ast_ari_validate_playback(struct ast_json *json)
Validator for Playback.
int ast_ari_validate_live_recording(struct ast_json *json)
Validator for LiveRecording.
int ast_ari_validate_bridge(struct ast_json *json)
Validator for Bridge.
ari_validator ast_ari_validate_bridge_fn(void)
Function pointer to ast_ari_validate_bridge().
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.
#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.
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
int ast_json_is_true(const struct ast_json *value)
Check if value is JSON true.
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.
static void ast_ari_bridges_stop_moh_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 /bridges/{bridgeId}/moh.
static struct stasis_rest_handlers bridges_bridgeId_play
REST handler for /api-docs/bridges.json.
static void ast_ari_bridges_destroy_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 /bridges/{bridgeId}.
static struct stasis_rest_handlers bridges_bridgeId_record
REST handler for /api-docs/bridges.json.
static void ast_ari_bridges_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 /bridges/{bridgeId}.
int ast_ari_bridges_add_channel_parse_body(struct ast_json *body, struct ast_ari_bridges_add_channel_args *args)
Body parsing function for /bridges/{bridgeId}/addChannel.
static void ast_ari_bridges_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 /bridges.
static void ast_ari_bridges_set_video_source_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 /bridges/{bridgeId}/videoSource/{channelId}.
static struct stasis_rest_handlers bridges_bridgeId_videoSource_channelId
REST handler for /api-docs/bridges.json.
static void ast_ari_bridges_create_with_id_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 /bridges/{bridgeId}.
int ast_ari_bridges_start_moh_parse_body(struct ast_json *body, struct ast_ari_bridges_start_moh_args *args)
Body parsing function for /bridges/{bridgeId}/moh.
static void ast_ari_bridges_create_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 /bridges.
int ast_ari_bridges_record_parse_body(struct ast_json *body, struct ast_ari_bridges_record_args *args)
Body parsing function for /bridges/{bridgeId}/record.
int ast_ari_bridges_create_with_id_parse_body(struct ast_json *body, struct ast_ari_bridges_create_with_id_args *args)
Body parsing function for /bridges/{bridgeId}.
static struct stasis_rest_handlers bridges_bridgeId_addChannel
REST handler for /api-docs/bridges.json.
int ast_ari_bridges_play_parse_body(struct ast_json *body, struct ast_ari_bridges_play_args *args)
Body parsing function for /bridges/{bridgeId}/play.
static void ast_ari_bridges_play_with_id_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 /bridges/{bridgeId}/play/{playbackId}.
static void ast_ari_bridges_remove_channel_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 /bridges/{bridgeId}/removeChannel.
static void ast_ari_bridges_play_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 /bridges/{bridgeId}/play.
int ast_ari_bridges_play_with_id_parse_body(struct ast_json *body, struct ast_ari_bridges_play_with_id_args *args)
Body parsing function for /bridges/{bridgeId}/play/{playbackId}.
static void ast_ari_bridges_start_moh_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 /bridges/{bridgeId}/moh.
static void ast_ari_bridges_record_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 /bridges/{bridgeId}/record.
static void ast_ari_bridges_clear_video_source_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 /bridges/{bridgeId}/videoSource.
int ast_ari_bridges_create_parse_body(struct ast_json *body, struct ast_ari_bridges_create_args *args)
Body parsing function for /bridges.
static int load_module(void)
static struct stasis_rest_handlers bridges_bridgeId_moh
REST handler for /api-docs/bridges.json.
static int unload_module(void)
int ast_ari_bridges_remove_channel_parse_body(struct ast_json *body, struct ast_ari_bridges_remove_channel_args *args)
Body parsing function for /bridges/{bridgeId}/removeChannel.
static struct stasis_rest_handlers bridges_bridgeId_play_playbackId
REST handler for /api-docs/bridges.json.
static struct stasis_rest_handlers bridges_bridgeId
REST handler for /api-docs/bridges.json.
static void ast_ari_bridges_add_channel_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 /bridges/{bridgeId}/addChannel.
static struct stasis_rest_handlers bridges_bridgeId_removeChannel
REST handler for /api-docs/bridges.json.
static struct stasis_rest_handlers bridges_bridgeId_videoSource
REST handler for /api-docs/bridges.json.
static struct stasis_rest_handlers bridges
REST handler for /api-docs/bridges.json.
void ast_ari_bridges_add_channel(struct ast_variable *headers, struct ast_ari_bridges_add_channel_args *args, struct ast_ari_response *response)
Add a channel to a bridge.
void ast_ari_bridges_clear_video_source(struct ast_variable *headers, struct ast_ari_bridges_clear_video_source_args *args, struct ast_ari_response *response)
Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bri...
void ast_ari_bridges_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response)
Get bridge details.
void ast_ari_bridges_play_with_id(struct ast_variable *headers, struct ast_ari_bridges_play_with_id_args *args, struct ast_ari_response *response)
Start playback of media on a bridge.
void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response)
Start playback of media on a bridge.
void ast_ari_bridges_destroy(struct ast_variable *headers, struct ast_ari_bridges_destroy_args *args, struct ast_ari_response *response)
Shut down a bridge.
void ast_ari_bridges_remove_channel(struct ast_variable *headers, struct ast_ari_bridges_remove_channel_args *args, struct ast_ari_response *response)
Remove a channel from a bridge.
void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response)
Create a new bridge.
void ast_ari_bridges_create_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_with_id_args *args, struct ast_ari_response *response)
Create a new bridge or updates an existing one.
void ast_ari_bridges_set_video_source(struct ast_variable *headers, struct ast_ari_bridges_set_video_source_args *args, struct ast_ari_response *response)
Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bri...
void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response)
Start a recording.
void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response)
Play music on hold to a bridge or change the MOH class that is playing.
void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response)
Stop playing music on hold to a bridge.
void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response)
List all active bridges in Asterisk.
Generated file - declares stubs to be implemented in res/ari/resource_bridges.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