Asterisk - The Open Source Telephony Project
18.5.0
|
Stasis Messages and Data Types for Bridge Objects. More...
#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_cache_pattern.h"
#include "asterisk/channel.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_technology.h"
Go to the source code of this file.
Macros | |
#define | SNAPSHOT_CHANNELS_BUCKETS 1 |
Variables | |
static struct stasis_topic * | bridge_topic_all |
static struct stasis_topic_pool * | bridge_topic_pool |
static const char * | result_strs [] |
Stasis Messages and Data Types for Bridge Objects.
Definition in file stasis_bridges.c.
#define SNAPSHOT_CHANNELS_BUCKETS 1 |
Definition at line 44 of file stasis_bridges.c.
Referenced by ast_bridge_snapshot_create().
int ast_attended_transfer_message_add_app | ( | struct ast_attended_transfer_message * | transfer_msg, |
const char * | app, | ||
struct ast_channel * | replace_channel | ||
) |
Add details for an attended transfer to an application.
If the transfer is sending one or more parties into an application, then this should be called to add appropriate details to the transfer message being published.
transfer_msg | The message to add details to |
app | The name of the application that the parties are being transferred to |
replace_channel | The local channel that is in the bridge and running the application |
0 | Success |
-1 | Failure |
Definition at line 1313 of file stasis_bridges.c.
References ast_attended_transfer_message::app, AST_ATTENDED_TRANSFER_DEST_APP, AST_ATTENDED_TRANSFER_DEST_LOCAL_APP, ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_copy_string(), ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, and ast_attended_transfer_message::replace_channel.
Referenced by ast_bridge_transfer_attended(), and attended_transfer_bridge().
int ast_attended_transfer_message_add_link | ( | struct ast_attended_transfer_message * | transfer_msg, |
struct ast_channel * | locals[2] | ||
) |
Add details for an attended transfer that has a link between bridges.
An attended transfer may be accomplished by linking two bridges together with local channels. If this is how the transfer is to be completed, call this function in order to fill in details about the transfer.
transfer_msg | The message to add details to. |
locals | An array of local channel halves that each are in one of the involved bridges. |
0 | Success |
-1 | Failure |
Definition at line 1330 of file stasis_bridges.c.
References AST_ATTENDED_TRANSFER_DEST_LINK, ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, and ast_attended_transfer_message::links.
Referenced by attended_transfer_bridge().
int ast_attended_transfer_message_add_merge | ( | struct ast_attended_transfer_message * | transfer_msg, |
struct ast_bridge * | final_bridge | ||
) |
Add details for a bridge merge to an attended transfer message.
If the transfer is accomplished by a bridge merge (or swap optimization), then this should be called on the created attended transfer message to have the appropriate details added on.
transfer_msg | The transfer message to add details to |
final_bridge | The bridge where the surviving parties reside |
0 | Success |
-1 | Failure |
Definition at line 1283 of file stasis_bridges.c.
References AST_ATTENDED_TRANSFER_DEST_BRIDGE_MERGE, ast_copy_string(), ast_attended_transfer_message::bridge, ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, and ast_bridge::uniqueid.
Referenced by publish_transfer_success(), and two_bridge_attended_transfer().
int ast_attended_transfer_message_add_threeway | ( | struct ast_attended_transfer_message * | transfer_msg, |
struct ast_channel * | survivor_channel, | ||
struct ast_bridge * | survivor_bridge | ||
) |
Add details for an attended transfer that was resolved as a three-way call.
If the transfer results in a three-way call between the transferer, the transferee, and the transfer target, then this should be called in order to add appropriate details to the transfer message to be published.
transfer_msg | The message to add details to |
survivor_channel | The transferer channel that exists in the three-way call |
survivor_bridge | The bridge where the three-way call takes place. |
0 | Success |
-1 | Failure |
Definition at line 1293 of file stasis_bridges.c.
References AST_ATTENDED_TRANSFER_DEST_THREEWAY, ast_channel_uniqueid(), ast_channel_snapshot::base, ast_bridge_channel_snapshot_pair::bridge_snapshot, ast_bridge_channel_snapshot_pair::channel_snapshot, ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, ast_attended_transfer_message::threeway, ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, ast_channel_snapshot_base::uniqueid, ast_bridge_snapshot::uniqueid, and ast_bridge::uniqueid.
Referenced by publish_transfer_threeway().
struct ast_attended_transfer_message* ast_attended_transfer_message_create | ( | int | is_external, |
struct ast_channel * | to_transferee, | ||
struct ast_bridge * | transferee_bridge, | ||
struct ast_channel * | to_transfer_target, | ||
struct ast_bridge * | target_bridge, | ||
struct ast_channel * | transferee, | ||
struct ast_channel * | transfer_target | ||
) |
Create an Attended transfer message to be published.
The parameters to this function are the basic necessities in order to create the initial attended transfer message.
The transferee and transfer_target parameters are optional. If not provided, then this function will attempt to determine who the transferee and transfer target are based on the input transferer channels and bridges. You typically will not need to provide an explicit transferee and transfer target channel unless your attended transfer is implemented in a strange way.
is_external | Non-zero if the transfer was initiated by a native channel driver protocol. |
to_transferee | The transferer channel that is bridged to the transferee channel. |
transferee_bridge | The bridge between the transferer and transferee. May be NULL. |
to_transfer_target | The transferer channel that is bridged to the transfer target. |
target_bridge | The bridge between the transferer and transfer target. May be NULL. |
transferee | The channel that is being transferred. Optional. |
transfer_target | The channel that is being transferred to. Optional. |
NULL | Failure to allocate or create snapshots |
non-NULL | The created attended transfer message |
Definition at line 1226 of file stasis_bridges.c.
References ao2_alloc, ao2_cleanup, ast_bridge_peer(), ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), attended_transfer_dtor(), bridge_channel_snapshot_pair_init(), NULL, ast_attended_transfer_message::target, ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, and ast_attended_transfer_message::transferee.
Referenced by ast_bridge_transfer_attended(), publish_transfer_fail(), publish_transfer_success(), and publish_transfer_threeway().
struct ast_blind_transfer_message* ast_blind_transfer_message_create | ( | int | is_external, |
struct ast_channel * | transferer, | ||
const char * | exten, | ||
const char * | context | ||
) |
Create a blind transfer message to be published.
is_external | Whether the blind transfer was initiated externally (e.g. via AMI or native protocol) |
transferer | The transferer's channel that is bridged to the transferee |
bridge | The bridge the transferer and transferee are in |
context | The destination context for the blind transfer |
exten | The destination extension for the blind transfer |
NULL | Failure to allocate or create snapshots |
non-NULL | The created blind transfer message |
Definition at line 929 of file stasis_bridges.c.
References ao2_alloc, ao2_cleanup, ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_copy_string(), blind_transfer_dtor(), ast_blind_transfer_message::context, ast_blind_transfer_message::exten, ast_blind_transfer_message::is_external, NULL, and ast_blind_transfer_message::transferer.
Referenced by ast_bridge_transfer_blind(), and AST_TEST_DEFINE().
struct stasis_message* ast_bridge_blob_create | ( | struct stasis_message_type * | type, |
struct ast_bridge * | bridge, | ||
struct ast_channel * | chan, | ||
struct ast_json * | blob | ||
) |
Creates a ast_bridge_blob message.
"type"
field describing the blob. It should also be treated as immutable and not modified after it is put into the message.bridge | Channel blob is associated with, or NULL for global/all bridges. |
blob | JSON object representing the data. |
NULL
on error Definition at line 500 of file stasis_bridges.c.
References ao2_alloc, ao2_ref, ast_bridge_snapshot_create(), ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_json_ref(), ast_bridge_blob::blob, ast_bridge_blob::bridge, bridge_blob_dtor(), ast_bridge_blob::channel, NULL, and stasis_message_create().
Referenced by ast_bridge_publish_enter(), ast_bridge_publish_leave(), and send_conf_stasis().
struct stasis_message* ast_bridge_blob_create_from_snapshots | ( | struct stasis_message_type * | type, |
struct ast_bridge_snapshot * | bridge_snapshot, | ||
struct ast_channel_snapshot * | chan_snapshot, | ||
struct ast_json * | blob | ||
) |
Creates a ast_bridge_blob message from snapshots.
"type"
field describing the blob. It should also be treated as immutable and not modified after it is put into the message.bridge_snapshot | Bridge snapshot |
channel_snapshot | Channel snapshot |
blob | JSON object representing the data. |
NULL
on error Definition at line 546 of file stasis_bridges.c.
References ao2_alloc, ao2_bump, ao2_ref, ast_json_ref(), ast_bridge_blob::blob, ast_bridge_blob::bridge, bridge_blob_dtor(), ast_bridge_blob::channel, NULL, and stasis_message_create().
Referenced by send_conf_stasis_snapshots().
struct ast_bridge_snapshot* ast_bridge_get_snapshot | ( | struct ast_bridge * | bridge | ) |
Returns the current snapshot for the bridge.
The returned pointer is AO2 managed, so ao2_cleanup() when you're done.
bridge | The bridge from which to get the snapshot. |
NULL
if there isn't a snapshot. Definition at line 1378 of file stasis_bridges.c.
References ao2_bump, ast_bridge_lock, ast_bridge_unlock, ast_bridge::current_snapshot, and NULL.
Referenced by ast_ari_bridges_list(), bridges_scrape_cb(), handle_bridge_show_all(), send_bridge_list_item_cb(), and test_cel_generate_peer_str_snapshot().
struct ast_bridge_snapshot* ast_bridge_get_snapshot_by_uniqueid | ( | const char * | bridge_id | ) |
Returns the current snapshot for the bridge.
The returned pointer is AO2 managed, so ao2_cleanup() when you're done.
bridge_id | Uniqueid of the bridge from which to get the snapshot. |
NULL
if bridge or snapshot doesn't exist. Definition at line 1359 of file stasis_bridges.c.
References ao2_bump, ao2_ref, ast_assert, ast_bridge_find_by_id(), ast_bridge_lock, ast_bridge_unlock, ast_strlen_zero, ast_bridge::current_snapshot, and NULL.
Referenced by ast_ari_bridges_get(), find_bridge(), handle_bridge_show_specific(), manager_bridge_info(), and stasis_app_user_event().
|
static |
Definition at line 438 of file stasis_bridges.c.
References ast_bridge_snapshot_to_json(), ast_json_pack(), ast_json_timeval(), ast_json_unref(), ast_bridge_merge_message::from, NULL, stasis_message_data(), stasis_message_timestamp(), and ast_bridge_merge_message::to.
void ast_bridge_publish_attended_transfer | ( | struct ast_attended_transfer_message * | transfer_msg | ) |
Publish an attended transfer.
transfer_msg | The transfer message to publish |
Definition at line 1346 of file stasis_bridges.c.
References ao2_ref, ast_attended_transfer_type(), ast_bridge_topic_all(), stasis_message_create(), and stasis_publish().
Referenced by ast_bridge_transfer_attended(), publish_transfer_fail(), publish_transfer_success(), and publish_transfer_threeway().
void ast_bridge_publish_blind_transfer | ( | struct ast_blind_transfer_message * | transfer_message | ) |
Publish a blind transfer event.
is_external | Whether the blind transfer was initiated externally (e.g. via AMI or native protocol) |
result | The success or failure of the transfer |
to_transferee | The bridge between the transferer and transferee plus the transferer channel |
context | The destination context for the blind transfer |
exten | The destination extension for the blind transfer |
transferee_channel | If a single channel is being transferred, this is it. If multiple parties are being transferred, this is NULL. |
replace_channel | If multiple parties are being transferred or the transfer cannot reach across the bridge due to bridge flags, this is the channel connecting their bridge to the destination. |
Definition at line 953 of file stasis_bridges.c.
References ao2_cleanup, ast_blind_transfer_type(), ast_bridge_topic_all(), stasis, stasis_message_create(), and stasis_publish().
Referenced by ast_bridge_transfer_blind(), and AST_TEST_DEFINE().
void ast_bridge_publish_enter | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan, | ||
struct ast_channel * | swap | ||
) |
Publish a bridge channel enter event.
bridge | The bridge a channel entered |
chan | The channel that entered the bridge |
swap | The channel being swapped out of the bridge |
Definition at line 582 of file stasis_bridges.c.
References ao2_ref, ast_bridge_blob_create(), AST_BRIDGE_FLAG_INVISIBLE, ast_bridge_topic(), ast_channel_entered_bridge_type(), ast_channel_uniqueid(), ast_json_pack(), ast_json_unref(), ast_test_flag, bridge_publish_state_from_blob(), ast_bridge::feature_flags, NULL, stasis_message_data(), and stasis_publish().
Referenced by bridge_channel_internal_push_full().
void ast_bridge_publish_leave | ( | struct ast_bridge * | bridge, |
struct ast_channel * | chan | ||
) |
Publish a bridge channel leave event.
bridge | The bridge a channel left |
chan | The channel that left the bridge |
Definition at line 611 of file stasis_bridges.c.
References ao2_ref, ast_bridge_blob_create(), AST_BRIDGE_FLAG_INVISIBLE, ast_bridge_topic(), ast_channel_left_bridge_type(), ast_test_flag, bridge_publish_state_from_blob(), ast_bridge::feature_flags, NULL, stasis_message_data(), and stasis_publish().
Referenced by bridge_channel_internal_pull().
void ast_bridge_publish_merge | ( | struct ast_bridge * | to, |
struct ast_bridge * | from | ||
) |
Publish a bridge merge.
to | The bridge to which channels are being added |
from | The bridge from which channels are being removed |
Definition at line 460 of file stasis_bridges.c.
References ao2_ref, ast_assert, AST_BRIDGE_FLAG_INVISIBLE, ast_bridge_merge_message_type(), ast_bridge_topic_all(), ast_test_flag, bridge_merge_message_create(), ast_bridge::feature_flags, NULL, stasis_message_create(), and stasis_publish().
Referenced by bridge_do_merge().
void ast_bridge_publish_state | ( | struct ast_bridge * | bridge | ) |
Publish the state of a bridge.
bridge | The bridge for which to publish state |
Definition at line 350 of file stasis_bridges.c.
References ao2_cleanup, ao2_ref, ast_assert, ast_bridge_snapshot_create(), ast_bridge_snapshot_type(), ast_bridge_topic(), bridge_snapshot_update_create(), ast_bridge::current_snapshot, NULL, stasis_message_create(), stasis_publish(), and update().
Referenced by ast_bridge_set_single_src_video_mode(), ast_bridge_update_talker_src_video_mode(), bridge_reconfigured(), and bridge_register().
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.
bridge | The bridge from which to generate a snapshot |
AO2 | refcounted snapshot on success |
NULL | on error |
Definition at line 202 of file stasis_bridges.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_ref, AST_BRIDGE_FLAG_INVISIBLE, AST_BRIDGE_VIDEO_MODE_SINGLE_SRC, AST_BRIDGE_VIDEO_MODE_TALKER_SRC, ast_channel_uniqueid(), AST_LIST_TRAVERSE, ast_str_container_add(), ast_str_container_alloc, ast_string_field_init, ast_string_field_set, ast_test_flag, bridge_snapshot_dtor(), ast_bridge_technology::capabilities, ast_bridge_snapshot::capabilities, ast_bridge_channel::chan, ast_bridge_video_single_src_data::chan_vsrc, ast_bridge_video_talker_src_data::chan_vsrc, ast_bridge_snapshot::channels, ast_bridge::channels, ast_bridge_snapshot::creationtime, ast_bridge::creationtime, ast_bridge::creator, ast_bridge_snapshot::feature_flags, ast_bridge::feature_flags, ast_bridge_video_mode::mode, ast_bridge_video_mode::mode_data, ast_bridge_technology::name, name, ast_bridge_methods::name, ast_bridge::name, NULL, ast_bridge_snapshot::num_active, ast_bridge::num_active, ast_bridge_snapshot::num_channels, ast_bridge::num_channels, ast_bridge_video_mode::single_src_data, SNAPSHOT_CHANNELS_BUCKETS, ast_bridge::softmix, ast_bridge_video_mode::talker_src_data, ast_bridge::technology, ast_bridge::uniqueid, ast_bridge::v_table, ast_bridge_softmix::video_mode, and ast_bridge_snapshot::video_mode.
Referenced by ast_ari_bridges_create(), ast_ari_bridges_create_with_id(), ast_bridge_blob_create(), ast_bridge_publish_state(), ast_bridge_transfer_blind(), AST_TEST_DEFINE(), bridge_channel_snapshot_pair_init(), bridge_merge_message_create(), bridge_topics_destroy(), and send_conf_stasis_snapshots().
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.
snapshot | The bridge snapshot to convert to JSON |
sanitize | The message sanitizer to use on the snapshot |
NULL
on error Definition at line 712 of file stasis_bridges.c.
References AST_BRIDGE_VIDEO_MODE_NONE, ast_bridge_video_mode_to_string(), ast_json_object_set(), ast_json_pack(), ast_json_string_create(), ast_json_timeval(), ast_strlen_zero, ast_bridge_snapshot::capabilities, capability2str(), ast_bridge_snapshot::channels, container_to_json_array(), ast_bridge_snapshot::creationtime, ast_bridge_snapshot::creator, ast_bridge_snapshot::name, NULL, ast_bridge_snapshot::subclass, ast_bridge_snapshot::technology, ast_bridge_snapshot::uniqueid, ast_bridge_snapshot::video_mode, and ast_bridge_snapshot::video_source_id.
Referenced by ast_ari_bridges_create(), ast_ari_bridges_create_with_id(), ast_ari_bridges_get(), ast_ari_bridges_list(), ast_bridge_merge_message_to_json(), attended_transfer_to_json(), blind_transfer_to_json(), bridge_to_json(), multi_user_event_to_json(), simple_bridge_channel_event(), and simple_bridge_event().
struct stasis_topic* ast_bridge_topic | ( | struct ast_bridge * | bridge | ) |
A topic which publishes the events for a particular bridge.
NULL
, ast_bridge_topic_all() is returned.bridge | Bridge for which to get a topic or NULL . |
Topic | for bridge's events. |
ast_bridge_topic_all() | if bridge is NULL . |
Definition at line 184 of file stasis_bridges.c.
References ast_bridge_topic_all(), and ast_bridge::topic.
Referenced by ari_bridges_play_new(), ast_ari_bridges_record(), ast_bridge_publish_enter(), ast_bridge_publish_leave(), ast_bridge_publish_state(), bridge_base_init(), bridge_publish_state_from_blob(), bridge_topics_destroy(), forwards_create_bridge(), send_conf_stasis(), and send_conf_stasis_snapshots().
struct stasis_topic* ast_bridge_topic_all | ( | void | ) |
A topic which publishes the events for all bridges.
Topic | for all bridge events. |
Definition at line 179 of file stasis_bridges.c.
References bridge_topic_all.
Referenced by app_create(), ast_bridge_publish_attended_transfer(), ast_bridge_publish_blind_transfer(), ast_bridge_publish_merge(), ast_bridge_topic(), create_subscriptions(), manager_bridging_init(), manager_confbridge_init(), refer_blind_callback(), and setup_stasis_subs().
|
static |
Definition at line 653 of file stasis_bridges.c.
References ast_bridge_blob::bridge, ast_bridge_blob::channel, simple_bridge_channel_event(), stasis_message_data(), and stasis_message_timestamp().
|
static |
Definition at line 663 of file stasis_bridges.c.
References ast_bridge_blob::bridge, ast_bridge_blob::channel, simple_bridge_channel_event(), stasis_message_data(), and stasis_message_timestamp().
int ast_stasis_bridging_init | ( | void | ) |
Definition at line 1407 of file stasis_bridges.c.
References ast_attended_transfer_type(), ast_blind_transfer_type(), ast_bridge_merge_message_type(), ast_bridge_snapshot_type(), ast_channel_entered_bridge_type(), ast_channel_left_bridge_type(), ast_register_cleanup(), stasis_bridging_cleanup(), STASIS_MESSAGE_TYPE_INIT, stasis_topic_create(), and stasis_topic_pool_create().
Referenced by ast_bridging_init().
|
static |
Definition at line 1206 of file stasis_bridges.c.
References ao2_cleanup, ARRAY_LEN, AST_ATTENDED_TRANSFER_DEST_LINK, bridge_channel_snapshot_pair_cleanup(), ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, ast_attended_transfer_message::links, ast_attended_transfer_message::replace_channel, ast_attended_transfer_message::target, ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, and ast_attended_transfer_message::transferee.
Referenced by ast_attended_transfer_message_create().
|
static |
Definition at line 1103 of file stasis_bridges.c.
References ast_attended_transfer_message::app, AST_ATTENDED_TRANSFER_DEST_APP, AST_ATTENDED_TRANSFER_DEST_BRIDGE_MERGE, AST_ATTENDED_TRANSFER_DEST_FAIL, AST_ATTENDED_TRANSFER_DEST_LINK, AST_ATTENDED_TRANSFER_DEST_LOCAL_APP, AST_ATTENDED_TRANSFER_DEST_THREEWAY, ast_free_ptr(), ast_manager_build_bridge_state_string_prefix(), ast_manager_build_channel_state_string_prefix(), ast_manager_event_blob_create(), ast_str_append(), ast_str_buffer(), ast_str_create, ast_channel_snapshot::base, ast_attended_transfer_message::bridge, ast_bridge_channel_snapshot_pair::bridge_snapshot, ast_bridge_channel_snapshot_pair::channel_snapshot, ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, EVENT_FLAG_CALL, ast_attended_transfer_message::is_external, ast_attended_transfer_message::links, ast_channel_snapshot_base::name, NULL, RAII_VAR, ast_attended_transfer_message::result, result_strs, stasis_message_data(), ast_attended_transfer_message::target, ast_attended_transfer_message::threeway, ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, ast_attended_transfer_message::transferee, and ast_bridge_snapshot::uniqueid.
|
static |
Definition at line 967 of file stasis_bridges.c.
References ast_attended_transfer_message::app, AST_ATTENDED_TRANSFER_DEST_APP, AST_ATTENDED_TRANSFER_DEST_BRIDGE_MERGE, AST_ATTENDED_TRANSFER_DEST_FAIL, AST_ATTENDED_TRANSFER_DEST_LINK, AST_ATTENDED_TRANSFER_DEST_LOCAL_APP, AST_ATTENDED_TRANSFER_DEST_THREEWAY, ast_bridge_snapshot_to_json(), ast_channel_snapshot_to_json(), ast_json_boolean(), ast_json_object_set(), ast_json_pack(), ast_json_ref(), ast_json_string_create(), ast_json_timeval(), ast_json_unref(), ast_attended_transfer_message::bridge, ast_bridge_channel_snapshot_pair::bridge_snapshot, ast_bridge_channel_snapshot_pair::channel_snapshot, ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, ast_attended_transfer_message::is_external, ast_attended_transfer_message::links, NULL, out, RAII_VAR, ast_attended_transfer_message::replace_channel, ast_attended_transfer_message::result, result_strs, stasis_message_data(), stasis_message_timestamp(), ast_attended_transfer_message::target, ast_attended_transfer_message::threeway, ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, and ast_attended_transfer_message::transferee.
|
static |
Definition at line 919 of file stasis_bridges.c.
References ao2_cleanup, ast_blind_transfer_message::bridge, ast_blind_transfer_message::replace_channel, ast_blind_transfer_message::transferee, and ast_blind_transfer_message::transferer.
Referenced by ast_blind_transfer_message_create().
|
static |
Definition at line 870 of file stasis_bridges.c.
References ast_free_ptr(), ast_manager_build_bridge_state_string(), ast_manager_build_channel_state_string_prefix(), ast_manager_event_blob_create(), ast_str_buffer(), ast_blind_transfer_message::bridge, ast_blind_transfer_message::context, EVENT_FLAG_CALL, ast_blind_transfer_message::exten, ast_blind_transfer_message::is_external, NULL, RAII_VAR, ast_blind_transfer_message::result, result_strs, stasis_message_data(), ast_blind_transfer_message::transferee, and ast_blind_transfer_message::transferer.
|
static |
Definition at line 799 of file stasis_bridges.c.
References ast_bridge_snapshot_to_json(), ast_channel_snapshot_to_json(), ast_json_boolean(), ast_json_object_set(), ast_json_pack(), ast_json_timeval(), ast_json_unref(), ast_blind_transfer_message::bridge, ast_blind_transfer_message::context, ast_blind_transfer_message::exten, ast_blind_transfer_message::is_external, NULL, out, ast_blind_transfer_message::replace_channel, ast_blind_transfer_message::result, result_strs, stasis_message_data(), stasis_message_timestamp(), ast_blind_transfer_message::transferee, and ast_blind_transfer_message::transferer.
|
static |
Definition at line 489 of file stasis_bridges.c.
References ao2_cleanup, ast_json_unref(), and NULL.
Referenced by ast_bridge_blob_create(), and ast_bridge_blob_create_from_snapshots().
|
static |
Definition at line 786 of file stasis_bridges.c.
References ao2_cleanup, ast_bridge_channel_snapshot_pair::bridge_snapshot, and ast_bridge_channel_snapshot_pair::channel_snapshot.
Referenced by attended_transfer_dtor().
|
static |
Definition at line 760 of file stasis_bridges.c.
References ast_bridge_lock, ast_bridge_snapshot_create(), ast_bridge_unlock, ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_bridge_channel_snapshot_pair::bridge_snapshot, and ast_bridge_channel_snapshot_pair::channel_snapshot.
Referenced by ast_attended_transfer_message_create().
|
static |
Bridge merge message creation helper.
Definition at line 418 of file stasis_bridges.c.
References ao2_alloc, ao2_ref, ast_bridge_snapshot_create(), bridge_merge_message_dtor(), ast_bridge_merge_message::from, NULL, and ast_bridge_merge_message::to.
Referenced by ast_bridge_publish_merge().
|
static |
Destructor for bridge merge messages.
Definition at line 407 of file stasis_bridges.c.
References ao2_cleanup, ast_bridge_merge_message::from, NULL, and ast_bridge_merge_message::to.
Referenced by bridge_merge_message_create().
|
static |
Definition at line 381 of file stasis_bridges.c.
References ao2_bump, ao2_cleanup, ao2_ref, ast_assert, ast_bridge_snapshot_type(), ast_bridge_topic(), ast_bridge_blob::bridge, bridge_snapshot_update_create(), ast_bridge::current_snapshot, NULL, stasis_message_create(), stasis_publish(), and update().
Referenced by ast_bridge_publish_enter(), and ast_bridge_publish_leave().
|
static |
Destructor for bridge snapshots.
Definition at line 194 of file stasis_bridges.c.
References ao2_cleanup, ast_string_field_free_memory, ast_bridge_snapshot::channels, and NULL.
Referenced by ast_bridge_snapshot_create().
|
static |
Definition at line 275 of file stasis_bridges.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ast_debug, bridge_snapshot_update_dtor(), ast_bridge_snapshot_update::new_snapshot, NULL, ast_bridge_snapshot_update::old_snapshot, ast_bridge_snapshot::uniqueid, and update().
Referenced by ast_bridge_publish_state(), bridge_publish_state_from_blob(), and bridge_topics_destroy().
|
static |
Definition at line 264 of file stasis_bridges.c.
References ao2_cleanup, ast_debug, ast_bridge_snapshot_update::new_snapshot, ast_bridge_snapshot_update::old_snapshot, ast_bridge_snapshot::uniqueid, and update().
Referenced by bridge_snapshot_update_create().
void bridge_topics_destroy | ( | struct ast_bridge * | bridge | ) |
Definition at line 319 of file stasis_bridges.c.
References ao2_ref, ast_assert, ast_bridge_snapshot_create(), ast_bridge_snapshot_type(), ast_bridge_topic(), bridge_snapshot_update_create(), ast_bridge::current_snapshot, NULL, stasis_message_create(), stasis_publish(), stasis_topic_name(), stasis_topic_pool_delete_topic(), and update().
Referenced by destroy_bridge().
int bridge_topics_init | ( | struct ast_bridge * | bridge | ) |
Definition at line 295 of file stasis_bridges.c.
References ast_asprintf, ast_free, ast_log, ast_strlen_zero, LOG_ERROR, stasis_topic_pool_get_topic(), ast_bridge::topic, and ast_bridge::uniqueid.
Referenced by bridge_base_init().
|
static |
Definition at line 703 of file stasis_bridges.c.
References AST_BRIDGE_CAPABILITY_HOLDING.
Referenced by ast_bridge_snapshot_to_json().
|
static |
Definition at line 673 of file stasis_bridges.c.
References ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ast_json_array_append(), ast_json_array_create(), ast_json_string_create(), ast_json_unref(), stasis_message_sanitizer::channel_id, item, and NULL.
Referenced by ast_bridge_snapshot_to_json().
|
static |
Definition at line 629 of file stasis_bridges.c.
References ast_bridge_snapshot_to_json(), ast_channel_snapshot_to_json(), ast_json_pack(), ast_json_timeval(), ast_json_unref(), and NULL.
Referenced by ast_channel_entered_bridge_to_json(), and ast_channel_left_bridge_to_json().
|
static |
Definition at line 1392 of file stasis_bridges.c.
References ao2_cleanup, ast_attended_transfer_type(), ast_blind_transfer_type(), ast_bridge_merge_message_type(), ast_bridge_snapshot_type(), ast_channel_entered_bridge_type(), ast_channel_left_bridge_type(), NULL, and STASIS_MESSAGE_TYPE_CLEANUP.
Referenced by ast_stasis_bridging_init().
STASIS_MESSAGE_TYPE_DEFN | ( | ast_bridge_snapshot_type | ) |
Define bridge message types.
STASIS_MESSAGE_TYPE_DEFN | ( | ast_bridge_merge_message_type | , |
. | to_json = ast_bridge_merge_message_to_json |
||
) |
STASIS_MESSAGE_TYPE_DEFN | ( | ast_channel_entered_bridge_type | , |
. | to_json = ast_channel_entered_bridge_to_json |
||
) |
STASIS_MESSAGE_TYPE_DEFN | ( | ast_channel_left_bridge_type | , |
. | to_json = ast_channel_left_bridge_to_json |
||
) |
STASIS_MESSAGE_TYPE_DEFN | ( | ast_blind_transfer_type | , |
. | to_json = blind_transfer_to_json , |
||
. | to_ami = blind_transfer_to_ami |
||
) |
STASIS_MESSAGE_TYPE_DEFN | ( | ast_attended_transfer_type | , |
. | to_json = attended_transfer_to_json , |
||
. | to_ami = attended_transfer_to_ami |
||
) |
|
static |
Definition at line 158 of file stasis_bridges.c.
Referenced by ast_bridge_topic_all().
|
static |
Definition at line 159 of file stasis_bridges.c.
|
static |
Definition at line 792 of file stasis_bridges.c.
Referenced by attended_transfer_to_ami(), attended_transfer_to_json(), blind_transfer_to_ami(), and blind_transfer_to_json().