49 #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))
140 #if defined(AST_DEVMODE) 145 for (i = get_params; i; i = i->
next) {
146 if (strcmp(i->
name,
"type") == 0) {
149 if (strcmp(i->
name,
"bridgeId") == 0) {
152 if (strcmp(i->
name,
"name") == 0) {
162 #if defined(AST_DEVMODE) 174 if (200 <= code && code <= 299) {
186 "Internal Server Error",
"Response validation failed");
190 fin: __attribute__((unused))
224 #if defined(AST_DEVMODE) 229 for (i = get_params; i; i = i->
next) {
230 if (strcmp(i->
name,
"type") == 0) {
233 if (strcmp(i->
name,
"name") == 0) {
238 for (i = path_vars; i; i = i->
next) {
239 if (strcmp(i->
name,
"bridgeId") == 0) {
249 #if defined(AST_DEVMODE) 261 if (200 <= code && code <= 299) {
265 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}\n", code);
273 "Internal Server Error",
"Response validation failed");
277 fin: __attribute__((unused))
294 #if defined(AST_DEVMODE) 299 for (i = path_vars; i; i = i->
next) {
300 if (strcmp(i->
name,
"bridgeId") == 0) {
306 #if defined(AST_DEVMODE) 319 if (200 <= code && code <= 299) {
323 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}\n", code);
331 "Internal Server Error",
"Response validation failed");
335 fin: __attribute__((unused))
352 #if defined(AST_DEVMODE) 357 for (i = path_vars; i; i = i->
next) {
358 if (strcmp(i->
name,
"bridgeId") == 0) {
364 #if defined(AST_DEVMODE) 377 if (200 <= code && code <= 299) {
381 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}\n", code);
389 "Internal Server Error",
"Response validation failed");
393 fin: __attribute__((unused))
464 #if defined(AST_DEVMODE) 469 for (i = get_params; i; i = i->
next) {
470 if (strcmp(i->
name,
"channel") == 0) {
499 "Too many values for channel");
513 if (strcmp(i->
name,
"role") == 0) {
516 if (strcmp(i->
name,
"absorbDTMF") == 0) {
519 if (strcmp(i->
name,
"mute") == 0) {
522 if (strcmp(i->
name,
"inhibitConnectedLineUpdates") == 0) {
527 for (i = path_vars; i; i = i->
next) {
528 if (strcmp(i->
name,
"bridgeId") == 0) {
538 #if defined(AST_DEVMODE) 554 if (200 <= code && code <= 299) {
558 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/addChannel\n", code);
564 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/addChannel\n");
566 "Internal Server Error",
"Response validation failed");
570 fin: __attribute__((unused))
627 #if defined(AST_DEVMODE) 632 for (i = get_params; i; i = i->
next) {
633 if (strcmp(i->
name,
"channel") == 0) {
662 "Too many values for channel");
678 for (i = path_vars; i; i = i->
next) {
679 if (strcmp(i->
name,
"bridgeId") == 0) {
689 #if defined(AST_DEVMODE) 705 if (200 <= code && code <= 299) {
709 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/removeChannel\n", code);
715 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/removeChannel\n");
717 "Internal Server Error",
"Response validation failed");
721 fin: __attribute__((unused))
740 #if defined(AST_DEVMODE) 745 for (i = path_vars; i; i = i->
next) {
746 if (strcmp(i->
name,
"bridgeId") == 0) {
749 if (strcmp(i->
name,
"channelId") == 0) {
755 #if defined(AST_DEVMODE) 770 if (200 <= code && code <= 299) {
774 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/videoSource/{channelId}\n", code);
780 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/videoSource/{channelId}\n");
782 "Internal Server Error",
"Response validation failed");
786 fin: __attribute__((unused))
803 #if defined(AST_DEVMODE) 808 for (i = path_vars; i; i = i->
next) {
809 if (strcmp(i->
name,
"bridgeId") == 0) {
815 #if defined(AST_DEVMODE) 828 if (200 <= code && code <= 299) {
832 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/videoSource\n", code);
838 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/videoSource\n");
840 "Internal Server Error",
"Response validation failed");
844 fin: __attribute__((unused))
874 #if defined(AST_DEVMODE) 879 for (i = get_params; i; i = i->
next) {
880 if (strcmp(i->
name,
"mohClass") == 0) {
885 for (i = path_vars; i; i = i->
next) {
886 if (strcmp(i->
name,
"bridgeId") == 0) {
896 #if defined(AST_DEVMODE) 910 if (200 <= code && code <= 299) {
914 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/moh\n", code);
920 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/moh\n");
922 "Internal Server Error",
"Response validation failed");
926 fin: __attribute__((unused))
943 #if defined(AST_DEVMODE) 948 for (i = path_vars; i; i = i->
next) {
949 if (strcmp(i->
name,
"bridgeId") == 0) {
955 #if defined(AST_DEVMODE) 969 if (200 <= code && code <= 299) {
973 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/moh\n", code);
979 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/moh\n");
981 "Internal Server Error",
"Response validation failed");
985 fin: __attribute__((unused))
1056 #if defined(AST_DEVMODE) 1061 for (i = get_params; i; i = i->
next) {
1062 if (strcmp(i->
name,
"media") == 0) {
1091 "Too many values for media");
1102 args.
media[j] = (vals[j]);
1105 if (strcmp(i->
name,
"lang") == 0) {
1108 if (strcmp(i->
name,
"offsetms") == 0) {
1111 if (strcmp(i->
name,
"skipms") == 0) {
1114 if (strcmp(i->
name,
"playbackId") == 0) {
1119 for (i = path_vars; i; i = i->
next) {
1120 if (strcmp(i->
name,
"bridgeId") == 0) {
1130 #if defined(AST_DEVMODE) 1144 if (200 <= code && code <= 299) {
1148 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/play\n", code);
1154 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/play\n");
1156 "Internal Server Error",
"Response validation failed");
1160 fin: __attribute__((unused))
1229 #if defined(AST_DEVMODE) 1234 for (i = get_params; i; i = i->
next) {
1235 if (strcmp(i->
name,
"media") == 0) {
1264 "Too many values for media");
1275 args.
media[j] = (vals[j]);
1278 if (strcmp(i->
name,
"lang") == 0) {
1281 if (strcmp(i->
name,
"offsetms") == 0) {
1284 if (strcmp(i->
name,
"skipms") == 0) {
1289 for (i = path_vars; i; i = i->
next) {
1290 if (strcmp(i->
name,
"bridgeId") == 0) {
1293 if (strcmp(i->
name,
"playbackId") == 0) {
1303 #if defined(AST_DEVMODE) 1317 if (200 <= code && code <= 299) {
1321 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/play/{playbackId}\n", code);
1327 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/play/{playbackId}\n");
1329 "Internal Server Error",
"Response validation failed");
1333 fin: __attribute__((unused))
1389 #if defined(AST_DEVMODE) 1394 for (i = get_params; i; i = i->
next) {
1395 if (strcmp(i->
name,
"name") == 0) {
1398 if (strcmp(i->
name,
"format") == 0) {
1401 if (strcmp(i->
name,
"maxDurationSeconds") == 0) {
1404 if (strcmp(i->
name,
"maxSilenceSeconds") == 0) {
1407 if (strcmp(i->
name,
"ifExists") == 0) {
1410 if (strcmp(i->
name,
"beep") == 0) {
1413 if (strcmp(i->
name,
"terminateOn") == 0) {
1418 for (i = path_vars; i; i = i->
next) {
1419 if (strcmp(i->
name,
"bridgeId") == 0) {
1429 #if defined(AST_DEVMODE) 1445 if (200 <= code && code <= 299) {
1449 ast_log(
LOG_ERROR,
"Invalid error response %d for /bridges/{bridgeId}/record\n", code);
1455 ast_log(
LOG_ERROR,
"Response validation failed for /bridges/{bridgeId}/record\n");
1457 "Internal Server Error",
"Response validation failed");
1461 fin: __attribute__((unused))
1587 .requires =
"res_ari,res_ari_model,res_stasis,res_stasis_recording,res_stasis_playback",
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.
struct ast_variable * next
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.
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.
Asterisk main include file. File version handling, generic pbx functions.
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.
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_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response)
Get bridge details.
static struct stasis_rest_handlers bridges_bridgeId_record
REST handler for /api-docs/bridges.json.
static struct stasis_rest_handlers bridges_bridgeId_videoSource
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.
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.
int ast_json_is_true(const struct ast_json *value)
Check if value is JSON true.
Structure for variables, used for configurations and for channel variables.
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.
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}.
Generated file - Build validators for ARI model objects.
static struct stasis_rest_handlers bridges_bridgeId_moh
REST handler for /api-docs/bridges.json.
#define ast_strdup(str)
A wrapper for strdup()
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 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_play_parse_body(struct ast_json *body, struct ast_ari_bridges_play_args *args)
Body parsing function for /bridges/{bridgeId}/play.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
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.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
ari_validator ast_ari_validate_bridge_fn(void)
Function pointer to ast_ari_validate_bridge().
static int unload_module(void)
static struct stasis_rest_handlers bridges_bridgeId_play_playbackId
REST handler for /api-docs/bridges.json.
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.
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}.
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.
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}.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
#define ast_malloc(len)
A wrapper for malloc()
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_validate_playback(struct ast_json *json)
Validator for Playback.
static struct stasis_rest_handlers bridges_bridgeId_play
REST handler for /api-docs/bridges.json.
static struct stasis_rest_handlers bridges_bridgeId_videoSource_channelId
REST handler for /api-docs/bridges.json.
describes a server instance
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.
int ast_ari_add_handler(struct stasis_rest_handlers *handler)
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
const char * terminate_on
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 struct stasis_rest_handlers bridges_bridgeId
REST handler for /api-docs/bridges.json.
int ast_ari_validate_bridge(struct ast_json *json)
Validator for Bridge.
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_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}.
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...
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.
int ast_ari_remove_handler(struct stasis_rest_handlers *handler)
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.
static struct stasis_rest_handlers bridges
REST handler for /api-docs/bridges.json.
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.
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_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.
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
Module has failed to load, may be in an inconsistent state.
static struct stasis_rest_handlers bridges_bridgeId_addChannel
REST handler for /api-docs/bridges.json.
static struct stasis_rest_handlers bridges_bridgeId_removeChannel
REST handler for /api-docs/bridges.json.
int ast_ari_validate_live_recording(struct ast_json *json)
Validator for LiveRecording.
int inhibit_connected_line_updates
struct ast_json * message
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",)
Generated file - declares stubs to be implemented in res/ari/resource_bridges.c.
const char * path_segment
void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response)
Start a recording.
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_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}.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
Abstract JSON element (object, array, string, int, ...).
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.
Stasis Application API. See Stasis Application API for detailed documentation.
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...
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_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.
Asterisk module definitions.
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
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.
Handler for a single RESTful path segment.
static int load_module(void)
#define ast_app_separate_args(a, b, c, d)
int ast_ari_bridges_create_parse_body(struct ast_json *body, struct ast_ari_bridges_create_args *args)
Body parsing function for /bridges.