Asterisk - The Open Source Telephony Project  GIT-master-09303e8
Functions | Variables
confbridge_manager.c File Reference

Confbridge manager events for stasis messages. More...

#include "asterisk.h"
#include "asterisk/channel.h"
#include "asterisk/bridge.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/manager.h"
#include "asterisk/stasis_message_router.h"
#include "include/confbridge.h"
#include "asterisk/message.h"
#include "asterisk/stream.h"

Go to the source code of this file.

Functions

static struct ast_jsonbridge_to_json (struct ast_bridge_snapshot *bridge_snapshot)
 
static struct ast_jsonchannel_to_json (struct ast_channel_snapshot *channel_snapshot, struct ast_json *conf_blob, struct ast_json *labels_blob)
 
void conf_send_event_to_participants (struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message *msg)
 Send events to bridge participants. More...
 
static void confbridge_atxfer_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)
 
const char * confbridge_event_type_to_string (struct stasis_message_type *event_type)
 Get the string representation of a confbridge stasis message type. More...
 
static void confbridge_join_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_mute_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message)
 
static void confbridge_publish_manager_event (struct stasis_message *message, struct ast_str *extra_text)
 
static void confbridge_start_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 void confbridge_stop_record_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message)
 
static void confbridge_talking_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message)
 
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)
 
static int get_bool_header (struct ast_str **extra_text, struct stasis_message *message, const char *json_key, const char *ami_header)
 
static int get_muted_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 More...
 
void manager_confbridge_shutdown (void)
 unregister stasis message routers to handle manager events for confbridge messages More...
 
static struct ast_jsonpack_bridge_and_channels (struct ast_json *json_bridge, struct ast_json *json_channels, struct stasis_message *msg)
 
static struct ast_jsonpack_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 send_message (const char *msg_name, char *conf_name, struct ast_json *json_object, struct ast_channel *chan)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_start_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_end_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_join_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_leave_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_start_record_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_stop_record_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_mute_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_unmute_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_talking_type)
 
 STASIS_MESSAGE_TYPE_DEFN (confbridge_welcome_type)
 

Variables

static struct stasis_message_routerbridge_state_router
 
static struct stasis_message_routerchannel_state_router
 

Detailed Description

Confbridge manager events for stasis messages.

Author
Jonathan Rose jrose.nosp@m.@dig.nosp@m.ium.c.nosp@m.om

Definition in file confbridge_manager.c.

Function Documentation

◆ bridge_to_json()

static struct ast_json* bridge_to_json ( struct ast_bridge_snapshot bridge_snapshot)
static

Definition at line 311 of file confbridge_manager.c.

References ast_bridge_snapshot_to_json(), ast_json_object_del(), and NULL.

Referenced by conf_send_event_to_participants(), and pack_snapshots().

312 {
313  struct ast_json *json_bridge = ast_bridge_snapshot_to_json(bridge_snapshot, NULL);
314 
315  if (!json_bridge) {
316  return NULL;
317  }
318 
319  /* These items have no use in the context of bridge participant info. */
320  ast_json_object_del(json_bridge, "technology");
321  ast_json_object_del(json_bridge, "bridge_type");
322  ast_json_object_del(json_bridge, "bridge_class");
323  ast_json_object_del(json_bridge, "creator");
324  ast_json_object_del(json_bridge, "channels");
325 
326  return json_bridge;
327 }
int ast_json_object_del(struct ast_json *object, const char *key)
Delete a field from a JSON object.
Definition: json.c:408
#define NULL
Definition: resample.c:96
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.
Abstract JSON element (object, array, string, int, ...).

◆ channel_to_json()

static struct ast_json* channel_to_json ( struct ast_channel_snapshot channel_snapshot,
struct ast_json conf_blob,
struct ast_json labels_blob 
)
static

Definition at line 276 of file confbridge_manager.c.

References ast_channel_snapshot_to_json(), ast_json_copy(), ast_json_object_del(), ast_json_object_update(), ast_json_unref(), and NULL.

Referenced by conf_send_event_to_participants(), and pack_snapshots().

278 {
279  struct ast_json *json_channel = ast_channel_snapshot_to_json(channel_snapshot, NULL);
280 
281  if (!json_channel) {
282  return NULL;
283  }
284 
285  /* These items are removed for privacy reasons. */
286  ast_json_object_del(json_channel, "dialplan");
287  ast_json_object_del(json_channel, "connected");
288  ast_json_object_del(json_channel, "accountcode");
289 
290  /* conf_blob contains flags such as talking, admin, mute, etc. */
291  if (conf_blob) {
292  struct ast_json *conf_copy = ast_json_copy(conf_blob);
293 
294  if (!conf_copy) {
295  ast_json_unref(json_channel);
296  return NULL;
297  }
298  ast_json_object_del(conf_copy, "conference");
299  ast_json_object_update(json_channel, conf_copy);
300  ast_json_unref(conf_copy);
301  }
302 
303  /* labels_blob contains the msid labels to correlate to streams. */
304  if (labels_blob) {
305  ast_json_object_update(json_channel, labels_blob);
306  }
307 
308  return json_channel;
309 }
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
Definition: json.c:73
int ast_json_object_update(struct ast_json *object, struct ast_json *other)
Update object with all of the fields of other.
Definition: json.c:416
int ast_json_object_del(struct ast_json *object, const char *key)
Delete a field from a JSON object.
Definition: json.c:408
#define NULL
Definition: resample.c:96
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.
Abstract JSON element (object, array, string, int, ...).
struct ast_json * ast_json_copy(const struct ast_json *value)
Copy a JSON value, but not its children.
Definition: json.c:616

◆ conf_send_event_to_participants()

void conf_send_event_to_participants ( struct confbridge_conference conference,
struct ast_channel chan,
struct stasis_message msg 
)

Send events to bridge participants.

Since
15.7
16.1
Parameters
conferenceThe conference bridge
chanThe channel triggering the action
msgThe stasis message describing the event

Definition at line 414 of file confbridge_manager.c.

References confbridge_conference::active_list, ao2_lock, ao2_ref, ao2_unlock, ast_channel_name(), ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_debug, ast_json_array_append(), ast_json_array_create(), ast_json_object_get(), ast_json_string_set(), ast_json_unref(), AST_LIST_TRAVERSE, ast_log, ast_test_flag, ast_bridge_blob::blob, ast_bridge_blob::bridge, bridge_to_json(), confbridge_user::chan, ast_bridge_blob::channel, channel_to_json(), conf_find_user_profile(), confbridge_event_type_to_string(), confbridge_join_type(), confbridge_welcome_type(), confbridge_user::list, LOG_ERROR, user_profile::name, confbridge_conference::name, NULL, pack_bridge_and_channels(), pack_snapshots(), send_message(), stasis_message_data(), stasis_message_type(), confbridge_user::u_profile, user, USER_OPT_ECHO_EVENTS, and USER_OPT_SEND_EVENTS.

Referenced by send_conf_stasis().

416 {
417  struct ast_bridge_blob *obj = stasis_message_data(msg);
418  struct ast_json *extras = obj->blob;
419  struct user_profile u_profile = {{0}};
420  int source_send_events = 0;
421  int source_echo_events = 0;
422  struct ast_json* json_channels = NULL;
423  struct confbridge_user *user;
424  const char *msg_name = confbridge_event_type_to_string(stasis_message_type(msg));
425 
426  ast_debug(3, "Distributing %s event to participants\n", msg_name);
427 
428  /* This could be a channel level event or a bridge level event */
429  if (chan) {
430  if (!conf_find_user_profile(chan, NULL, &u_profile)) {
431  ast_log(LOG_ERROR, "Unable to retrieve user profile for channel '%s'\n",
432  ast_channel_name(chan));
433  return;
434  }
435  source_send_events = ast_test_flag(&u_profile, USER_OPT_SEND_EVENTS);
436  source_echo_events = ast_test_flag(&u_profile, USER_OPT_ECHO_EVENTS);
437  ast_debug(3, "send_events: %d echo_events: %d for profile %s\n",
438  source_send_events, source_echo_events, u_profile.name);
439  }
440 
441  /* Now send a message to the participants with the json string. */
442  ao2_lock(conference);
443  AST_LIST_TRAVERSE(&conference->active_list, user, list) {
444  struct ast_json *json_object;
445 
446  /*
447  * If the msg type is join, we need to capture all targets channel info so we can
448  * send a welcome message to the source channel with all current participants.
449  */
450  if (source_send_events && stasis_message_type(msg) == confbridge_join_type()) {
451  struct ast_channel_snapshot *target_snapshot;
452  struct ast_json *target_json_channel;
453 
455  if (!target_snapshot) {
456  ast_log(LOG_ERROR, "Unable to get a channel snapshot for '%s'\n",
457  ast_channel_name(user->chan));
458  continue;
459  }
460 
461  target_json_channel = channel_to_json(target_snapshot, extras, NULL);
462  ao2_ref(target_snapshot, -1);
463 
464  if (!json_channels) {
465  json_channels = ast_json_array_create();
466  if (!json_channels) {
467  ast_log(LOG_ERROR, "Unable to allocate json array\n");
468  ast_json_unref(target_json_channel);
469  return;
470  }
471  }
472 
473  ast_json_array_append(json_channels, target_json_channel);
474  }
475 
476  /* Don't send a message to the user that triggered the event. */
477  if (!source_echo_events && user->chan == chan) {
478  ast_debug(3, "Skipping queueing %s message to '%s'. Same channel.\n", msg_name,
479  ast_channel_name(user->chan));
480  continue;
481  }
482 
483  /* Don't send a message to users in profiles not sending events. */
485  ast_debug(3, "Skipping queueing %s message to '%s'. Not receiving events.\n", msg_name,
486  ast_channel_name(user->chan));
487  continue;
488  }
489 
490  json_object = pack_snapshots(obj->bridge, obj->channel, extras, NULL, msg);
491 
492  if (!json_object) {
493  ast_log(LOG_ERROR, "Unable to convert %s message to json\n", msg_name);
494  continue;
495  }
496 
497  send_message(msg_name, conference->name, json_object, user->chan);
498  ast_json_unref(json_object);
499  }
500  ao2_unlock(conference);
501 
502  /*
503  * If this is a join event, send the welcome message to just the joining user
504  * if it's not audio-only or otherwise restricted.
505  */
506  if (source_send_events && json_channels
508  struct ast_json *json_object;
509  struct ast_json *json_bridge;
510  const char *welcome_msg_name = confbridge_event_type_to_string(confbridge_welcome_type());
511 
512  json_bridge = bridge_to_json(obj->bridge);
513  json_object = pack_bridge_and_channels(json_bridge, json_channels, msg);
514  if (!json_object) {
515  ast_log(LOG_ERROR, "Unable to convert ConfbridgeWelcome message to json\n");
516  return;
517  }
518  ast_json_string_set(ast_json_object_get(json_object, "type"), welcome_msg_name);
519 
520  send_message(welcome_msg_name, conference->name, json_object, chan);
521  ast_json_unref(json_object);
522  }
523 }
static char user[512]
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
struct ast_channel * chan
Definition: confbridge.h:276
struct ast_channel_snapshot * channel
#define ast_test_flag(p, flag)
Definition: utils.h:63
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
Definition: json.c:73
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.
Structure representing a snapshot of channel state.
struct ast_json * blob
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
struct ast_bridge_snapshot * bridge
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:444
#define ast_log
Definition: astobj2.c:42
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)
#define ao2_ref(o, delta)
Definition: astobj2.h:464
#define ao2_lock(a)
Definition: astobj2.h:718
Blob of data associated with a bridge.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
Definition: json.c:352
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
Definition: json.c:368
const char * ast_channel_uniqueid(const struct ast_channel *chan)
struct confbridge_conference::@87 active_list
#define LOG_ERROR
Definition: logger.h:285
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
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.
Definition: json.c:397
const char * ast_channel_name(const struct ast_channel *chan)
char name[MAX_PROFILE_NAME]
Definition: confbridge.h:152
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)
Abstract JSON element (object, array, string, int, ...).
The structure that represents a conference bridge user.
Definition: confbridge.h:270
static struct ast_json * bridge_to_json(struct ast_bridge_snapshot *bridge_snapshot)
struct user_profile u_profile
Definition: confbridge.h:273
struct confbridge_user::@91 list
int ast_json_string_set(struct ast_json *string, const char *value)
Change the value of a JSON string.
Definition: json.c:278
char name[MAX_CONF_NAME]
Definition: confbridge.h:244
static struct ast_json * pack_bridge_and_channels(struct ast_json *json_bridge, struct ast_json *json_channels, struct stasis_message *msg)
static void send_message(const char *msg_name, char *conf_name, struct ast_json *json_object, struct ast_channel *chan)

◆ confbridge_atxfer_cb()

static void confbridge_atxfer_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 624 of file confbridge_manager.c.

References ast_attended_transfer_message::app, AST_ATTENDED_TRANSFER_DEST_APP, AST_BRIDGE_TRANSFER_SUCCESS, confbridge_handle_atxfer(), ast_attended_transfer_message::dest, ast_attended_transfer_message::dest_type, ast_attended_transfer_message::result, and stasis_message_data().

Referenced by manager_confbridge_init().

626 {
627  struct ast_attended_transfer_message *msg = stasis_message_data(message);
628 
629  if (msg->result != AST_BRIDGE_TRANSFER_SUCCESS) {
630  return;
631  }
632 
633  /*
634  * This callback will get called for ALL attended transfers
635  * so we need to make sure this transfer belongs to
636  * a conference bridge before trying to handle it.
637  */
639  && strcmp(msg->dest.app, "ConfBridge") == 0) {
641  }
642 }
Message representing attended transfer.
void confbridge_handle_atxfer(struct ast_attended_transfer_message *msg)
Create join/leave events for attended transfers.
enum ast_transfer_result result
enum ast_attended_transfer_dest_type dest_type
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
union ast_attended_transfer_message::@318 dest

◆ confbridge_end_cb()

static void confbridge_end_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 595 of file confbridge_manager.c.

References confbridge_publish_manager_event(), and NULL.

Referenced by manager_confbridge_init().

597 {
599 }
#define NULL
Definition: resample.c:96
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ confbridge_event_type_to_string()

const char* confbridge_event_type_to_string ( struct stasis_message_type event_type)

Get the string representation of a confbridge stasis message type.

Since
15.5
Parameters
event_typeThe confbridge event type such as 'confbridge_welcome_type()'
Return values
Thestring representation of the message type
unknownif not found

Definition at line 249 of file confbridge_manager.c.

References confbridge_end_type(), confbridge_join_type(), confbridge_leave_type(), confbridge_mute_type(), confbridge_start_record_type(), confbridge_start_type(), confbridge_stop_record_type(), confbridge_talking_type(), confbridge_unmute_type(), and confbridge_welcome_type().

Referenced by conf_send_event_to_participants(), confbridge_publish_manager_event(), pack_bridge_and_channels(), and send_message().

250 {
251  if (event_type == confbridge_start_type()) {
252  return "ConfbridgeStart";
253  } else if (event_type == confbridge_end_type()) {
254  return "ConfbridgeEnd";
255  } else if (event_type == confbridge_join_type()) {
256  return "ConfbridgeJoin";
257  } else if (event_type == confbridge_leave_type()) {
258  return "ConfbridgeLeave";
259  } else if (event_type == confbridge_start_record_type()) {
260  return "ConfbridgeRecord";
261  } else if (event_type == confbridge_stop_record_type()) {
262  return "ConfbridgeStopRecord";
263  } else if (event_type == confbridge_mute_type()) {
264  return "ConfbridgeMute";
265  } else if (event_type == confbridge_unmute_type()) {
266  return "ConfbridgeUnmute";
267  } else if (event_type == confbridge_talking_type()) {
268  return "ConfbridgeTalking";
269  } else if (event_type == confbridge_welcome_type()) {
270  return "ConfbridgeWelcome";
271  } else {
272  return "unknown";
273  }
274 }
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave 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_welcome_type(void)
get the confbridge welcome stasis message type
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
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type

◆ confbridge_join_cb()

static void confbridge_join_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 612 of file confbridge_manager.c.

References ast_free, confbridge_publish_manager_event(), get_admin_header(), get_muted_header(), and NULL.

Referenced by manager_confbridge_init().

614 {
615  struct ast_str *extra_text = NULL;
616 
617  if (!get_admin_header(&extra_text, message)
618  && !get_muted_header(&extra_text, message)) {
619  confbridge_publish_manager_event(message, extra_text);
620  }
621  ast_free(extra_text);
622 }
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
static int get_muted_header(struct ast_str **extra_text, struct stasis_message *message)
#define NULL
Definition: resample.c:96
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define ast_free(a)
Definition: astmm.h:182
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ confbridge_leave_cb()

static void confbridge_leave_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 601 of file confbridge_manager.c.

References ast_free, confbridge_publish_manager_event(), get_admin_header(), and NULL.

Referenced by manager_confbridge_init().

603 {
604  struct ast_str *extra_text = NULL;
605 
606  if (!get_admin_header(&extra_text, message)) {
607  confbridge_publish_manager_event(message, extra_text);
608  }
609  ast_free(extra_text);
610 }
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
#define NULL
Definition: resample.c:96
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define ast_free(a)
Definition: astmm.h:182
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ confbridge_mute_cb()

static void confbridge_mute_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 656 of file confbridge_manager.c.

References ast_free, confbridge_publish_manager_event(), get_admin_header(), and NULL.

Referenced by manager_confbridge_init().

658 {
659  struct ast_str *extra_text = NULL;
660 
661  if (!get_admin_header(&extra_text, message)) {
662  confbridge_publish_manager_event(message, extra_text);
663  }
664  ast_free(extra_text);
665 }
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
#define NULL
Definition: resample.c:96
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define ast_free(a)
Definition: astmm.h:182
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ confbridge_publish_manager_event()

static void confbridge_publish_manager_event ( struct stasis_message message,
struct ast_str extra_text 
)
static

Definition at line 525 of file confbridge_manager.c.

References ao2_cleanup, ast_assert, ast_free, ast_json_object_get(), ast_json_string_get(), ast_manager_build_bridge_state_string(), ast_manager_build_channel_state_string(), ast_str_buffer(), ast_bridge_blob::blob, ast_bridge_blob::bridge, ast_bridge_blob::channel, conf_find_bridge(), confbridge_event_type_to_string(), EVENT_FLAG_CALL, manager_event, NULL, RAII_VAR, stasis_message_data(), and stasis_message_type().

Referenced by confbridge_end_cb(), confbridge_join_cb(), confbridge_leave_cb(), confbridge_mute_cb(), confbridge_start_cb(), confbridge_start_record_cb(), confbridge_stop_record_cb(), confbridge_talking_cb(), and confbridge_unmute_cb().

528 {
529  struct ast_bridge_blob *blob = stasis_message_data(message);
530  const char *event = confbridge_event_type_to_string(stasis_message_type(message));
531  const char *conference_name;
532  RAII_VAR(struct ast_str *, bridge_text, NULL, ast_free);
533  RAII_VAR(struct ast_str *, channel_text, NULL, ast_free);
534 
535  ast_assert(blob != NULL);
536  ast_assert(event != NULL);
537 
538  bridge_text = ast_manager_build_bridge_state_string(blob->bridge);
539  if (!bridge_text) {
540  return;
541  }
542 
543  conference_name = ast_json_string_get(ast_json_object_get(blob->blob, "conference"));
544  ast_assert(conference_name != NULL);
545 
546  if (blob->channel) {
547  struct confbridge_conference *conference = conf_find_bridge(conference_name);
548 
549  channel_text = ast_manager_build_channel_state_string(blob->channel);
550  ao2_cleanup(conference);
551  }
552 
554  "Conference: %s\r\n"
555  "%s"
556  "%s"
557  "%s",
558  conference_name,
559  ast_str_buffer(bridge_text),
560  channel_text ? ast_str_buffer(channel_text) : "",
561  extra_text ? ast_str_buffer(extra_text) : "");
562 }
struct ast_channel_snapshot * channel
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
Definition: strings.h:714
struct ast_json * blob
#define EVENT_FLAG_CALL
Definition: manager.h:72
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
Definition: astman.c:222
#define ast_assert(a)
Definition: utils.h:650
#define NULL
Definition: resample.c:96
struct ast_bridge_snapshot * bridge
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
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.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
#define ast_free(a)
Definition: astmm.h:182
The structure that represents a conference bridge.
Definition: confbridge.h:243
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
struct confbridge_conference * conf_find_bridge(const char *conference_name)
Find a confbridge by name.
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
Definition: manager.h:248

◆ confbridge_start_cb()

static void confbridge_start_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 589 of file confbridge_manager.c.

References confbridge_publish_manager_event(), and NULL.

Referenced by manager_confbridge_init().

591 {
593 }
#define NULL
Definition: resample.c:96
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ confbridge_start_record_cb()

static void confbridge_start_record_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 644 of file confbridge_manager.c.

References confbridge_publish_manager_event(), and NULL.

Referenced by manager_confbridge_init().

646 {
648 }
#define NULL
Definition: resample.c:96
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ confbridge_stop_record_cb()

static void confbridge_stop_record_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 650 of file confbridge_manager.c.

References confbridge_publish_manager_event(), and NULL.

Referenced by manager_confbridge_init().

652 {
654 }
#define NULL
Definition: resample.c:96
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ confbridge_talking_cb()

static void confbridge_talking_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 678 of file confbridge_manager.c.

References ast_free, ast_json_object_get(), ast_json_string_get(), ast_str_append_event_header(), ast_bridge_blob::blob, confbridge_publish_manager_event(), get_admin_header(), NULL, RAII_VAR, and stasis_message_data().

Referenced by manager_confbridge_init().

680 {
681  RAII_VAR(struct ast_str *, extra_text, NULL, ast_free);
682  const struct ast_bridge_blob *blob = stasis_message_data(message);
683  const char *talking_status = ast_json_string_get(ast_json_object_get(blob->blob, "talking_status"));
684  if (!talking_status) {
685  return;
686  }
687 
688  ast_str_append_event_header(&extra_text, "TalkingStatus", talking_status);
689  if (!extra_text) {
690  return;
691  }
692 
693  if (!get_admin_header(&extra_text, message)) {
694  confbridge_publish_manager_event(message, extra_text);
695  }
696 }
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
struct ast_json * blob
#define NULL
Definition: resample.c:96
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
Definition: json.c:273
Blob of data associated with a bridge.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
#define ast_free(a)
Definition: astmm.h:182
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
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
Definition: manager.c:9705

◆ confbridge_unmute_cb()

static void confbridge_unmute_cb ( void *  data,
struct stasis_subscription sub,
struct stasis_message message 
)
static

Definition at line 667 of file confbridge_manager.c.

References ast_free, confbridge_publish_manager_event(), get_admin_header(), and NULL.

Referenced by manager_confbridge_init().

669 {
670  struct ast_str *extra_text = NULL;
671 
672  if (!get_admin_header(&extra_text, message)) {
673  confbridge_publish_manager_event(message, extra_text);
674  }
675  ast_free(extra_text);
676 }
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
#define NULL
Definition: resample.c:96
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define ast_free(a)
Definition: astmm.h:182
static void confbridge_publish_manager_event(struct stasis_message *message, struct ast_str *extra_text)

◆ get_admin_header()

static int get_admin_header ( struct ast_str **  extra_text,
struct stasis_message message 
)
static

Definition at line 579 of file confbridge_manager.c.

References get_bool_header().

Referenced by confbridge_join_cb(), confbridge_leave_cb(), confbridge_mute_cb(), confbridge_talking_cb(), and confbridge_unmute_cb().

580 {
581  return get_bool_header(extra_text, message, "admin", "Admin");
582 }
static int get_bool_header(struct ast_str **extra_text, struct stasis_message *message, const char *json_key, const char *ami_header)

◆ get_bool_header()

static int get_bool_header ( struct ast_str **  extra_text,
struct stasis_message message,
const char *  json_key,
const char *  ami_header 
)
static

Definition at line 564 of file confbridge_manager.c.

References ast_json_is_true(), ast_json_object_get(), ast_str_append_event_header(), AST_YESNO, ast_bridge_blob::blob, and stasis_message_data().

Referenced by get_admin_header(), and get_muted_header().

566 {
567  const struct ast_bridge_blob *blob = stasis_message_data(message);
568  const struct ast_json *obj;
569 
570  obj = ast_json_object_get(blob->blob, json_key);
571  if (!obj) {
572  return -1;
573  }
574 
575  return ast_str_append_event_header(extra_text, ami_header,
577 }
int ast_json_is_true(const struct ast_json *value)
Check if value is JSON true.
Definition: json.c:253
struct ast_json * blob
Blob of data associated with a bridge.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
#define AST_YESNO(x)
return Yes or No depending on the argument.
Definition: strings.h:139
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:397
Abstract JSON element (object, array, string, int, ...).
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
Definition: manager.c:9705

◆ get_muted_header()

static int get_muted_header ( struct ast_str **  extra_text,
struct stasis_message message 
)
static

Definition at line 584 of file confbridge_manager.c.

References get_bool_header().

Referenced by confbridge_join_cb().

585 {
586  return get_bool_header(extra_text, message, "muted", "Muted");
587 }
static int get_bool_header(struct ast_str **extra_text, struct stasis_message *message, const char *json_key, const char *ami_header)

◆ manager_confbridge_init()

int manager_confbridge_init ( void  )

register stasis message routers to handle manager events for confbridge messages

Since
12.0
Return values
0success
non-zerofailure

Definition at line 721 of file confbridge_manager.c.

References ast_attended_transfer_type(), ast_bridge_topic_all(), ast_channel_topic_all(), confbridge_atxfer_cb(), confbridge_end_cb(), confbridge_end_type(), confbridge_join_cb(), confbridge_join_type(), confbridge_leave_cb(), confbridge_leave_type(), confbridge_mute_cb(), confbridge_mute_type(), confbridge_start_cb(), confbridge_start_record_cb(), confbridge_start_record_type(), confbridge_start_type(), confbridge_stop_record_cb(), confbridge_stop_record_type(), confbridge_talking_cb(), confbridge_talking_type(), confbridge_unmute_cb(), confbridge_unmute_type(), confbridge_welcome_type(), manager_confbridge_shutdown(), NULL, stasis_message_router_add(), stasis_message_router_create, and STASIS_MESSAGE_TYPE_INIT.

Referenced by load_module().

722 {
733 
736 
737  if (!bridge_state_router) {
738  return -1;
739  }
740 
744  NULL)) {
746  return -1;
747  }
751  NULL)) {
753  return -1;
754  }
758  NULL)) {
760  return -1;
761  }
765  NULL)) {
767  return -1;
768  }
772  NULL)) {
774  return -1;
775  }
779  NULL)) {
781  return -1;
782  }
786  NULL)) {
788  return -1;
789  }
793  NULL)) {
795  return -1;
796  }
800  NULL)) {
802  return -1;
803  }
807  NULL)) {
809  return -1;
810  }
811 
814 
815  if (!channel_state_router) {
817  return -1;
818  }
819 
823  NULL)) {
825  return -1;
826  }
830  NULL)) {
832  return -1;
833  }
837  NULL)) {
839  return -1;
840  }
844  NULL)) {
846  return -1;
847  }
851  NULL)) {
853  return -1;
854  }
858  NULL)) {
860  return -1;
861  }
865  NULL)) {
867  return -1;
868  }
872  NULL)) {
874  return -1;
875  }
879  NULL)) {
881  return -1;
882  }
883 
884  /* FYI: confbridge_welcome_type is never routed */
885 
886  return 0;
887 }
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
static void confbridge_talking_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_start_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
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.
Definition: stasis.h:1501
static void confbridge_join_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 void confbridge_stop_record_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
#define NULL
Definition: resample.c:96
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
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 stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
static void confbridge_atxfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_message_type * confbridge_stop_record_type(void)
get the confbridge stop_record stasis message type
#define stasis_message_router_create(topic)
static void confbridge_end_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
void manager_confbridge_shutdown(void)
unregister stasis message routers to handle manager events for confbridge messages ...
static struct stasis_message_router * channel_state_router
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
struct stasis_message_type * confbridge_welcome_type(void)
get the confbridge welcome stasis message type
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
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type
static void confbridge_unmute_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)

◆ manager_confbridge_shutdown()

void manager_confbridge_shutdown ( void  )

unregister stasis message routers to handle manager events for confbridge messages

Since
12.0

Definition at line 698 of file confbridge_manager.c.

References confbridge_end_type(), confbridge_join_type(), confbridge_leave_type(), confbridge_mute_type(), confbridge_start_record_type(), confbridge_start_type(), confbridge_stop_record_type(), confbridge_talking_type(), confbridge_unmute_type(), confbridge_welcome_type(), NULL, stasis_message_router_unsubscribe(), and STASIS_MESSAGE_TYPE_CLEANUP.

Referenced by manager_confbridge_init(), and unload_module().

698  {
709 
710  if (bridge_state_router) {
713  }
714 
715  if (channel_state_router) {
718  }
719 }
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
Definition: stasis.h:1523
#define NULL
Definition: resample.c:96
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave stasis message type
struct stasis_message_type * confbridge_stop_record_type(void)
get the confbridge stop_record stasis message type
static struct stasis_message_router * channel_state_router
static struct stasis_message_router * bridge_state_router
struct stasis_message_type * confbridge_end_type(void)
get the confbridge end stasis message type
struct stasis_message_type * confbridge_welcome_type(void)
get the confbridge welcome stasis message type
void stasis_message_router_unsubscribe(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic.
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
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type

◆ pack_bridge_and_channels()

static struct ast_json* pack_bridge_and_channels ( struct ast_json json_bridge,
struct ast_json json_channels,
struct stasis_message msg 
)
static

Definition at line 329 of file confbridge_manager.c.

References AST_JSON_ARRAY, ast_json_pack(), ast_json_timeval(), ast_json_typeof(), confbridge_event_type_to_string(), NULL, stasis_message_timestamp(), and stasis_message_type().

Referenced by conf_send_event_to_participants(), and pack_snapshots().

332 {
333  const struct timeval *tv = stasis_message_timestamp(msg);
334  const char *msg_name = confbridge_event_type_to_string(stasis_message_type(msg));
335  const char *fmt = ast_json_typeof(json_channels) == AST_JSON_ARRAY ?
336  "{s: s, s: o, s: o, s: o }" : "{s: s, s: o, s: o, s: [ o ] }";
337 
338  return ast_json_pack(fmt,
339  "type", msg_name,
340  "timestamp", ast_json_timeval(*tv, NULL),
341  "bridge", json_bridge,
342  "channels", json_channels);
343 }
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
Definition: json.c:591
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
#define NULL
Definition: resample.c:96
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
struct ast_json * ast_json_timeval(const struct timeval tv, const char *zone)
Construct a timeval as JSON.
Definition: json.c:649
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
Definition: json.c:78
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.

◆ pack_snapshots()

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

Definition at line 345 of file confbridge_manager.c.

References bridge_to_json(), channel_to_json(), and pack_bridge_and_channels().

Referenced by conf_send_event_to_participants().

348 {
349  struct ast_json *json_bridge;
350  struct ast_json *json_channel;
351 
352  json_bridge = bridge_to_json(bridge_snapshot);
353  json_channel = channel_to_json(channel_snapshot, conf_blob, labels_blob);
354 
355  return pack_bridge_and_channels(json_bridge, json_channel, msg);
356 }
static struct ast_json * channel_to_json(struct ast_channel_snapshot *channel_snapshot, struct ast_json *conf_blob, struct ast_json *labels_blob)
Abstract JSON element (object, array, string, int, ...).
static struct ast_json * bridge_to_json(struct ast_bridge_snapshot *bridge_snapshot)
static struct ast_json * pack_bridge_and_channels(struct ast_json *json_bridge, struct ast_json *json_channels, struct stasis_message *msg)

◆ send_message()

static void send_message ( const char *  msg_name,
char *  conf_name,
struct ast_json json_object,
struct ast_channel chan 
)
static

Definition at line 358 of file confbridge_manager.c.

References ao2_cleanup, ARRAY_LEN, ast_bridge_channel_queue_frame(), ast_channel_get_bridge_channel(), ast_channel_name(), ast_debug, AST_FRAME_TEXT_DATA, ast_free, ast_json_dump_string_format(), ast_json_free(), AST_JSON_PRETTY, ast_log, ast_msg_data_alloc(), AST_MSG_DATA_ATTR_BODY, AST_MSG_DATA_ATTR_CONTENT_TYPE, AST_MSG_DATA_ATTR_FROM, ast_msg_data_get_length(), AST_MSG_DATA_SOURCE_TYPE_IN_DIALOG, confbridge_event_type_to_string(), confbridge_leave_type(), ast_frame::data, ast_frame::datalen, ast_frame::frametype, LOG_ERROR, NULL, ast_frame::ptr, RAII_VAR, ast_msg_data_attribute::type, and ast_msg_data_attribute::value.

Referenced by conf_send_event_to_participants().

360 {
361  struct ast_msg_data *data_msg;
362  struct ast_msg_data_attribute attrs[] = {
363  { .type = AST_MSG_DATA_ATTR_FROM, conf_name },
364  { .type = AST_MSG_DATA_ATTR_CONTENT_TYPE, .value = "application/x-asterisk-confbridge-event+json"},
365  { .type = AST_MSG_DATA_ATTR_BODY, },
366  };
367  char *json;
368  int rc = 0;
369  struct ast_frame f;
370  RAII_VAR(struct ast_bridge_channel *, bridge_chan, NULL, ao2_cleanup);
371 
372  bridge_chan = ast_channel_get_bridge_channel(chan);
373  if (!bridge_chan) {
374  /* Don't complain if we can't get the bridge_chan. The channel is probably gone. */
375  return;
376  }
377 
378  json = ast_json_dump_string_format(json_object, AST_JSON_PRETTY);
379  if (!json) {
380  ast_log(LOG_ERROR, "Unable to convert json_object for %s message to string\n", msg_name);
381  return;
382  }
383  attrs[2].value = json;
384 
386  if (!data_msg) {
387  ast_log(LOG_ERROR, "Unable to create %s message for channel '%s'\n", msg_name,
388  ast_channel_name(chan));
389  ast_json_free(json);
390  return;
391  }
392 
393  memset(&f, 0, sizeof(f));
394  f.frametype = AST_FRAME_TEXT_DATA;
395  f.data.ptr = data_msg;
396  f.datalen = ast_msg_data_get_length(data_msg);
397 
398  rc = ast_bridge_channel_queue_frame(bridge_chan, &f);
399  ast_free(data_msg);
400  if (rc != 0) {
401  /* Don't complain if we can't send a leave message. The channel is probably gone. */
402  if (strcmp(confbridge_event_type_to_string(confbridge_leave_type()), msg_name) != 0) {
403  ast_log(LOG_ERROR, "Failed to queue %s message to '%s'\n%s\n", msg_name,
404  ast_channel_name(chan), json);
405  }
406  ast_json_free(json);
407  return;
408  }
409 
410  ast_debug(3, "Queued %s message to '%s'\n%s\n", msg_name, ast_channel_name(chan), json);
411  ast_json_free(json);
412 }
size_t ast_msg_data_get_length(struct ast_msg_data *msg)
Get length of the structure.
Definition: message.c:1513
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
enum ast_msg_data_attribute_type type
Definition: message.h:463
void ast_json_free(void *p)
Asterisk's custom JSON allocator. Exposed for use by unit tests.
Definition: json.c:52
Structure used to transport a message through the frame core.
Definition: message.c:1406
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.
Definition: message.c:1418
#define NULL
Definition: resample.c:96
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave stasis message type
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:444
#define ast_log
Definition: astobj2.c:42
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:851
char * ast_json_dump_string_format(struct ast_json *root, enum ast_json_encoding_format format)
Encode a JSON value to a string.
Definition: json.c:463
#define LOG_ERROR
Definition: logger.h:285
#define ast_free(a)
Definition: astmm.h:182
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
struct ast_bridge_channel * ast_channel_get_bridge_channel(struct ast_channel *chan)
Get a reference to the channel's bridge pointer.
Definition: channel.c:10676
int ast_bridge_channel_queue_frame(struct ast_bridge_channel *bridge_channel, struct ast_frame *fr)
Write a frame to the specified bridge_channel.
Structure that contains information regarding a channel in a bridge.
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
const char * ast_channel_name(const struct ast_channel *chan)
Data structure associated with a single frame of data.

◆ STASIS_MESSAGE_TYPE_DEFN() [1/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_start_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [2/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_end_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [3/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_join_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [4/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_leave_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [5/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_start_record_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [6/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_stop_record_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [7/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_mute_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [8/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_unmute_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [9/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_talking_type  )

◆ STASIS_MESSAGE_TYPE_DEFN() [10/10]

STASIS_MESSAGE_TYPE_DEFN ( confbridge_welcome_type  )

Variable Documentation

◆ bridge_state_router

struct stasis_message_router* bridge_state_router
static

Definition at line 229 of file confbridge_manager.c.

◆ channel_state_router

struct stasis_message_router* channel_state_router
static

Definition at line 230 of file confbridge_manager.c.