59 const char *bridge_id)
76 "Bridge not in Stasis application");
94 const char *channel_id)
101 if (control ==
NULL) {
106 if (snapshot ==
NULL) {
109 "Channel not found");
115 "Channel not in Stasis application");
132 for (i = 0; i < list->
count; ++i) {
153 for (i = 0; i <
count; ++i) {
157 list->controls[list->count] =
159 if (!list->controls[list->count]) {
166 if (list->count == 0) {
182 response, 409,
"Conflict",
"Channel %s currently recording",
211 for (i = 0; i < list->count; ++i) {
228 for (i = 0; i < list->count; ++i) {
231 list->controls[i], bridge)))) {
261 for (i = 0; i < list->count; ++i) {
266 "Unprocessable Entity",
267 "Channel not in this bridge");
273 for (i = 0; i < list->count; ++i) {
295 char *bridge_id = thread_data->
bridge_id;
364 size_t args_media_count,
365 const char *args_lang,
368 const char *args_playback_id,
383 response, 500,
"Internal Error",
"Failed to get control snapshot");
391 args_offset_ms, args_playback_id);
414 size_t args_media_count,
415 const char *args_format,
416 const char *args_lang,
419 const char *args_playback_id,
450 if (!channel_format) {
452 response, 422,
"Unprocessable Entity",
453 "specified announcer_format is unknown on this system");
465 if (channel_format) {
466 channel_format =
ao2_bump(channel_format);
471 unsigned int max_sample_rate = 0;
481 if (!channel_format) {
490 response, 500,
"Internal Error",
"Could not create playback channel");
502 if (!bridge_topic || !channel_topic || !(channel_forward =
stasis_forward_all(channel_topic, bridge_topic))) {
504 response, 500,
"Internal Error",
"Could not forward playback channel stasis messages to bridge topic");
511 response, 500,
"Internal Error",
"Failed to put playback channel into the bridge");
516 if (control ==
NULL) {
523 args_offset_ms, args_skipms, args_playback_id, response, bridge,
524 control, &json, &playback_url)) {
538 thread_data =
ast_calloc(1,
sizeof(*thread_data));
546 thread_data->
control = control;
547 thread_data->
forward = channel_forward;
567 channel_forward =
NULL;
599 size_t args_media_count,
600 const char *args_lang,
603 const char *args_playback_id,
626 args_lang, args_offset_ms, args_skipms, args_playback_id,
627 response, bridge, control, &json, &playback_url)) {
638 const char *args_bridge_id,
639 const char **args_media,
640 size_t args_media_count,
641 const char *args_format,
642 const char *args_lang,
645 const char *args_playback_id,
665 args_offset_ms, args_skipms, args_playback_id, response,
bridge,
673 args_skipms, args_playback_id, response,
bridge);
684 args->announcer_format,
699 args->announcer_format,
723 size_t uri_name_maxlen;
731 if (bridge ==
NULL) {
738 response, 422,
"Unprocessable Entity",
739 "specified format is unknown on this system");
745 if (!channel_format) {
747 response, 422,
"Unprocessable Entity",
748 "specified recorder_format is unknown on this system");
757 response, 500,
"Internal Server Error",
"Failed to create recording channel");
770 if (!bridge_topic || !channel_topic || !(channel_forward =
stasis_forward_all(channel_topic, bridge_topic))) {
772 response, 500,
"Internal Error",
"Could not forward record channel stasis messages to bridge topic");
779 response, 500,
"Internal Error",
"Failed to put recording channel into the bridge");
784 if (control ==
NULL) {
796 options->max_silence_seconds =
args->max_silence_seconds;
797 options->max_duration_seconds =
args->max_duration_seconds;
806 response, 400,
"Bad Request",
807 "terminateOn invalid");
813 response, 400,
"Bad Request",
819 if (recording ==
NULL) {
826 response, 500,
"Internal Server Error",
827 "Error parsing request");
831 "Recording '%s' already exists and can not be overwritten",
839 response, 400,
"Bad Request",
840 "Recording name invalid");
844 "Unrecognized recording error: %s\n",
847 response, 500,
"Internal Server Error",
848 "Internal Server Error");
854 uri_name_maxlen = strlen(
args->name) * 3;
855 uri_encoded_name =
ast_malloc(uri_name_maxlen);
856 if (!uri_encoded_name) {
863 uri_encoded_name) == -1) {
864 recording_url =
NULL;
875 thread_data =
ast_calloc(1,
sizeof(*thread_data));
882 thread_data->
control = control;
883 thread_data->
forward = channel_forward;
892 record_channel =
NULL;
894 channel_forward =
NULL;
905 const char *moh_class =
args->moh_class;
938 response, 409,
"Conflict",
939 "Bridge isn't playing music");
953 response, 404,
"Not Found",
1034 *report_event_variables =
NULL;
1042 int report_events = 0;
1053 ast_log(
LOG_DEBUG,
"Processing variable '%s' with report_events: %s\n", key,
1054 report_field ? (
ast_json_is_true(report_field) ?
"true" :
"false") :
"not set");
1058 "Each object value in 'variables' must include string field 'value'");
1075 "Field 'report_events' in 'variables' entries must be boolean");
1076 ast_log(
LOG_WARNING,
"Invalid 'report_events' field for variable '%s' (bad type)\n", key);
1084 "Each value in 'variables' must be a string or an object with 'value' and optional 'report_events'");
1101 if (report_events && report_event_variables) {
1110 report_var_tail, report_var);
1119 if (report_event_variables) {
1121 *report_event_variables =
NULL;
1137 response, 409,
"Conflict",
1138 "Bridge with id '%s' already exists",
args->bridge_id);
1147 response, 500,
"Internal Error",
1148 "Unable to create bridge. Possible duplicate bridge id '%s'",
args->bridge_id);
1153 &variables, &report_event_variables)) {
1162 int report_events = 0;
1164 char buf[strlen(
var->name) + 1];
1170 for (report_var = report_event_variables; report_var;
1171 report_var = report_var->
next) {
1172 if (!strcmp(report_var->
name,
var->name)) {
1194 response, 500,
"Internal Error",
1195 "Unable to create snapshot for new bridge");
1214 response, 409,
"Conflict",
1215 "Bridge with id '%s' already exists",
args->bridge_id);
1224 response, 500,
"Internal Error",
1225 "Unable to create bridge");
1229 if (
args->variables) {
1234 &variables, &report_event_variables)) {
1235 if (
args->variables) {
1249 int report_events = 0;
1251 char buf[strlen(
var->name) + 1];
1258 for (report_var = report_event_variables; report_var;
1259 report_var = report_var->
next) {
1260 if (!strcmp(report_var->
name,
var->name)) {
1282 response, 500,
"Internal Error",
1283 "Unable to create snapshot for new bridge");
1322 "Unprocessable Entity",
1323 "Channel not in this bridge");
1366 "Variable name is required");
1382 "Provided variable was not found");
1402 char buf[strlen(
args->variable) + 1];
1407 "Variable name is required");
1422 args->report_events)) {
1424 "Failed to execute function");
1443 if (!json || !inner_json || !
value) {
1448 if (
args->variables_count == 0) {
1450 response, 400,
"Bad Request",
1451 "At least one variable name is required");
1457 response, 400,
"Bad Request",
1458 "Bridge ID is required");
1465 response, 404,
"Bridge Not Found",
1466 "Provided bridge was not found");
1470 for (
int i = 0; i <
args->variables_count; i++) {
1472 char buf[strlen(
args->variables[i]) + 1];
1474 const char *var_value;
1476 strcpy(
buf,
args->variables[i]);
1480 response, 400,
"Bad Request",
1481 "Variable names are required");
1485 if (variable[strlen(variable) - 1] ==
')') {
1488 response, 500,
"Error With Function",
1489 "Unable to read provided function");
1498 response, 404,
"Variable Not Found",
1499 "Provided variable was not found");
1540 if (!
args->variables) {
1542 response, 400,
"Bad Request",
1543 "The 'variables' field is required");
1550 response, 404,
"Bridge Not Found",
1551 "Provided bridge was not found");
1558 response, 400,
"Bad Request",
1559 "The 'variables' field must be a JSON object");
1564 &report_event_variables)) {
1569 int report_events = 0;
1571 char buf[strlen(
var->name) + 1];
1578 for (report_var = report_event_variables; report_var;
1579 report_var = report_var->
next) {
1580 if (!strcmp(report_var->
name,
var->name)) {
1589 response, 400,
"Bad Request",
1590 "Failed to execute function");
void ast_ari_response_created(struct ast_ari_response *response, const char *url, struct ast_json *message)
Fill in a Created (201) ast_ari_response.
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_ok(struct ast_ari_response *response, struct ast_json *message)
Fill in an OK (200) ast_ari_response.
void ast_ari_response_alloc_failed(struct ast_ari_response *response)
Fill in response with a 500 message for allocation failures.
void ast_ari_response_no_content(struct ast_ari_response *response)
Fill in a No Content (204) ast_ari_response.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_iterator_next(iter)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
void __ao2_cleanup(void *obj)
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ao2_alloc(data_size, destructor_fn)
static struct ao2_container * bridges
struct ao2_container * ast_bridges(void)
Returns the global bridges container.
void ast_bridge_set_talker_src_video_mode(struct ast_bridge *bridge)
Set the bridge to pick the strongest talker supporting video as the single source video feed.
#define ast_bridge_unlock(bridge)
Unlock the bridge.
void ast_bridge_set_single_src_video_mode(struct ast_bridge *bridge, struct ast_channel *video_src_chan)
Set a bridge to feed a single video source to all participants.
const char * ast_bridge_get_variable(const struct ast_bridge *bridge, const char *name)
Get value a variable from the bridge by name.
#define ast_bridge_lock(bridge)
Lock the bridge.
int ast_bridge_set_variable(struct ast_bridge *bridge, const char *name, const char *value, int report_events)
Set a variable on the bridge.
int ast_bridge_queue_everyone_else(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
Queue the given frame to everyone else.
@ AST_BRIDGE_FLAG_INVISIBLE
@ AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE
@ AST_BRIDGE_CHANNEL_FLAG_LONELY
static char language[MAX_LANGUAGE]
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
ast_callid ast_channel_callid(const struct ast_channel *chan)
struct ast_format * ast_channel_rawwriteformat(struct ast_channel *chan)
#define ast_channel_cleanup(c)
Cleanup a channel reference.
struct ast_channel * ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel.
static struct channel_usage channels
Unreal channel derivative framework.
int ast_unreal_channel_push_to_bridge(struct ast_channel *ast, struct ast_bridge *bridge, unsigned int flags)
Push the semi2 unreal channel into a bridge from either member of the unreal pair.
Generic File Format Support. Should be included by clients of the file handling routines....
struct ast_format * ast_get_format_for_file_ext(const char *file_ext)
Get the ast_format associated with the given file extension.
struct ast_channel_snapshot * ast_channel_snapshot_get_latest(const char *uniqueid)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object,...
@ AST_RECORD_IF_EXISTS_ERROR
#define ast_variable_new(name, value, filename)
struct ast_variable * ast_variable_list_append_hint(struct ast_variable **head, struct ast_variable *search_hint, struct ast_variable *new_var)
Appends a variable list to the end of another list.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
#define ast_debug(level,...)
Log a DEBUG message.
int ast_callid_threadassoc_add(ast_callid callid)
Adds a known callid to thread storage of the calling thread.
struct ast_json * ast_json_object_iter_value(struct ast_json_iter *iter)
Get the value from an iterator.
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_json_iter * ast_json_object_iter_next(struct ast_json *object, struct ast_json_iter *iter)
Get the next iterator.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct ast_json_iter * ast_json_object_iter(struct ast_json *object)
Get an iterator pointing to the first field in a JSON object.
ast_json_type
Valid types of a JSON element.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
const char * ast_json_object_iter_key(struct ast_json_iter *iter)
Get the key from an iterator.
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.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
int ast_func_read2(struct ast_channel *chan, const char *function, struct ast_str **str, ssize_t maxlen)
executes a read operation on a function
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_set_bridge_var(struct ast_variable *headers, struct ast_ari_bridges_set_bridge_var_args *args, struct ast_ari_response *response)
Set the value of a bridge variable or function.
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.
static void ari_bridges_play_new(const char **args_media, size_t args_media_count, const char *args_format, const char *args_lang, int args_offset_ms, int args_skipms, const char *args_playback_id, struct ast_ari_response *response, struct ast_bridge *bridge)
static struct stasis_app_control * find_channel_control(struct ast_ari_response *response, const char *channel_id)
Finds the control object for a channel, filling the response with an error, if appropriate.
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.
static struct control_list * control_list_create(struct ast_ari_response *response, size_t count, const char **channels)
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.
static void control_list_dtor(void *obj)
static struct ast_bridge * find_bridge(struct ast_ari_response *response, const char *bridge_id)
Finds a bridge, filling the response with an error, if appropriate.
static int bridge_set_video_source_cb(struct stasis_app_control *control, struct ast_channel *chan, void *data)
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.
@ PLAY_FOUND_CHANNEL_UNAVAILABLE
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 ari_bridges_handle_play(const char *args_bridge_id, const char **args_media, size_t args_media_count, const char *args_format, const char *args_lang, int args_offset_ms, int args_skipms, const char *args_playback_id, struct ast_ari_response *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.
static int ari_bridges_play_helper(const char **args_media, size_t args_media_count, const char *args_lang, int args_offset_ms, int args_skipms, const char *args_playback_id, struct ast_ari_response *response, struct ast_bridge *bridge, struct stasis_app_control *control, struct ast_json **json, char **playback_url)
Performs common setup for a bridge playback operation with both new controls and when existing contro...
static int json_to_ast_variables(struct ast_ari_response *response, struct ast_json *json_variables, struct ast_variable **variables, struct ast_variable **report_event_variables)
static void * bridge_channel_control_thread(void *data)
static int check_add_remove_channel(struct ast_ari_response *response, struct stasis_app_control *control, enum stasis_app_control_channel_result result)
void ast_ari_bridges_get_bridge_vars(struct ast_variable *headers, struct ast_ari_bridges_get_bridge_vars_args *args, struct ast_ari_response *response)
Get the value of multiple bridge variables or functions.
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 enum play_found_result ari_bridges_play_found(const char **args_media, size_t args_media_count, const char *args_lang, int args_offset_ms, int args_skipms, const char *args_playback_id, struct ast_ari_response *response, struct ast_bridge *bridge, struct ast_channel *found_channel)
Performs common setup for a bridge playback operation with both new controls and when existing contro...
void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response)
Start a recording.
static struct ast_channel * prepare_bridge_media_channel(const char *type, struct ast_format *channel_format)
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_get_bridge_var(struct ast_variable *headers, struct ast_ari_bridges_get_bridge_var_args *args, struct ast_ari_response *response)
Get the value of a bridge variable or function.
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.
void ast_ari_bridges_set_bridge_vars(struct ast_variable *headers, struct ast_ari_bridges_set_bridge_vars_args *args, struct ast_ari_response *response)
Set the values of multiple bridge variables or functions.
Generated file - declares stubs to be implemented in res/ari/resource_bridges.c.
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}.
int ast_ari_bridges_create_parse_body(struct ast_json *body, struct ast_ari_bridges_create_args *args)
Body parsing function for /bridges.
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
struct stasis_forward * stasis_forward_all(struct stasis_topic *from_topic, struct stasis_topic *to_topic)
Create a subscription which forwards all messages from one topic to another.
Stasis Application API. See Stasis Application API for detailed documentation.
void stasis_app_control_mute_in_bridge(struct stasis_app_control *control, int mute)
Set whether audio from the channel is muted instead of passing through to the bridge.
void stasis_app_bridge_playback_channel_remove(char *bridge_id, struct stasis_app_control *control)
remove channel from list of ARI playback channels for bridges.
struct stasis_message_sanitizer * stasis_app_get_sanitizer(void)
Get the Stasis message sanitizer for app_stasis applications.
const char * stasis_app_control_get_channel_id(const struct stasis_app_control *control)
Returns the uniqueid of the channel associated with this control.
int stasis_app_control_add_channel_to_bridge(struct stasis_app_control *control, struct ast_bridge *bridge)
Add a channel to the bridge.
void stasis_app_control_clear_roles(struct stasis_app_control *control)
Clear bridge roles currently applied to a channel controlled by a stasis app control.
void stasis_app_bridge_destroy(const char *bridge_id)
Destroy the bridge.
struct ast_bridge * stasis_app_bridge_find_by_id(const char *bridge_id)
Returns the bridge with the given id.
struct ast_bridge * stasis_app_bridge_create(const char *type, const char *name, const char *id)
Create a bridge of the specified type.
void stasis_app_control_absorb_dtmf_in_bridge(struct stasis_app_control *control, int absorb)
Set whether DTMF from the channel is absorbed instead of passing through to the bridge.
void stasis_app_control_execute_until_exhausted(struct ast_channel *chan, struct stasis_app_control *control)
Act on a stasis app control queue until it is empty.
struct ast_channel * stasis_app_bridge_moh_channel(struct ast_bridge *bridge)
Finds or creates an announcer channel in a bridge that can play music on hold.
void stasis_app_bridge_playback_channel_control_remove(const char *bridge_id, struct stasis_app_control *control)
Remove a bridge playback channel's control from the app controls list.
void stasis_app_control_flush_queue(struct stasis_app_control *control)
Flush the control command queue.
int stasis_app_control_add_role(struct stasis_app_control *control, const char *role)
Apply a bridge role to a channel controlled by a stasis app control.
int stasis_app_channel_unreal_set_internal(struct ast_channel *chan)
Mark this unreal channel and it's other half as being internal to Stasis.
void stasis_app_control_inhibit_colp_in_bridge(struct stasis_app_control *control, int inhibit_colp)
Set whether COLP frames should be generated when joining the bridge.
int stasis_app_control_remove_channel_from_bridge(struct stasis_app_control *control, struct ast_bridge *bridge)
Remove a channel from the bridge.
struct ast_bridge * stasis_app_get_bridge(struct stasis_app_control *control)
Gets the bridge currently associated with a control object.
int stasis_app_control_bridge_features_init(struct stasis_app_control *control)
Initialize bridge features into a channel control.
int stasis_app_bridge_playback_channel_add(struct ast_bridge *bridge, struct ast_channel *chan, struct stasis_app_control *control)
Adds a channel to the list of ARI playback channels for bridges.
int stasis_app_bridge_set_var_reportable(const char *bridge_id, const char *variable, const char *value, int report_events)
Set or clear a variable on a bridge and control ARI event reporting for it.
struct stasis_app_control * stasis_app_control_find_by_channel_id(const char *channel_id)
Returns the handler for the channel with the given id.
struct ast_channel * stasis_app_bridge_playback_channel_find(struct ast_bridge *bridge)
Finds an existing ARI playback channel in a bridge.
int stasis_app_control_is_done(struct stasis_app_control *control)
Check if a control is marked as done.
struct ast_channel_snapshot * stasis_app_control_get_snapshot(const struct stasis_app_control *control)
Returns the most recent snapshot for the associated channel.
stasis_app_control_channel_result
Result codes used when adding/removing channels to/from bridges.
@ STASIS_APP_CHANNEL_RECORDING
@ STASIS_APP_CHANNEL_OKAY
struct stasis_app_control * stasis_app_control_find_by_channel(const struct ast_channel *chan)
Returns the handler for the given channel.
struct stasis_app_control * stasis_app_control_create(struct ast_channel *chan)
Creates a control handler for a channel that isn't in a stasis app.
int stasis_app_bridge_moh_stop(struct ast_bridge *bridge)
Breaks down MOH channels playing on the bridge created by stasis_app_bridge_moh_channel.
Backend API for implementing components of res_stasis.
int stasis_app_send_command(struct stasis_app_control *control, stasis_app_command_cb command, void *data, command_data_destructor_fn data_destructor)
Invokes a command on a control's channel.
Stasis Application Playback API. See StasisApplication API" for detailed documentation.
@ STASIS_PLAYBACK_TARGET_BRIDGE
struct stasis_app_playback * stasis_app_control_play_uri(struct stasis_app_control *control, const char **media, size_t media_count, const char *language, const char *target_id, enum stasis_app_playback_target_type target_type, int skipms, long offsetms, const char *id)
Play a file to the control's channel.
struct ast_json * stasis_app_playback_to_json(const struct stasis_app_playback *playback)
Convert a playback to its JSON representation.
const char * stasis_app_playback_get_id(struct stasis_app_playback *playback)
Gets the unique id of a playback object.
Stasis Application Recording API. See StasisApplication API" for detailed documentation.
struct stasis_app_recording_options * stasis_app_recording_options_create(const char *name, const char *format)
Allocate a recording options object.
struct ast_json * stasis_app_recording_to_json(const struct stasis_app_recording *recording)
Construct a JSON model of a recording.
struct stasis_app_recording * stasis_app_control_record(struct stasis_app_control *control, struct stasis_app_recording_options *options)
Record media from a channel.
enum ast_record_if_exists stasis_app_recording_if_exists_parse(const char *str)
Parse a string into the if_exists enum.
#define STASIS_APP_RECORDING_TERMINATE_INVALID
char stasis_app_recording_termination_parse(const char *str)
Parse a string into the recording termination enum.
int ast_bridge_topic_exists(const char *uniqueid)
Check if a stasis topic exists for a bridge uniqueid.
struct ast_json * ast_bridge_snapshot_to_json(const struct ast_bridge_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_bridge_snapshot.
struct ast_bridge_snapshot * ast_bridge_get_snapshot(struct ast_bridge *bridge)
Returns the current snapshot for the bridge.
struct ast_bridge_snapshot * ast_bridge_get_snapshot_by_uniqueid(const char *bridge_id)
Returns the current snapshot for the bridge.
struct ast_bridge_snapshot * ast_bridge_snapshot_create(struct ast_bridge *bridge)
Generate a snapshot of the bridge state. This is an ao2 object, so ao2_cleanup() to deallocate.
struct stasis_topic * ast_bridge_topic(struct ast_bridge *bridge)
A topic which publishes the events for a particular bridge.
#define ast_string_field_build(x, field, fmt, args...)
Set a field to a complex (built) value.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Structure that contains information regarding a channel in a bridge.
struct ast_bridge * bridge
Bridge this channel is participating in.
struct ast_bridge_channel::@201 entry
Structure that contains a snapshot of information about a bridge.
Structure that contains information about a bridge.
const ast_string_field uniqueid
struct ast_bridge_channels_list channels
unsigned int num_channels
struct ast_flags feature_flags
const ast_string_field language
Structure representing a snapshot of channel state.
struct ast_channel_snapshot_base * base
Main Channel structure associated with a channel.
struct ast_bridge_channel * bridge_channel
struct ast_channel_snapshot * snapshot
struct ast_bridge * bridge
struct stasis_forward * channel_forward
Data structure associated with a single frame of data.
enum ast_frame_type frametype
Iterator for JSON object key/values.
Abstract JSON element (object, array, string, int, ...).
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
struct ast_channel * bridge_channel
struct stasis_app_control * control
struct stasis_forward * forward
struct stasis_app_control * controls[]
struct ast_bridge * bridge
int error(const char *format,...)
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
char * ast_uri_encode(const char *string, char *outbuf, int buflen, struct ast_flags spec)
Turn text string to URI-encoded XX version.
const struct ast_flags ast_uri_http
#define ast_pthread_create_detached(a, b, c, d)