252 return "ConfbridgeStart";
254 return "ConfbridgeEnd";
256 return "ConfbridgeJoin";
258 return "ConfbridgeLeave";
260 return "ConfbridgeRecord";
262 return "ConfbridgeStopRecord";
264 return "ConfbridgeMute";
266 return "ConfbridgeUnmute";
268 return "ConfbridgeTalking";
270 return "ConfbridgeWelcome";
336 "{s: s, s: o, s: o, s: o }" :
"{s: s, s: o, s: o, s: [ o ] }";
341 "bridge", json_bridge,
342 "channels", json_channels);
353 json_channel =
channel_to_json(channel_snapshot, conf_blob, labels_blob);
380 ast_log(
LOG_ERROR,
"Unable to convert json_object for %s message to string\n", msg_name);
383 attrs[2].
value = json;
387 ast_log(
LOG_ERROR,
"Unable to create %s message for channel '%s'\n", msg_name,
393 memset(&f, 0,
sizeof(f));
420 int source_send_events = 0;
421 int source_echo_events = 0;
426 ast_debug(3,
"Distributing %s event to participants\n", msg_name);
437 ast_debug(3,
"send_events: %d echo_events: %d for profile %s\n",
438 source_send_events, source_echo_events, u_profile.
name);
452 struct ast_json *target_json_channel;
455 if (!target_snapshot) {
464 if (!json_channels) {
466 if (!json_channels) {
477 if (!source_echo_events && user->
chan == chan) {
478 ast_debug(3,
"Skipping queueing %s message to '%s'. Same channel.\n", msg_name,
485 ast_debug(3,
"Skipping queueing %s message to '%s'. Not receiving events.\n", msg_name,
506 if (source_send_events && json_channels
515 ast_log(
LOG_ERROR,
"Unable to convert ConfbridgeWelcome message to json\n");
531 const char *conference_name;
565 const char *json_key,
const char *ami_header)
639 && strcmp(msg->
dest.
app,
"ConfBridge") == 0) {
684 if (!talking_status) {
710 if (bridge_state_router) {
712 bridge_state_router =
NULL;
715 if (channel_state_router) {
717 channel_state_router =
NULL;
737 if (!bridge_state_router) {
815 if (!channel_state_router) {
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
size_t ast_msg_data_get_length(struct ast_msg_data *msg)
Get length of the structure.
Main Channel structure associated with a channel.
union ast_attended_transfer_message::@324 dest
Asterisk main include file. File version handling, generic pbx functions.
int manager_confbridge_init(void)
register stasis message routers to handle manager events for confbridge messages
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_channel * chan
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
static void confbridge_talking_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
enum ast_msg_data_attribute_type type
Message representing attended transfer.
struct ast_channel_snapshot * channel
static void confbridge_start_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
#define ast_test_flag(p, flag)
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int stasis_message_router_add(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route to a message router.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
int ast_json_object_update(struct ast_json *object, struct ast_json *other)
Update object with all of the fields of other.
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
static void confbridge_join_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
int ast_json_object_del(struct ast_json *object, const char *key)
Delete a field from a JSON object.
void ast_json_free(void *p)
Asterisk's custom JSON allocator. Exposed for use by unit tests.
Structure that contains a snapshot of information about a bridge.
const struct user_profile * conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result)
find a user profile given a user profile's name and store that profile in result structure.
static void confbridge_start_record_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
int ast_json_is_true(const struct ast_json *value)
Check if value is JSON true.
static void confbridge_stop_record_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
STASIS_MESSAGE_TYPE_DEFN(confbridge_start_type)
Structure representing a snapshot of channel state.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
Structure used to transport a message through the frame core.
struct ast_msg_data * ast_msg_data_alloc(enum ast_msg_data_source_type source, struct ast_msg_data_attribute attributes[], size_t count)
Allocates an ast_msg_data structure.
struct confbridge_user::@94 list
void confbridge_handle_atxfer(struct ast_attended_transfer_message *msg)
Create join/leave events for attended transfers.
static int get_muted_header(struct ast_str **extra_text, struct stasis_message *message)
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
Out-of-call text message support.
struct confbridge_conference::@90 active_list
static void confbridge_mute_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave stasis message type
struct ast_bridge_snapshot * bridge
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
#define ast_debug(level,...)
Log a DEBUG message.
enum ast_transfer_result result
static struct ast_json * pack_snapshots(struct ast_bridge_snapshot *bridge_snapshot, struct ast_channel_snapshot *channel_snapshot, struct ast_json *conf_blob, struct ast_json *labels_blob, struct stasis_message *msg)
General Asterisk PBX channel definitions.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
#define ao2_ref(o, delta)
static void confbridge_atxfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_str * ast_manager_build_bridge_state_string(const struct ast_bridge_snapshot *snapshot)
Generate the AMI message body from a bridge snapshot.
Blob of data associated with a bridge.
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
char * ast_json_dump_string_format(struct ast_json *root, enum ast_json_encoding_format format)
Encode a JSON value to a string.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct stasis_message_type * confbridge_stop_record_type(void)
get the confbridge stop_record stasis message type
#define stasis_message_router_create(topic)
struct ast_json * ast_json_timeval(const struct timeval tv, const char *zone)
Construct a timeval as JSON.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
enum ast_attended_transfer_dest_type dest_type
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static void confbridge_end_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
struct stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
void manager_confbridge_shutdown(void)
unregister stasis message routers to handle manager events for confbridge messages ...
struct ast_json * ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_channel_snapshot.
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
The structure that represents a conference bridge.
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
void conf_send_event_to_participants(struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message *msg)
Send events to bridge participants.
static struct stasis_message_router * channel_state_router
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
static struct stasis_message_router * bridge_state_router
struct stasis_topic * ast_bridge_topic_all(void)
A topic which publishes the events for all bridges.
struct stasis_message_type * confbridge_end_type(void)
get the confbridge end stasis message type
int ast_bridge_channel_queue_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *fr)
Write a frame to the specified bridge_channel.
#define AST_YESNO(x)
return Yes or No depending on the argument.
Structure that contains information regarding a channel in a bridge.
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...
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
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.
const char * ast_channel_name(const struct ast_channel *chan)
char name[MAX_PROFILE_NAME]
struct stasis_message_type * confbridge_welcome_type(void)
get the confbridge welcome stasis message type
static struct ast_json * channel_to_json(struct ast_channel_snapshot *channel_snapshot, struct ast_json *conf_blob, struct ast_json *labels_blob)
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic.
struct confbridge_conference * conf_find_bridge(const char *conference_name)
Find a confbridge by name.
struct stasis_forward * sub
Data structure associated with a single frame of data.
struct stasis_message_type * confbridge_talking_type(void)
get the confbridge talking stasis message type
struct stasis_message_type * confbridge_unmute_type(void)
get the confbridge unmute stasis message type
Abstract JSON element (object, array, string, int, ...).
The structure that represents a conference bridge user.
static struct ast_json * bridge_to_json(struct ast_bridge_snapshot *bridge_snapshot)
union ast_frame::@263 data
enum ast_frame_type frametype
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type
struct user_profile u_profile
int ast_json_string_set(struct ast_json *string, const char *value)
Change the value of a JSON string.
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
int ast_str_append_event_header(struct ast_str **fields_string, const char *header, const char *value)
append an event header to an ast string
static struct ast_json * pack_bridge_and_channels(struct ast_json *json_bridge, struct ast_json *json_channels, struct stasis_message *msg)
struct ast_json * ast_json_copy(const struct ast_json *value)
Copy a JSON value, but not its children.
static void send_message(const char *msg_name, char *conf_name, struct ast_json *json_object, struct ast_channel *chan)
static void confbridge_unmute_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int get_bool_header(struct ast_str **extra_text, struct stasis_message *message, const char *json_key, const char *ami_header)
static void confbridge_leave_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)