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",
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) {
void confbridge_handle_atxfer(struct ast_attended_transfer_message *msg)
Create join/leave events for attended transfers.
struct confbridge_conference * conf_find_bridge(const char *conference_name)
Find a confbridge by name.
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
@ AST_BRIDGE_TRANSFER_SUCCESS
int ast_bridge_channel_queue_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *fr)
Write a frame to the specified bridge_channel.
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
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.
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type
struct stasis_message_type * confbridge_talking_type(void)
get the confbridge talking stasis message type
struct stasis_message_type * confbridge_stop_record_type(void)
get the confbridge stop_record stasis message type
struct stasis_message_type * confbridge_end_type(void)
get the confbridge end stasis message type
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
struct stasis_message_type * confbridge_welcome_type(void)
get the confbridge welcome stasis message type
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
struct stasis_message_type * confbridge_unmute_type(void)
get the confbridge unmute stasis message type
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave stasis message type
static void confbridge_unmute_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
int manager_confbridge_init(void)
register stasis message routers to handle manager events for confbridge messages
static void confbridge_start_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int get_muted_header(struct ast_str **extra_text, struct stasis_message *message)
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
static void confbridge_atxfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
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 * bridge_state_router
static struct ast_json * bridge_to_json(struct ast_bridge_snapshot *bridge_snapshot)
static struct ast_json * channel_to_json(struct ast_channel_snapshot *channel_snapshot, struct ast_json *conf_blob, struct ast_json *labels_blob)
void manager_confbridge_shutdown(void)
unregister stasis message routers to handle manager events for confbridge messages
static void confbridge_stop_record_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_end_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_leave_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_start_record_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
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)
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)
static void confbridge_talking_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_join_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
STASIS_MESSAGE_TYPE_DEFN(confbridge_start_type)
static struct stasis_message_router * channel_state_router
static void send_message(const char *msg_name, char *conf_name, struct ast_json *json_object, struct ast_channel *chan)
static int get_bool_header(struct ast_str **extra_text, struct stasis_message *message, const char *json_key, const char *ami_header)
static struct ast_json * pack_bridge_and_channels(struct ast_json *json_bridge, struct ast_json *json_channels, struct stasis_message *msg)
static void confbridge_mute_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
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_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.
size_t ast_msg_data_get_length(struct ast_msg_data *msg)
Get length of the structure.
@ AST_MSG_DATA_ATTR_CONTENT_TYPE
@ AST_MSG_DATA_SOURCE_TYPE_IN_DIALOG
#define ast_debug(level,...)
Log a DEBUG message.
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.
void ast_json_free(void *p)
Asterisk's custom JSON allocator. Exposed for use by unit tests.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_timeval(const struct timeval tv, const char *zone)
Construct a timeval as JSON.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
int ast_json_object_del(struct ast_json *object, const char *key)
Delete a field from a JSON object.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
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_copy(const struct ast_json *value)
Copy a JSON value, but not its children.
int ast_json_is_true(const struct ast_json *value)
Check if value is JSON true.
int ast_json_object_update(struct ast_json *object, struct ast_json *other)
Update object with all of the fields of other.
int ast_json_string_set(struct ast_json *string, const char *value)
Change the value of a JSON string.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
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
struct ast_str * ast_manager_build_bridge_state_string(const struct ast_bridge_snapshot *snapshot)
Generate the AMI message body from a bridge snapshot.
Out-of-call text message support.
struct stasis_forward * sub
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
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 stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
struct stasis_topic * ast_bridge_topic_all(void)
A topic which publishes the events for all bridges.
@ AST_ATTENDED_TRANSFER_DEST_APP
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.
#define stasis_message_router_create(topic)
Create a new message router object.
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic.
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.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define AST_YESNO(x)
return Yes or No depending on the argument.
Message representing attended transfer.
union ast_attended_transfer_message::@284 dest
enum ast_attended_transfer_dest_type dest_type
enum ast_transfer_result result
Blob of data associated with a bridge.
struct ast_bridge_snapshot * bridge
struct ast_channel_snapshot * channel
Structure that contains information regarding a channel in a bridge.
Structure that contains a snapshot of information about a bridge.
Structure representing a snapshot of channel state.
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
union ast_frame::@226 data
enum ast_frame_type frametype
Abstract JSON element (object, array, string, int, ...).
enum ast_msg_data_attribute_type type
Structure used to transport a message through the frame core.
Support for dynamic strings.
The structure that represents a conference bridge.
struct confbridge_conference::@94 active_list
The structure that represents a conference bridge user.
struct confbridge_conference * conference
struct confbridge_user::@98 list
struct ast_channel * chan
struct user_profile u_profile
char name[MAX_PROFILE_NAME]
structure to hold users read from users.conf
#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.