Asterisk - The Open Source Telephony Project  GIT-master-1b41629
Data Structures | Macros | Enumerations | Functions | Variables
confbridge.h File Reference
#include "asterisk.h"
#include "asterisk/app.h"
#include "asterisk/logger.h"
#include "asterisk/linkedlists.h"
#include "asterisk/channel.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_features.h"
#include "asterisk/stasis_bridges.h"
#include "conf_state.h"

Go to the source code of this file.

Data Structures

struct  bridge_profile
 
struct  bridge_profile_sounds
 
struct  conf_menu
 
struct  conf_menu_action
 
struct  conf_menu_entry
 
struct  confbridge_conference
 The structure that represents a conference bridge. More...
 
struct  confbridge_user
 The structure that represents a conference bridge user. More...
 
struct  post_join_action
 
struct  user_profile
 

Macros

#define DEFAULT_BRIDGE_PROFILE   "default_bridge"
 
#define DEFAULT_MENU_PROFILE   "default_menu"
 
#define DEFAULT_SILENCE_THRESHOLD   2500
 
#define DEFAULT_TALKING_THRESHOLD   160
 
#define DEFAULT_USER_PROFILE   "default_user"
 
#define MAX_CONF_NAME   AST_MAX_EXTENSION
 
#define MAX_PIN   80
 
#define MAX_PROFILE_NAME   128
 

Enumerations

enum  bridge_profile_flags {
  BRIDGE_OPT_RECORD_CONFERENCE = (1 << 0), BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1), BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3),
  BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5), BRIDGE_OPT_BINAURAL_ACTIVE = (1 << 6), BRIDGE_OPT_VIDEO_SRC_SFU = (1 << 7),
  BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE = (1 << 8), BRIDGE_OPT_REMB_BEHAVIOR_LOWEST = (1 << 9), BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST = (1 << 10), BRIDGE_OPT_ENABLE_EVENTS = (1 << 11),
  BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE_ALL = (1 << 12), BRIDGE_OPT_REMB_BEHAVIOR_LOWEST_ALL = (1 << 13), BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST_ALL = (1 << 14), BRIDGE_OPT_REMB_BEHAVIOR_FORCE = (1 << 15)
}
 
enum  conf_menu_action_id {
  MENU_ACTION_TOGGLE_MUTE = 1, MENU_ACTION_PLAYBACK, MENU_ACTION_PLAYBACK_AND_CONTINUE, MENU_ACTION_INCREASE_LISTENING,
  MENU_ACTION_DECREASE_LISTENING, MENU_ACTION_RESET_LISTENING, MENU_ACTION_RESET_TALKING, MENU_ACTION_INCREASE_TALKING,
  MENU_ACTION_DECREASE_TALKING, MENU_ACTION_DIALPLAN_EXEC, MENU_ACTION_ADMIN_TOGGLE_LOCK, MENU_ACTION_ADMIN_KICK_LAST,
  MENU_ACTION_LEAVE, MENU_ACTION_NOOP, MENU_ACTION_SET_SINGLE_VIDEO_SRC, MENU_ACTION_RELEASE_SINGLE_VIDEO_SRC,
  MENU_ACTION_PARTICIPANT_COUNT, MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS, MENU_ACTION_TOGGLE_BINAURAL
}
 
enum  conf_sounds {
  CONF_SOUND_HAS_JOINED, CONF_SOUND_HAS_LEFT, CONF_SOUND_KICKED, CONF_SOUND_MUTED,
  CONF_SOUND_UNMUTED, CONF_SOUND_ONLY_ONE, CONF_SOUND_THERE_ARE, CONF_SOUND_OTHER_IN_PARTY,
  CONF_SOUND_PLACE_IN_CONF, CONF_SOUND_WAIT_FOR_LEADER, CONF_SOUND_LEADER_HAS_LEFT, CONF_SOUND_GET_PIN,
  CONF_SOUND_INVALID_PIN, CONF_SOUND_ONLY_PERSON, CONF_SOUND_LOCKED, CONF_SOUND_LOCKED_NOW,
  CONF_SOUND_UNLOCKED_NOW, CONF_SOUND_ERROR_MENU, CONF_SOUND_JOIN, CONF_SOUND_LEAVE,
  CONF_SOUND_PARTICIPANTS_MUTED, CONF_SOUND_PARTICIPANTS_UNMUTED, CONF_SOUND_BEGIN, CONF_SOUND_BINAURAL_ON,
  CONF_SOUND_BINAURAL_OFF
}
 
enum  user_profile_flags {
  USER_OPT_ADMIN = (1 << 0), USER_OPT_NOONLYPERSON = (1 << 1), USER_OPT_MARKEDUSER = (1 << 2), USER_OPT_STARTMUTED = (1 << 3),
  USER_OPT_MUSICONHOLD = (1 << 4), USER_OPT_QUIET = (1 << 5), USER_OPT_ANNOUNCEUSERCOUNT = (1 << 6), USER_OPT_WAITMARKED = (1 << 7),
  USER_OPT_ENDMARKED = (1 << 8), USER_OPT_DENOISE = (1 << 9), USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 10), USER_OPT_TALKER_DETECT = (1 << 11),
  USER_OPT_DROP_SILENCE = (1 << 12), USER_OPT_DTMF_PASS = (1 << 13), USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), USER_OPT_JITTERBUFFER = (1 << 15),
  USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), USER_OPT_SEND_EVENTS = (1 << 17), USER_OPT_ECHO_EVENTS = (1 << 18), USER_OPT_TEXT_MESSAGING = (1 << 19)
}
 

Functions

int async_play_sound_file (struct confbridge_conference *conference, const char *filename, struct ast_channel *initiator)
 Play sound file into conference bridge asynchronously. More...
 
void async_play_sound_ready (struct ast_channel *chan)
 Indicate the initiator of an async sound file is ready for it to play. More...
 
int conf_add_post_join_action (struct confbridge_user *user, int(*func)(struct confbridge_user *user))
 Queue a function to run with the given conference bridge user as an argument once the state transition is complete. More...
 
void conf_add_user_active (struct confbridge_conference *conference, struct confbridge_user *user)
 Add a conference bridge user as an unmarked active user of the conference. More...
 
void conf_add_user_marked (struct confbridge_conference *conference, struct confbridge_user *user)
 Add a conference bridge user as a marked active user of the conference. More...
 
void conf_add_user_waiting (struct confbridge_conference *conference, struct confbridge_user *user)
 Add a conference bridge user as an waiting user of the conference. More...
 
int conf_announce_channel_push (struct ast_channel *ast)
 Push the announcer channel into the conference. More...
 
struct ast_channel_techconf_announce_get_tech (void)
 Get ConfBridge announce channel technology struct. More...
 
void conf_bridge_profile_copy (struct bridge_profile *dst, struct bridge_profile *src)
 copies a bridge profile More...
 
void conf_bridge_profile_destroy (struct bridge_profile *b_profile)
 Destroy a bridge profile found by 'conf_find_bridge_profile'. More...
 
void conf_destroy_config (void)
 destroy the information loaded from the confbridge.conf file More...
 
void conf_ended (struct confbridge_conference *conference)
 Callback to be called when the conference has become empty. More...
 
struct confbridge_conferenceconf_find_bridge (const char *conference_name)
 Find a confbridge by name. More...
 
const struct bridge_profileconf_find_bridge_profile (struct ast_channel *chan, const char *bridge_profile_name, struct bridge_profile *result)
 Find a bridge profile given a bridge profile's name and store that profile in result structure. More...
 
int conf_find_menu_entry_by_sequence (const char *dtmf_sequence, struct conf_menu *menu, struct conf_menu_entry *result)
 Finds a menu_entry in a menu structure matched by DTMF sequence. More...
 
const struct user_profileconf_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. More...
 
const char * conf_get_sound (enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds)
 Looks to see if sound file is stored in bridge profile sounds, if not default sound is provided. More...
 
int conf_handle_dtmf (struct ast_bridge_channel *bridge_channel, struct confbridge_user *user, struct conf_menu_entry *menu_entry, struct conf_menu *menu)
 Once a DTMF sequence matches a sequence in the user's DTMF menu, this function will get called to perform the menu action. More...
 
void conf_handle_first_join (struct confbridge_conference *conference)
 Callback to execute any time we transition from zero to one active users. More...
 
int conf_handle_inactive_waitmarked (struct confbridge_user *user)
 Handle actions every time a waitmarked user joins w/o a marked user present. More...
 
int conf_handle_only_person (struct confbridge_user *user)
 Handle actions whenever an user joins an empty conference. More...
 
void conf_handle_second_active (struct confbridge_conference *conference)
 Handle when a conference moves to having more than one active participant. More...
 
int conf_load_config (void)
 load confbridge.conf file More...
 
void conf_menu_entry_destroy (struct conf_menu_entry *menu_entry)
 Destroys and frees all the actions stored in a menu_entry structure. More...
 
void conf_moh_start (struct confbridge_user *user)
 Start MOH for the conference user. More...
 
void conf_moh_stop (struct confbridge_user *user)
 Stop MOH for the conference user. More...
 
void conf_mute_only_active (struct confbridge_conference *conference)
 Attempt to mute/play MOH to the only user in the conference if they require it. More...
 
struct ast_channel_techconf_record_get_tech (void)
 Get ConfBridge record channel technology struct. More...
 
int conf_reload_config (void)
 reload confbridge.conf file More...
 
void conf_remove_user_active (struct confbridge_conference *conference, struct confbridge_user *user)
 Remove a conference bridge user from the unmarked active conference users in the conference. More...
 
void conf_remove_user_marked (struct confbridge_conference *conference, struct confbridge_user *user)
 Remove a conference bridge user from the marked active conference users in the conference. More...
 
void conf_remove_user_waiting (struct confbridge_conference *conference, struct confbridge_user *user)
 Remove a conference bridge user from the waiting conference users in the conference. More...
 
void conf_send_event_to_participants (struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message *msg)
 Send events to bridge participants. More...
 
int conf_set_menu_to_user (struct ast_channel *chan, struct confbridge_user *user, const char *menu_profile_name)
 find a menu profile given a menu profile's name and apply the menu in DTMF hooks. More...
 
void conf_update_user_mute (struct confbridge_user *user)
 Update the actual mute status of the user and set it on the bridge. More...
 
struct stasis_message_typeconfbridge_end_type (void)
 get the confbridge end stasis message type More...
 
const char * confbridge_event_type_to_string (struct stasis_message_type *event_type)
 Get the string representation of a confbridge stasis message type. More...
 
void confbridge_handle_atxfer (struct ast_attended_transfer_message *msg)
 Create join/leave events for attended transfers. More...
 
struct stasis_message_typeconfbridge_join_type (void)
 get the confbridge join stasis message type More...
 
struct stasis_message_typeconfbridge_leave_type (void)
 get the confbridge leave stasis message type More...
 
struct stasis_message_typeconfbridge_mute_type (void)
 get the confbridge mute stasis message type More...
 
struct stasis_message_typeconfbridge_start_record_type (void)
 get the confbridge start_record stasis message type More...
 
struct stasis_message_typeconfbridge_start_type (void)
 get the confbridge start stasis message type More...
 
struct stasis_message_typeconfbridge_stop_record_type (void)
 get the confbridge stop_record stasis message type More...
 
struct stasis_message_typeconfbridge_talking_type (void)
 get the confbridge talking stasis message type More...
 
struct stasis_message_typeconfbridge_unmute_type (void)
 get the confbridge unmute stasis message type More...
 
struct stasis_message_typeconfbridge_welcome_type (void)
 get the confbridge welcome stasis message type More...
 
int func_confbridge_helper (struct ast_channel *chan, const char *cmd, char *data, const char *value)
 
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...
 
int play_sound_file (struct confbridge_conference *conference, const char *filename)
 Play sound file into conference bridge. More...
 

Variables

struct ao2_containerconference_bridges
 Container to hold all conference bridges in progress. More...
 

Macro Definition Documentation

◆ DEFAULT_BRIDGE_PROFILE

#define DEFAULT_BRIDGE_PROFILE   "default_bridge"

◆ DEFAULT_MENU_PROFILE

#define DEFAULT_MENU_PROFILE   "default_menu"

◆ DEFAULT_SILENCE_THRESHOLD

#define DEFAULT_SILENCE_THRESHOLD   2500

Default time in ms of silence necessary to declare talking stopped by the bridge.

Definition at line 49 of file confbridge.h.

Referenced by conf_load_config(), and confbridge_exec().

◆ DEFAULT_TALKING_THRESHOLD

#define DEFAULT_TALKING_THRESHOLD   160

Default minimum average magnitude threshold to determine talking by the DSP.

Definition at line 46 of file confbridge.h.

Referenced by conf_load_config(), and confbridge_exec().

◆ DEFAULT_USER_PROFILE

#define DEFAULT_USER_PROFILE   "default_user"

◆ MAX_CONF_NAME

#define MAX_CONF_NAME   AST_MAX_EXTENSION

Maximum length of a conference bridge name

Definition at line 35 of file confbridge.h.

Referenced by confbridge_exec().

◆ MAX_PIN

#define MAX_PIN   80

Maximum length of a conference pin

Definition at line 37 of file confbridge.h.

◆ MAX_PROFILE_NAME

#define MAX_PROFILE_NAME   128

Maximum length of bridge/user/menu profile names

Definition at line 39 of file confbridge.h.

Enumeration Type Documentation

◆ bridge_profile_flags

Enumerator
BRIDGE_OPT_RECORD_CONFERENCE 

Set if the conference should be recorded

BRIDGE_OPT_VIDEO_SRC_LAST_MARKED 

Set if conference should feed video of last marked user to all participants.

BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED 

Set if conference should feed video of first marked user to all participants.

BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER 

Set if conference set the video feed to follow the loudest talker.

BRIDGE_OPT_RECORD_FILE_APPEND 

Set if the record file should be appended to between start/stops.

BRIDGE_OPT_RECORD_FILE_TIMESTAMP 

Set if the record file should have a timestamp appended

BRIDGE_OPT_BINAURAL_ACTIVE 

Set if binaural convolution is activated

BRIDGE_OPT_VIDEO_SRC_SFU 

Selective forwarding unit

BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE 

The average of all REMB reports is sent to the sender

BRIDGE_OPT_REMB_BEHAVIOR_LOWEST 

The lowest estimated maximum bitrate is sent to the sender

BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST 

The highest estimated maximum bitrate is sent to the sender

BRIDGE_OPT_ENABLE_EVENTS 

Enable sending events to participants

BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE_ALL 

The average of all REMB reports in the entire bridge is sent to each sender

BRIDGE_OPT_REMB_BEHAVIOR_LOWEST_ALL 

The lowest estimated maximum bitrate from all receivers is sent to each sender

BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST_ALL 

The highest estimated maximum bitrate from all receivers is sent to each sender

BRIDGE_OPT_REMB_BEHAVIOR_FORCE 

Force the REMB estimated bitrate to that specifiec in remb_estimated_bitrate

Definition at line 74 of file confbridge.h.

74  {
75  BRIDGE_OPT_RECORD_CONFERENCE = (1 << 0), /*!< Set if the conference should be recorded */
76  BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1), /*!< Set if conference should feed video of last marked user to all participants. */
77  BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), /*!< Set if conference should feed video of first marked user to all participants. */
78  BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3), /*!< Set if conference set the video feed to follow the loudest talker. */
79  BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), /*!< Set if the record file should be appended to between start/stops. */
80  BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5), /*!< Set if the record file should have a timestamp appended */
81  BRIDGE_OPT_BINAURAL_ACTIVE = (1 << 6), /*!< Set if binaural convolution is activated */
82  BRIDGE_OPT_VIDEO_SRC_SFU = (1 << 7), /*!< Selective forwarding unit */
83  BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE = (1 << 8), /*!< The average of all REMB reports is sent to the sender */
84  BRIDGE_OPT_REMB_BEHAVIOR_LOWEST = (1 << 9), /*!< The lowest estimated maximum bitrate is sent to the sender */
85  BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST = (1 << 10), /*!< The highest estimated maximum bitrate is sent to the sender */
86  BRIDGE_OPT_ENABLE_EVENTS = (1 << 11), /*!< Enable sending events to participants */
87  BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE_ALL = (1 << 12), /*!< The average of all REMB reports in the entire bridge is sent to each sender */
88  BRIDGE_OPT_REMB_BEHAVIOR_LOWEST_ALL = (1 << 13), /*!< The lowest estimated maximum bitrate from all receivers is sent to each sender */
89  BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST_ALL = (1 << 14), /*!< The highest estimated maximum bitrate from all receivers is sent to each sender */
90  BRIDGE_OPT_REMB_BEHAVIOR_FORCE = (1 << 15), /*!< Force the REMB estimated bitrate to that specifiec in remb_estimated_bitrate */
91 };

◆ conf_menu_action_id

Enumerator
MENU_ACTION_TOGGLE_MUTE 
MENU_ACTION_PLAYBACK 
MENU_ACTION_PLAYBACK_AND_CONTINUE 
MENU_ACTION_INCREASE_LISTENING 
MENU_ACTION_DECREASE_LISTENING 
MENU_ACTION_RESET_LISTENING 
MENU_ACTION_RESET_TALKING 
MENU_ACTION_INCREASE_TALKING 
MENU_ACTION_DECREASE_TALKING 
MENU_ACTION_DIALPLAN_EXEC 
MENU_ACTION_ADMIN_TOGGLE_LOCK 
MENU_ACTION_ADMIN_KICK_LAST 
MENU_ACTION_LEAVE 
MENU_ACTION_NOOP 
MENU_ACTION_SET_SINGLE_VIDEO_SRC 
MENU_ACTION_RELEASE_SINGLE_VIDEO_SRC 
MENU_ACTION_PARTICIPANT_COUNT 
MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS 
MENU_ACTION_TOGGLE_BINAURAL 

Definition at line 93 of file confbridge.h.

93  {
113 };

◆ conf_sounds

Enumerator
CONF_SOUND_HAS_JOINED 
CONF_SOUND_HAS_LEFT 
CONF_SOUND_KICKED 
CONF_SOUND_MUTED 
CONF_SOUND_UNMUTED 
CONF_SOUND_ONLY_ONE 
CONF_SOUND_THERE_ARE 
CONF_SOUND_OTHER_IN_PARTY 
CONF_SOUND_PLACE_IN_CONF 
CONF_SOUND_WAIT_FOR_LEADER 
CONF_SOUND_LEADER_HAS_LEFT 
CONF_SOUND_GET_PIN 
CONF_SOUND_INVALID_PIN 
CONF_SOUND_ONLY_PERSON 
CONF_SOUND_LOCKED 
CONF_SOUND_LOCKED_NOW 
CONF_SOUND_UNLOCKED_NOW 
CONF_SOUND_ERROR_MENU 
CONF_SOUND_JOIN 
CONF_SOUND_LEAVE 
CONF_SOUND_PARTICIPANTS_MUTED 
CONF_SOUND_PARTICIPANTS_UNMUTED 
CONF_SOUND_BEGIN 
CONF_SOUND_BINAURAL_ON 
CONF_SOUND_BINAURAL_OFF 

Definition at line 166 of file confbridge.h.

166  {
192 };

◆ user_profile_flags

Enumerator
USER_OPT_ADMIN 

Set if the caller is an administrator

USER_OPT_NOONLYPERSON 

Set if the "you are currently the only person in this conference" sound file should not be played

USER_OPT_MARKEDUSER 

Set if the caller is a marked user

USER_OPT_STARTMUTED 

Set if the caller should be initially set muted

USER_OPT_MUSICONHOLD 

Set if music on hold should be played if nobody else is in the conference bridge

USER_OPT_QUIET 

Set if no audio prompts should be played

USER_OPT_ANNOUNCEUSERCOUNT 

Set if the number of users should be announced to the caller

USER_OPT_WAITMARKED 

Set if the user must wait for a marked user before starting

USER_OPT_ENDMARKED 

Set if the user should be kicked after the last Marked user exits

USER_OPT_DENOISE 

Sets if denoise filter should be used on audio before mixing.

USER_OPT_ANNOUNCE_JOIN_LEAVE 

Sets if the user's name should be recorded and announced on join and leave.

USER_OPT_TALKER_DETECT 

Sets if start and stop talking events should generated for this user over AMI.

USER_OPT_DROP_SILENCE 

Sets if silence should be dropped from the mix or not.

USER_OPT_DTMF_PASS 

Sets if dtmf should be passed into the conference or not

USER_OPT_ANNOUNCEUSERCOUNTALL 

Sets if the number of users should be announced to everyone.

USER_OPT_JITTERBUFFER 

Places a jitterbuffer on the user.

USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW 

modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing

USER_OPT_SEND_EVENTS 

Send text message events to users

USER_OPT_ECHO_EVENTS 

Send events only to the admin(s)

USER_OPT_TEXT_MESSAGING 

Send text messages to the user

Definition at line 51 of file confbridge.h.

51  {
52  USER_OPT_ADMIN = (1 << 0), /*!< Set if the caller is an administrator */
53  USER_OPT_NOONLYPERSON = (1 << 1), /*!< Set if the "you are currently the only person in this conference" sound file should not be played */
54  USER_OPT_MARKEDUSER = (1 << 2), /*!< Set if the caller is a marked user */
55  USER_OPT_STARTMUTED = (1 << 3), /*!< Set if the caller should be initially set muted */
56  USER_OPT_MUSICONHOLD = (1 << 4), /*!< Set if music on hold should be played if nobody else is in the conference bridge */
57  USER_OPT_QUIET = (1 << 5), /*!< Set if no audio prompts should be played */
58  USER_OPT_ANNOUNCEUSERCOUNT = (1 << 6), /*!< Set if the number of users should be announced to the caller */
59  USER_OPT_WAITMARKED = (1 << 7), /*!< Set if the user must wait for a marked user before starting */
60  USER_OPT_ENDMARKED = (1 << 8), /*!< Set if the user should be kicked after the last Marked user exits */
61  USER_OPT_DENOISE = (1 << 9), /*!< Sets if denoise filter should be used on audio before mixing. */
62  USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 10), /*!< Sets if the user's name should be recorded and announced on join and leave. */
63  USER_OPT_TALKER_DETECT = (1 << 11), /*!< Sets if start and stop talking events should generated for this user over AMI. */
64  USER_OPT_DROP_SILENCE = (1 << 12), /*!< Sets if silence should be dropped from the mix or not. */
65  USER_OPT_DTMF_PASS = (1 << 13), /*!< Sets if dtmf should be passed into the conference or not */
66  USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), /*!< Sets if the number of users should be announced to everyone. */
67  USER_OPT_JITTERBUFFER = (1 << 15), /*!< Places a jitterbuffer on the user. */
68  USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), /*!< modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing */
69  USER_OPT_SEND_EVENTS = (1 << 17), /*!< Send text message events to users */
70  USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */
71  USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */
72 };

Function Documentation

◆ async_play_sound_file()

int async_play_sound_file ( struct confbridge_conference conference,
const char *  filename,
struct ast_channel initiator 
)

Play sound file into conference bridge asynchronously.

If the initiator parameter is non-NULL, then the playback will wait for that initiator channel to get back in the bridge before playing the sound file. This way, the initiator has no danger of hearing a "clipped" file.

Parameters
conferenceThe conference bridge to play sound file into
filenameSound file to play
initiatorChannel that initiated playback.
Return values
0success
-1failure

Definition at line 2250 of file app_confbridge.c.

References async_play_sound_helper().

Referenced by action_toggle_mute_participants(), confbridge_exec(), and leave_marked().

2252 {
2253  return async_play_sound_helper(conference, filename, -1, initiator);
2254 }
static int async_play_sound_helper(struct confbridge_conference *conference, const char *filename, int say_number, struct ast_channel *initiator)

◆ async_play_sound_ready()

void async_play_sound_ready ( struct ast_channel chan)

Indicate the initiator of an async sound file is ready for it to play.

When playing an async sound file, the initiator is typically either out of the bridge or not in a position to hear the queued announcement. This function lets the announcement thread know that the initiator is now ready for the sound to play.

If an async announcement was queued and no initiator channel was provided, then this is a no-op

Parameters
chanThe channel that initiated the async announcement

Definition at line 2256 of file app_confbridge.c.

References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_cond_signal, ast_mutex_lock, ast_mutex_unlock, async_datastore_data::cond, ast_datastore::data, async_datastore_data::lock, NULL, and async_datastore_data::wait.

Referenced by conf_handle_dtmf(), confbridge_exec(), and join_callback().

2257 {
2258  struct ast_datastore *async_datastore;
2259  struct async_datastore_data *add;
2260 
2261  ast_channel_lock(chan);
2262  async_datastore = ast_channel_datastore_find(chan, &async_datastore_info, NULL);
2263  ast_channel_unlock(chan);
2264  if (!async_datastore) {
2265  return;
2266  }
2267 
2268  add = async_datastore->data;
2269 
2270  ast_mutex_lock(&add->lock);
2271  add->wait = 0;
2272  ast_cond_signal(&add->cond);
2273  ast_mutex_unlock(&add->lock);
2274 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
#define ast_mutex_lock(a)
Definition: lock.h:187
Structure for a data store object.
Definition: datastore.h:68
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition: channel.c:2390
#define NULL
Definition: resample.c:96
#define ast_cond_signal(cond)
Definition: lock.h:201
static struct ast_datastore_info async_datastore_info
Datastore used for timing of async announcement playback.
#define ast_channel_unlock(chan)
Definition: channel.h:2903
void * data
Definition: datastore.h:70
#define ast_mutex_unlock(a)
Definition: lock.h:188

◆ conf_add_post_join_action()

int conf_add_post_join_action ( struct confbridge_user user,
int(*)(struct confbridge_user *user func 
)

Queue a function to run with the given conference bridge user as an argument once the state transition is complete.

Parameters
userThe conference bridge user to pass to the function
funcThe function to queue
Return values
0success
non-zerofailure

Definition at line 1413 of file app_confbridge.c.

References ast_calloc, AST_LIST_INSERT_TAIL, post_join_action::func, post_join_action::list, and confbridge_user::post_join_list.

Referenced by conf_default_join_waitmarked(), join_marked(), join_unmarked(), and transition_to_marked().

1414 {
1415  struct post_join_action *action;
1416  if (!(action = ast_calloc(1, sizeof(*action)))) {
1417  return -1;
1418  }
1419  action->func = func;
1420  AST_LIST_INSERT_TAIL(&user->post_join_list, action, list);
1421  return 0;
1422 }
struct confbridge_user::@90 post_join_list
struct post_join_action::@89 list
int(* func)(struct confbridge_user *user)
Definition: confbridge.h:265
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:730
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:204

◆ conf_add_user_active()

void conf_add_user_active ( struct confbridge_conference conference,
struct confbridge_user user 
)

Add a conference bridge user as an unmarked active user of the conference.

Parameters
conferenceThe conference bridge to add the user to
userThe conference bridge user to add to the conference

Definition at line 4223 of file app_confbridge.c.

References confbridge_conference::active_list, confbridge_conference::activeusers, AST_LIST_INSERT_TAIL, and confbridge_user::list.

Referenced by join_active(), and join_unmarked().

4224 {
4225  AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4226  conference->activeusers++;
4227 }
struct post_join_action::@89 list
struct confbridge_conference::@87 active_list
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:730
unsigned int activeusers
Definition: confbridge.h:248

◆ conf_add_user_marked()

void conf_add_user_marked ( struct confbridge_conference conference,
struct confbridge_user user 
)

Add a conference bridge user as a marked active user of the conference.

Parameters
conferenceThe conference bridge to add the user to
userThe conference bridge user to add to the conference

Definition at line 4229 of file app_confbridge.c.

References confbridge_conference::active_list, confbridge_conference::activeusers, AST_LIST_INSERT_TAIL, confbridge_user::list, and confbridge_conference::markedusers.

Referenced by join_marked().

4230 {
4231  AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4232  conference->activeusers++;
4233  conference->markedusers++;
4234 }
unsigned int markedusers
Definition: confbridge.h:249
struct post_join_action::@89 list
struct confbridge_conference::@87 active_list
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:730
unsigned int activeusers
Definition: confbridge.h:248

◆ conf_add_user_waiting()

void conf_add_user_waiting ( struct confbridge_conference conference,
struct confbridge_user user 
)

Add a conference bridge user as an waiting user of the conference.

Parameters
conferenceThe conference bridge to add the user to
userThe conference bridge user to add to the conference

Definition at line 4236 of file app_confbridge.c.

References AST_LIST_INSERT_TAIL, confbridge_user::list, confbridge_conference::waiting_list, and confbridge_conference::waitingusers.

Referenced by conf_default_join_waitmarked().

4237 {
4238  AST_LIST_INSERT_TAIL(&conference->waiting_list, user, list);
4239  conference->waitingusers++;
4240 }
unsigned int waitingusers
Definition: confbridge.h:250
struct post_join_action::@89 list
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:730
struct confbridge_conference::@88 waiting_list

◆ conf_announce_channel_push()

int conf_announce_channel_push ( struct ast_channel ast)

Push the announcer channel into the conference.

Since
12.0.0
Parameters
astEither channel in the announcer channel pair.
Return values
0on success.
-1on error.

Definition at line 144 of file conf_chan_announce.c.

References ao2_cleanup, ao2_lock, ao2_ref, ao2_unlock, AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE, ast_bridge_features_new(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_INDEPENDENT, ast_channel_tech_pvt(), ast_set_flag, AST_UNREAL_CARETAKER_THREAD, ast_bridge_features::feature_flags, lock, NULL, RAII_VAR, and SCOPED_CHANNELLOCK.

Referenced by push_announcer().

145 {
146  struct ast_bridge_features *features;
147  struct ast_channel *chan;
148  RAII_VAR(struct announce_pvt *, p, NULL, ao2_cleanup);
149 
150  {
151  SCOPED_CHANNELLOCK(lock, ast);
152 
153  p = ast_channel_tech_pvt(ast);
154  if (!p) {
155  return -1;
156  }
157  ao2_ref(p, +1);
158  chan = p->base.chan;
159  if (!chan) {
160  return -1;
161  }
162  }
163 
164  features = ast_bridge_features_new();
165  if (!features) {
166  return -1;
167  }
169 
170  /* Impart the output channel into the bridge */
171  if (ast_bridge_impart(p->bridge, chan, NULL, features,
173  return -1;
174  }
175  ao2_lock(p);
177  ao2_unlock(p);
178  return 0;
179 }
Main Channel structure associated with a channel.
Structure that contains features information.
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define ast_set_flag(p, flag)
Definition: utils.h:70
#define AST_UNREAL_CARETAKER_THREAD
Definition: core_unreal.h:107
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
struct ast_flags feature_flags
int ast_bridge_impart(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, enum ast_bridge_impart_flags flags) attribute_warn_unused_result
Impart a channel to a bridge (non-blocking)
Definition: bridge.c:1924
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
Definition: lock.h:617
#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:911
ast_mutex_t lock
Definition: app_meetme.c:1091
#define ao2_ref(o, delta)
Definition: astobj2.h:464
#define ao2_lock(a)
Definition: astobj2.h:718
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
Definition: bridge.c:3750
#define ao2_cleanup(obj)
Definition: astobj2.h:1958

◆ conf_announce_get_tech()

struct ast_channel_tech* conf_announce_get_tech ( void  )

Get ConfBridge announce channel technology struct.

Since
12.0.0
Returns
ConfBridge announce channel technology.

Definition at line 139 of file conf_chan_announce.c.

References announce_tech.

Referenced by announce_request(), load_module(), and unload_module().

140 {
141  return &announce_tech;
142 }
static struct ast_channel_tech announce_tech

◆ conf_bridge_profile_copy()

void conf_bridge_profile_copy ( struct bridge_profile dst,
struct bridge_profile src 
)

copies a bridge profile

Note
conf_bridge_profile_destroy must be called on the dst structure

Definition at line 2516 of file conf_config_parser.c.

References ao2_ref, and bridge_profile::sounds.

Referenced by conf_find_bridge_profile(), and join_conference_bridge().

2517 {
2518  *dst = *src;
2519  if (src->sounds) {
2520  ao2_ref(src->sounds, +1);
2521  }
2522 }
struct bridge_profile_sounds * sounds
Definition: confbridge.h:235
#define ao2_ref(o, delta)
Definition: astobj2.h:464

◆ conf_bridge_profile_destroy()

void conf_bridge_profile_destroy ( struct bridge_profile b_profile)

Destroy a bridge profile found by 'conf_find_bridge_profile'.

Definition at line 2524 of file conf_config_parser.c.

References ao2_ref, NULL, and bridge_profile::sounds.

Referenced by confbridge_exec(), destroy_conference_bridge(), func_confbridge_data_destructor(), func_confbridge_helper(), and handle_cli_confbridge_show_bridge_profile().

2525 {
2526  if (b_profile->sounds) {
2527  ao2_ref(b_profile->sounds, -1);
2528  b_profile->sounds = NULL;
2529  }
2530 }
struct bridge_profile_sounds * sounds
Definition: confbridge.h:235
#define NULL
Definition: resample.c:96
#define ao2_ref(o, delta)
Definition: astobj2.h:464

◆ conf_destroy_config()

void conf_destroy_config ( void  )

destroy the information loaded from the confbridge.conf file

Definition at line 2687 of file conf_config_parser.c.

References aco_info_destroy(), ao2_global_obj_release, ARRAY_LEN, ast_cli_unregister_multiple(), and cfg_handle.

Referenced by conf_load_config(), and unload_module().

2688 {
2690  aco_info_destroy(&cfg_info);
2692 }
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Definition: clicompat.c:30
void aco_info_destroy(struct aco_info *info)
Destroy an initialized aco_info struct.
static struct ast_cli_entry cli_confbridge_parser[]
#define ao2_global_obj_release(holder)
Definition: astobj2.h:865
static corosync_cfg_handle_t cfg_handle
Definition: res_corosync.c:284

◆ conf_ended()

void conf_ended ( struct confbridge_conference conference)

Callback to be called when the conference has become empty.

Parameters
conferenceThe conference bridge

Definition at line 1441 of file app_confbridge.c.

References ao2_lock, ao2_unlink, ao2_unlock, ast_context_remove_extension(), ast_strlen_zero, confbridge_conference::b_profile, conf_stop_record(), E_MATCH, confbridge_conference::name, NULL, pbx_find_extension(), bridge_profile::regcontext, send_conf_end_event(), and pbx_find_info::stacklen.

Referenced by transition_to_empty().

1442 {
1443  struct pbx_find_info q = { .stacklen = 0 };
1444 
1445  /* Called with a reference to conference */
1446  ao2_unlink(conference_bridges, conference);
1447  send_conf_end_event(conference);
1448  if (!ast_strlen_zero(conference->b_profile.regcontext) &&
1449  pbx_find_extension(NULL, NULL, &q, conference->b_profile.regcontext,
1450  conference->name, 1, NULL, "", E_MATCH)) {
1452  conference->name, 1, NULL);
1453  }
1454  ao2_lock(conference);
1455  conf_stop_record(conference);
1456  ao2_unlock(conference);
1457 }
static void send_conf_end_event(struct confbridge_conference *conference)
static int conf_stop_record(struct confbridge_conference *conference)
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
int ast_context_remove_extension(const char *context, const char *extension, int priority, const char *registrar)
Simply remove extension from context.
Definition: pbx.c:4952
struct bridge_profile b_profile
Definition: confbridge.h:247
#define ao2_lock(a)
Definition: astobj2.h:718
struct ao2_container * conference_bridges
Container to hold all conference bridges in progress.
#define ao2_unlink(container, obj)
Definition: astobj2.h:1598
#define ast_strlen_zero(a)
Definition: muted.c:73
int stacklen
Definition: extconf.h:238
char regcontext[AST_MAX_CONTEXT]
Definition: confbridge.h:236
char name[MAX_CONF_NAME]
Definition: confbridge.h:244
struct ast_exten * pbx_find_extension(struct ast_channel *chan, struct ast_context *bypass, struct pbx_find_info *q, const char *context, const char *exten, int priority, const char *label, const char *callerid, enum ext_match_t action)
Definition: ael_main.c:152

◆ conf_find_bridge()

struct confbridge_conference* conf_find_bridge ( const char *  conference_name)

Find a confbridge by name.

Since
13.22.0
15.5.0
Parameters
confbridge_nameThe name to search for
Returns
ConfBridge (which must be unreffed) or NULL.

Definition at line 755 of file app_confbridge.c.

References ao2_find, and OBJ_KEY.

Referenced by confbridge_publish_manager_event().

756 {
757  return ao2_find(conference_bridges, conference_name, OBJ_KEY);
758 }
#define OBJ_KEY
Definition: astobj2.h:1155
struct ao2_container * conference_bridges
Container to hold all conference bridges in progress.
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756

◆ conf_find_bridge_profile()

const struct bridge_profile* conf_find_bridge_profile ( struct ast_channel chan,
const char *  bridge_profile_name,
struct bridge_profile result 
)

Find a bridge profile given a bridge profile's name and store that profile in result structure.

Parameters
chanchannel the bridge profile is requested for
bridge_profile_namename of the profile requested (optional)
resultdata contained by the bridge profile will be copied to this struct pointer

If bridge_profile_name is not provided, this function will check for the presence of a bridge profile set by the CONFBRIDGE function on a channel datastore. If that doesn't exist, the default_bridge profile is used.

Return values
bridgeprofile on success
NULLon failure

Definition at line 2532 of file conf_config_parser.c.

References ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlock, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_strlen_zero, func_confbridge_data::b_profile, func_confbridge_data::b_usable, cfg_handle, conf_bridge_profile_copy(), ast_datastore::data, DEFAULT_BRIDGE_PROFILE, NULL, OBJ_KEY, RAII_VAR, and result.

Referenced by bridge_template_handler(), confbridge_exec(), and handle_cli_confbridge_show_bridge_profile().

2533 {
2534  struct bridge_profile *tmp2;
2535  struct ast_datastore *datastore = NULL;
2536  struct func_confbridge_data *b_data = NULL;
2538 
2539  if (chan && ast_strlen_zero(bridge_profile_name)) {
2540  ast_channel_lock(chan);
2542  ast_channel_unlock(chan);
2543  if (datastore) {
2544  b_data = datastore->data;
2545  if (b_data->b_usable) {
2546  conf_bridge_profile_copy(result, &b_data->b_profile);
2547  return result;
2548  }
2549  }
2550  }
2551 
2552  if (!cfg) {
2553  return NULL;
2554  }
2555  if (ast_strlen_zero(bridge_profile_name)) {
2556  bridge_profile_name = DEFAULT_BRIDGE_PROFILE;
2557  }
2558  if (!(tmp2 = ao2_find(cfg->bridge_profiles, bridge_profile_name, OBJ_KEY))) {
2559  return NULL;
2560  }
2561  ao2_lock(tmp2);
2562  conf_bridge_profile_copy(result, tmp2);
2563  ao2_unlock(tmp2);
2564  ao2_ref(tmp2, -1);
2565 
2566  return result;
2567 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
#define OBJ_KEY
Definition: astobj2.h:1155
struct bridge_profile b_profile
#define ao2_global_obj_ref(holder)
Definition: astobj2.h:925
#define ao2_unlock(a)
Definition: astobj2.h:730
Structure for a data store object.
Definition: datastore.h:68
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition: channel.c:2390
#define NULL
Definition: resample.c:96
void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src)
copies a bridge profile
#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:911
#define ao2_ref(o, delta)
Definition: astobj2.h:464
#define ao2_lock(a)
Definition: astobj2.h:718
static const struct ast_datastore_info confbridge_datastore
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_channel_unlock(chan)
Definition: channel.h:2903
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
static corosync_cfg_handle_t cfg_handle
Definition: res_corosync.c:284
void * data
Definition: datastore.h:70
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
static PGresult * result
Definition: cel_pgsql.c:88
#define DEFAULT_BRIDGE_PROFILE
Definition: confbridge.h:42

◆ conf_find_menu_entry_by_sequence()

int conf_find_menu_entry_by_sequence ( const char *  dtmf_sequence,
struct conf_menu menu,
struct conf_menu_entry result 
)

Finds a menu_entry in a menu structure matched by DTMF sequence.

Note
the menu entry found must be destroyed using conf_menu_entry_destroy()
Return values
1success, entry is found and stored in result
0failure, no entry found for given DTMF sequence

Definition at line 2603 of file conf_config_parser.c.

References ao2_lock, ao2_unlock, AST_LIST_TRAVERSE, copy_menu_entry(), conf_menu_entry::dtmf, conf_menu::entries, and NULL.

Referenced by action_playback_and_continue().

2604 {
2605  struct conf_menu_entry *menu_entry = NULL;
2606 
2607  ao2_lock(menu);
2608  AST_LIST_TRAVERSE(&menu->entries, menu_entry, entry) {
2609  if (!strcasecmp(menu_entry->dtmf, dtmf_sequence)) {
2610  copy_menu_entry(result, menu_entry);
2611  ao2_unlock(menu);
2612  return 1;
2613  }
2614  }
2615  ao2_unlock(menu);
2616 
2617  return 0;
2618 }
Definition: confbridge.h:135
struct conf_menu::@86 entries
#define ao2_unlock(a)
Definition: astobj2.h:730
#define NULL
Definition: resample.c:96
char dtmf[MAXIMUM_DTMF_FEATURE_STRING]
Definition: confbridge.h:137
static int copy_menu_entry(struct conf_menu_entry *dst, struct conf_menu_entry *src)
#define ao2_lock(a)
Definition: astobj2.h:718
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
Definition: search.h:40

◆ conf_find_user_profile()

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.

Parameters
chanchannel the user profile is requested for
user_profile_namename of the profile requested (optional)
resultdata contained by the user profile will be copied to this struct pointer

If user_profile_name is not provided, this function will check for the presence of a user profile set by the CONFBRIDGE function on a channel datastore. If that doesn't exist, the default_user profile is used.

Return values
userprofile on success
NULLon failure

Definition at line 2479 of file conf_config_parser.c.

References ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlock, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_strlen_zero, cfg_handle, conf_user_profile_copy(), ast_datastore::data, DEFAULT_USER_PROFILE, NULL, OBJ_KEY, RAII_VAR, result, func_confbridge_data::u_profile, and func_confbridge_data::u_usable.

Referenced by conf_send_event_to_participants(), confbridge_exec(), handle_cli_confbridge_show_user_profile(), and user_template_handler().

2480 {
2481  struct user_profile *tmp2;
2482  struct ast_datastore *datastore = NULL;
2483  struct func_confbridge_data *b_data = NULL;
2485 
2486  if (chan && ast_strlen_zero(user_profile_name)) {
2487  ast_channel_lock(chan);
2489  ast_channel_unlock(chan);
2490  if (datastore) {
2491  b_data = datastore->data;
2492  if (b_data->u_usable) {
2493  conf_user_profile_copy(result, &b_data->u_profile);
2494  return result;
2495  }
2496  }
2497  }
2498 
2499  if (!cfg) {
2500  return NULL;
2501  }
2502  if (ast_strlen_zero(user_profile_name)) {
2503  user_profile_name = DEFAULT_USER_PROFILE;
2504  }
2505  if (!(tmp2 = ao2_find(cfg->user_profiles, user_profile_name, OBJ_KEY))) {
2506  return NULL;
2507  }
2508  ao2_lock(tmp2);
2509  conf_user_profile_copy(result, tmp2);
2510  ao2_unlock(tmp2);
2511  ao2_ref(tmp2, -1);
2512 
2513  return result;
2514 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
struct user_profile u_profile
#define OBJ_KEY
Definition: astobj2.h:1155
static void conf_user_profile_copy(struct user_profile *dst, struct user_profile *src)
#define ao2_global_obj_ref(holder)
Definition: astobj2.h:925
#define ao2_unlock(a)
Definition: astobj2.h:730
Structure for a data store object.
Definition: datastore.h:68
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition: channel.c:2390
#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:911
#define ao2_ref(o, delta)
Definition: astobj2.h:464
#define ao2_lock(a)
Definition: astobj2.h:718
static const struct ast_datastore_info confbridge_datastore
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_channel_unlock(chan)
Definition: channel.h:2903
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
static corosync_cfg_handle_t cfg_handle
Definition: res_corosync.c:284
void * data
Definition: datastore.h:70
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
static PGresult * result
Definition: cel_pgsql.c:88
#define DEFAULT_USER_PROFILE
Definition: confbridge.h:41

◆ conf_get_sound()

const char* conf_get_sound ( enum conf_sounds  sound,
struct bridge_profile_sounds custom_sounds 
)

Looks to see if sound file is stored in bridge profile sounds, if not default sound is provided.

Definition at line 494 of file app_confbridge.c.

References bridge_profile_sounds::begin, bridge_profile_sounds::binauraloff, bridge_profile_sounds::binauralon, CONF_SOUND_BEGIN, CONF_SOUND_BINAURAL_OFF, CONF_SOUND_BINAURAL_ON, CONF_SOUND_ERROR_MENU, CONF_SOUND_GET_PIN, CONF_SOUND_HAS_JOINED, CONF_SOUND_HAS_LEFT, CONF_SOUND_INVALID_PIN, CONF_SOUND_JOIN, CONF_SOUND_KICKED, CONF_SOUND_LEADER_HAS_LEFT, CONF_SOUND_LEAVE, CONF_SOUND_LOCKED, CONF_SOUND_LOCKED_NOW, CONF_SOUND_MUTED, CONF_SOUND_ONLY_ONE, CONF_SOUND_ONLY_PERSON, CONF_SOUND_OTHER_IN_PARTY, CONF_SOUND_PARTICIPANTS_MUTED, CONF_SOUND_PARTICIPANTS_UNMUTED, CONF_SOUND_PLACE_IN_CONF, CONF_SOUND_THERE_ARE, CONF_SOUND_UNLOCKED_NOW, CONF_SOUND_UNMUTED, CONF_SOUND_WAIT_FOR_LEADER, bridge_profile_sounds::errormenu, bridge_profile_sounds::getpin, bridge_profile_sounds::hasjoin, bridge_profile_sounds::hasleft, bridge_profile_sounds::invalidpin, bridge_profile_sounds::join, bridge_profile_sounds::kicked, bridge_profile_sounds::leaderhasleft, bridge_profile_sounds::leave, bridge_profile_sounds::locked, bridge_profile_sounds::lockednow, bridge_profile_sounds::muted, bridge_profile_sounds::onlyone, bridge_profile_sounds::onlyperson, bridge_profile_sounds::otherinparty, bridge_profile_sounds::participantsmuted, bridge_profile_sounds::participantsunmuted, bridge_profile_sounds::placeintoconf, S_OR, bridge_profile_sounds::thereare, bridge_profile_sounds::unlockednow, bridge_profile_sounds::unmuted, and bridge_profile_sounds::waitforleader.

Referenced by action_kick_last(), action_toggle_binaural(), action_toggle_mute(), action_toggle_mute_participants(), announce_user_count(), conf_get_pin(), conf_handle_inactive_waitmarked(), conf_handle_only_person(), confbridge_exec(), execute_menu_entry(), handle_cli_confbridge_show_bridge_profile(), join_conference_bridge(), leave_marked(), and post_join_play_begin().

495 {
496  switch (sound) {
498  return S_OR(custom_sounds->hasjoin, "conf-hasjoin");
499  case CONF_SOUND_HAS_LEFT:
500  return S_OR(custom_sounds->hasleft, "conf-hasleft");
501  case CONF_SOUND_KICKED:
502  return S_OR(custom_sounds->kicked, "conf-kicked");
503  case CONF_SOUND_MUTED:
504  return S_OR(custom_sounds->muted, "conf-muted");
505  case CONF_SOUND_UNMUTED:
506  return S_OR(custom_sounds->unmuted, "conf-unmuted");
508  return S_OR(custom_sounds->binauralon, "confbridge-binaural-on");
510  return S_OR(custom_sounds->binauraloff, "confbridge-binaural-off");
511  case CONF_SOUND_ONLY_ONE:
512  return S_OR(custom_sounds->onlyone, "conf-onlyone");
514  return S_OR(custom_sounds->thereare, "conf-thereare");
516  return S_OR(custom_sounds->otherinparty, "conf-otherinparty");
518  return S_OR(custom_sounds->placeintoconf, "conf-placeintoconf");
520  return S_OR(custom_sounds->waitforleader, "conf-waitforleader");
522  return S_OR(custom_sounds->leaderhasleft, "conf-leaderhasleft");
523  case CONF_SOUND_GET_PIN:
524  return S_OR(custom_sounds->getpin, "conf-getpin");
526  return S_OR(custom_sounds->invalidpin, "conf-invalidpin");
528  return S_OR(custom_sounds->onlyperson, "conf-onlyperson");
529  case CONF_SOUND_LOCKED:
530  return S_OR(custom_sounds->locked, "conf-locked");
532  return S_OR(custom_sounds->lockednow, "conf-lockednow");
534  return S_OR(custom_sounds->unlockednow, "conf-unlockednow");
536  return S_OR(custom_sounds->errormenu, "conf-errormenu");
537  case CONF_SOUND_JOIN:
538  return S_OR(custom_sounds->join, "confbridge-join");
539  case CONF_SOUND_LEAVE:
540  return S_OR(custom_sounds->leave, "confbridge-leave");
542  return S_OR(custom_sounds->participantsmuted, "conf-now-muted");
544  return S_OR(custom_sounds->participantsunmuted, "conf-now-unmuted");
545  case CONF_SOUND_BEGIN:
546  return S_OR(custom_sounds->begin, "confbridge-conf-begin");
547  }
548 
549  return "";
550 }
const ast_string_field unlockednow
Definition: confbridge.h:221
const ast_string_field thereare
Definition: confbridge.h:221
const ast_string_field join
Definition: confbridge.h:221
const ast_string_field otherinparty
Definition: confbridge.h:221
const ast_string_field onlyone
Definition: confbridge.h:221
const ast_string_field hasjoin
Definition: confbridge.h:221
const ast_string_field begin
Definition: confbridge.h:221
const ast_string_field errormenu
Definition: confbridge.h:221
const ast_string_field binauraloff
Definition: confbridge.h:221
const ast_string_field waitforleader
Definition: confbridge.h:221
const ast_string_field getpin
Definition: confbridge.h:221
const ast_string_field participantsmuted
Definition: confbridge.h:221
const ast_string_field leave
Definition: confbridge.h:221
const ast_string_field lockednow
Definition: confbridge.h:221
const ast_string_field binauralon
Definition: confbridge.h:221
const ast_string_field participantsunmuted
Definition: confbridge.h:221
const ast_string_field unmuted
Definition: confbridge.h:221
const ast_string_field invalidpin
Definition: confbridge.h:221
const ast_string_field onlyperson
Definition: confbridge.h:221
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
Definition: strings.h:79
const ast_string_field muted
Definition: confbridge.h:221
const ast_string_field leaderhasleft
Definition: confbridge.h:221
const ast_string_field kicked
Definition: confbridge.h:221
const ast_string_field locked
Definition: confbridge.h:221
const ast_string_field placeintoconf
Definition: confbridge.h:221
const ast_string_field hasleft
Definition: confbridge.h:221

◆ conf_handle_dtmf()

int conf_handle_dtmf ( struct ast_bridge_channel bridge_channel,
struct confbridge_user user,
struct conf_menu_entry menu_entry,
struct conf_menu menu 
)

Once a DTMF sequence matches a sequence in the user's DTMF menu, this function will get called to perform the menu action.

Parameters
bridge_channelBridged channel this is involving
userthe conference user to perform the action on.
menu_entrythe menu entry that invoked this callback to occur.
menuan AO2 referenced pointer to the entire menu structure the menu_entry derived from.
Note
The menu_entry is a deep copy of the entry found in the menu structure. This allows for the menu_entry to be accessed without requiring the menu lock. If the menu must be accessed, the menu lock must be held. Reference counting of the menu structure is handled outside of the scope of this function.
Return values
0success
-1failure

Definition at line 3181 of file app_confbridge.c.

References async_play_sound_ready(), ast_bridge_channel::chan, conf_moh_suspend(), conf_moh_unsuspend(), confbridge_user::conference, and execute_menu_entry().

Referenced by menu_hook_callback().

3185 {
3186  /* See if music on hold is playing */
3187  conf_moh_suspend(user);
3188 
3189  /* execute the list of actions associated with this menu entry */
3190  execute_menu_entry(user->conference, user, bridge_channel, menu_entry, menu);
3191 
3192  /* See if music on hold needs to be started back up again */
3193  conf_moh_unsuspend(user);
3194 
3195  async_play_sound_ready(bridge_channel->chan);
3196 
3197  return 0;
3198 }
static void conf_moh_unsuspend(struct confbridge_user *user)
static void conf_moh_suspend(struct confbridge_user *user)
struct confbridge_conference * conference
Definition: confbridge.h:271
void async_play_sound_ready(struct ast_channel *chan)
Indicate the initiator of an async sound file is ready for it to play.
static int execute_menu_entry(struct confbridge_conference *conference, struct confbridge_user *user, struct ast_bridge_channel *bridge_channel, struct conf_menu_entry *menu_entry, struct conf_menu *menu)
struct ast_channel * chan

◆ conf_handle_first_join()

void conf_handle_first_join ( struct confbridge_conference conference)

Callback to execute any time we transition from zero to one active users.

Parameters
conferenceThe conference bridge with a single active user joined
Return values
0success
-1failure

Definition at line 1425 of file app_confbridge.c.

References AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), and confbridge_conference::name.

Referenced by join_marked(), join_unmarked(), and join_waitmarked().

1426 {
1427  ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", conference->name);
1428 }
int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cachable, const char *fmt,...)
Tells Asterisk the State for Device is changed.
Definition: devicestate.c:510
char name[MAX_CONF_NAME]
Definition: confbridge.h:244

◆ conf_handle_inactive_waitmarked()

int conf_handle_inactive_waitmarked ( struct confbridge_user user)

Handle actions every time a waitmarked user joins w/o a marked user present.

Parameters
userThe waitmarked user
Return values
0success
-1failure

Definition at line 1389 of file app_confbridge.c.

References ast_test_flag, confbridge_conference::b_profile, conf_get_sound(), CONF_SOUND_WAIT_FOR_LEADER, confbridge_user::conference, play_prompt_to_user(), bridge_profile::sounds, confbridge_user::u_profile, and USER_OPT_QUIET.

Referenced by conf_default_join_waitmarked().

1390 {
1391  /* If we have not been quieted play back that they are waiting for the leader */
1394  /* user hungup while the sound was playing */
1395  return -1;
1396  }
1397  return 0;
1398 }
struct confbridge_conference * conference
Definition: confbridge.h:271
const char * conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds)
Looks to see if sound file is stored in bridge profile sounds, if not default sound is provided...
#define ast_test_flag(p, flag)
Definition: utils.h:63
struct bridge_profile_sounds * sounds
Definition: confbridge.h:235
struct bridge_profile b_profile
Definition: confbridge.h:247
struct user_profile u_profile
Definition: confbridge.h:273
static int play_prompt_to_user(struct confbridge_user *user, const char *filename)
Play back an audio file to a channel.

◆ conf_handle_only_person()

int conf_handle_only_person ( struct confbridge_user user)

Handle actions whenever an user joins an empty conference.

Parameters
userThe user

Definition at line 1400 of file app_confbridge.c.

References ast_test_flag, confbridge_conference::b_profile, conf_get_sound(), CONF_SOUND_ONLY_PERSON, confbridge_user::conference, play_prompt_to_user(), bridge_profile::sounds, confbridge_user::u_profile, USER_OPT_NOONLYPERSON, and USER_OPT_QUIET.

Referenced by join_marked(), and join_unmarked().

1401 {
1402  /* If audio prompts have not been quieted or this prompt quieted play it on out */
1404  if (play_prompt_to_user(user,
1406  /* user hungup while the sound was playing */
1407  return -1;
1408  }
1409  }
1410  return 0;
1411 }
struct confbridge_conference * conference
Definition: confbridge.h:271
const char * conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds)
Looks to see if sound file is stored in bridge profile sounds, if not default sound is provided...
#define ast_test_flag(p, flag)
Definition: utils.h:63
struct bridge_profile_sounds * sounds
Definition: confbridge.h:235
struct bridge_profile b_profile
Definition: confbridge.h:247
struct user_profile u_profile
Definition: confbridge.h:273
static int play_prompt_to_user(struct confbridge_user *user, const char *filename)
Play back an audio file to a channel.

◆ conf_handle_second_active()

void conf_handle_second_active ( struct confbridge_conference conference)

Handle when a conference moves to having more than one active participant.

Parameters
conferenceThe conference bridge with more than one active participant

Definition at line 1430 of file app_confbridge.c.

References confbridge_conference::active_list, AST_LIST_FIRST, ast_test_flag, conf_moh_stop(), conf_update_user_mute(), confbridge_user::u_profile, and USER_OPT_MUSICONHOLD.

Referenced by join_active(), join_marked(), and join_unmarked().

1431 {
1432  /* If we are the second participant we may need to stop music on hold on the first */
1433  struct confbridge_user *first_user = AST_LIST_FIRST(&conference->active_list);
1434 
1435  if (ast_test_flag(&first_user->u_profile, USER_OPT_MUSICONHOLD)) {
1436  conf_moh_stop(first_user);
1437  }
1438  conf_update_user_mute(first_user);
1439 }
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
Definition: linkedlists.h:420
#define ast_test_flag(p, flag)
Definition: utils.h:63
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
struct confbridge_conference::@87 active_list
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
The structure that represents a conference bridge user.
Definition: confbridge.h:270
struct user_profile u_profile
Definition: confbridge.h:273

◆ conf_load_config()

int conf_load_config ( void  )

load confbridge.conf file

Definition at line 2378 of file conf_config_parser.c.

References __stringify, ACO_EXACT, aco_info_init(), aco_option_register, aco_option_register_custom, ACO_PREFIX, aco_process_config(), ACO_PROCESS_ERROR, ACO_REGEX, announce_user_count_all_handler(), ARRAY_LEN, ast_cli_register_multiple, BRIDGE_OPT_BINAURAL_ACTIVE, BRIDGE_OPT_ENABLE_EVENTS, BRIDGE_OPT_RECORD_CONFERENCE, BRIDGE_OPT_RECORD_FILE_APPEND, BRIDGE_OPT_RECORD_FILE_TIMESTAMP, bridge_template_handler(), CHARFLDSET, conf_destroy_config(), DEFAULT_SILENCE_THRESHOLD, DEFAULT_TALKING_THRESHOLD, error(), FLDSET, language, menu_option_handler(), menu_template_handler(), mix_interval_handler(), NULL, OPT_BOOLFLAG_T, OPT_CHAR_ARRAY_T, OPT_NOOP_T, OPT_UINT_T, PARSE_DEFAULT, regcontext, remb_behavior_handler(), sound_option_handler(), timeout, USER_OPT_ADMIN, USER_OPT_ANNOUNCE_JOIN_LEAVE, USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW, USER_OPT_ANNOUNCEUSERCOUNT, USER_OPT_DENOISE, USER_OPT_DROP_SILENCE, USER_OPT_DTMF_PASS, USER_OPT_ECHO_EVENTS, USER_OPT_ENDMARKED, USER_OPT_JITTERBUFFER, USER_OPT_MARKEDUSER, USER_OPT_MUSICONHOLD, USER_OPT_NOONLYPERSON, USER_OPT_QUIET, USER_OPT_SEND_EVENTS, USER_OPT_STARTMUTED, USER_OPT_TALKER_DETECT, USER_OPT_TEXT_MESSAGING, USER_OPT_WAITMARKED, user_template_handler(), and video_mode_handler().

Referenced by load_module().

2379 {
2380  if (aco_info_init(&cfg_info)) {
2381  return -1;
2382  }
2383 
2384  /* User options */
2385  aco_option_register(&cfg_info, "type", ACO_EXACT, user_types, NULL, OPT_NOOP_T, 0, 0);
2386  aco_option_register(&cfg_info, "admin", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ADMIN);
2387  aco_option_register(&cfg_info, "send_events", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_SEND_EVENTS);
2388  aco_option_register(&cfg_info, "echo_events", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ECHO_EVENTS);
2389  aco_option_register(&cfg_info, "marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MARKEDUSER);
2390  aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);
2391  aco_option_register(&cfg_info, "music_on_hold_when_empty", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MUSICONHOLD);
2392  aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);
2393  aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);
2394  aco_option_register(&cfg_info, "announce_user_count", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANNOUNCEUSERCOUNT);
2395  /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */
2396  aco_option_register(&cfg_info, "announce_only_user", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 0, FLDSET(struct user_profile, flags), USER_OPT_NOONLYPERSON);
2397  aco_option_register(&cfg_info, "wait_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_WAITMARKED);
2398  aco_option_register(&cfg_info, "end_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKED);
2399  aco_option_register(&cfg_info, "talk_detection_events", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_TALKER_DETECT);
2400  aco_option_register(&cfg_info, "dtmf_passthrough", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DTMF_PASS);
2401  aco_option_register(&cfg_info, "announce_join_leave", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANNOUNCE_JOIN_LEAVE);
2402  aco_option_register(&cfg_info, "announce_join_leave_review", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW);
2403  aco_option_register(&cfg_info, "pin", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, pin));
2404  aco_option_register(&cfg_info, "music_on_hold_class", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, moh_class));
2405  aco_option_register(&cfg_info, "announcement", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, announcement));
2406  aco_option_register(&cfg_info, "denoise", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DENOISE);
2407  aco_option_register(&cfg_info, "dsp_drop_silence", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DROP_SILENCE);
2408  aco_option_register(&cfg_info, "dsp_silence_threshold", ACO_EXACT, user_types, __stringify(DEFAULT_SILENCE_THRESHOLD), OPT_UINT_T, 0, FLDSET(struct user_profile, silence_threshold));
2409  aco_option_register(&cfg_info, "dsp_talking_threshold", ACO_EXACT, user_types, __stringify(DEFAULT_TALKING_THRESHOLD), OPT_UINT_T, 0, FLDSET(struct user_profile, talking_threshold));
2410  aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);
2411  aco_option_register(&cfg_info, "timeout", ACO_EXACT, user_types, "0", OPT_UINT_T, 0, FLDSET(struct user_profile, timeout));
2412  aco_option_register(&cfg_info, "text_messaging", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_TEXT_MESSAGING);
2413 
2414  /* This option should only be used with the CONFBRIDGE dialplan function */
2416 
2417 /* XXX ASTERISK-21271 need a user supplied bridge merge_priority to merge ConfBridges (default = 1, range 1-INT_MAX) */
2418  /* Bridge options */
2419  aco_option_register(&cfg_info, "type", ACO_EXACT, bridge_types, NULL, OPT_NOOP_T, 0, 0);
2420  aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), USER_OPT_JITTERBUFFER);
2421  /* "auto" will fail to parse as a uint, but we use PARSE_DEFAULT to set the value to 0 in that case, which is the value that auto resolves to */
2422  aco_option_register(&cfg_info, "internal_sample_rate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, PARSE_DEFAULT, FLDSET(struct bridge_profile, internal_sample_rate), 0);
2423  aco_option_register(&cfg_info, "binaural_active", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_BINAURAL_ACTIVE);
2424  aco_option_register(&cfg_info, "maximum_sample_rate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, PARSE_DEFAULT, FLDSET(struct bridge_profile, maximum_sample_rate), 0);
2425  aco_option_register_custom(&cfg_info, "mixing_interval", ACO_EXACT, bridge_types, "20", mix_interval_handler, 0);
2426  aco_option_register(&cfg_info, "record_conference", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_RECORD_CONFERENCE);
2428  aco_option_register(&cfg_info, "record_file_append", ACO_EXACT, bridge_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_RECORD_FILE_APPEND);
2429  aco_option_register(&cfg_info, "record_file_timestamp", ACO_EXACT, bridge_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_RECORD_FILE_TIMESTAMP);
2430  aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
2431  aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
2432  aco_option_register(&cfg_info, "record_options", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_options));
2433  aco_option_register(&cfg_info, "record_command", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_command));
2435  aco_option_register(&cfg_info, "language", ACO_EXACT, bridge_types, "en", OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, language));
2437  aco_option_register(&cfg_info, "video_update_discard", ACO_EXACT, bridge_types, "2000", OPT_UINT_T, 0, FLDSET(struct bridge_profile, video_update_discard));
2438  aco_option_register(&cfg_info, "remb_send_interval", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_send_interval));
2439  aco_option_register_custom(&cfg_info, "remb_behavior", ACO_EXACT, bridge_types, "average", remb_behavior_handler, 0);
2440  aco_option_register(&cfg_info, "remb_estimated_bitrate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_estimated_bitrate));
2441  aco_option_register(&cfg_info, "enable_events", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_ENABLE_EVENTS);
2442  /* This option should only be used with the CONFBRIDGE dialplan function */
2444 
2445  /* Menu options */
2446  aco_option_register(&cfg_info, "type", ACO_EXACT, menu_types, NULL, OPT_NOOP_T, 0, 0);
2447  /* This option should only be used with the CONFBRIDGE dialplan function */
2449  aco_option_register_custom(&cfg_info, "^[0-9A-D*#]+$", ACO_REGEX, menu_types, NULL, menu_option_handler, 0);
2450 
2451  if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
2452  goto error;
2453  }
2454 
2456  goto error;
2457  }
2458 
2459  return 0;
2460 error:
2462  return -1;
2463 }
static int mix_interval_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
#define ARRAY_LEN(a)
Definition: isdn_lib.c:42
static int sound_option_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
#define aco_option_register_custom(info, name, matchtype, types, default_val, handler, flags)
Register a config option.
#define aco_option_register(info, name, matchtype, types, default_val, opt_type, flags,...)
Register a config option.
static int timeout
Definition: cdr_mysql.c:86
#define CHARFLDSET(type, field)
A helper macro to pass the appropriate arguments to aco_option_register for OPT_CHAR_ARRAY_T.
Type for a default handler that should do nothing.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
enum aco_process_status aco_process_config(struct aco_info *info, int reload)
Process a config info via the options registered with an aco_info.
Type for default option handler for bools (ast_true/ast_false) that are stored in a flag...
#define NULL
Definition: resample.c:96
static struct aco_type * menu_types[]
Type for default option handler for character array strings.
static int menu_option_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
#define __stringify(x)
Definition: asterisk.h:214
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
#define DEFAULT_TALKING_THRESHOLD
Definition: confbridge.h:46
int aco_info_init(struct aco_info *info)
Initialize an aco_info structure.
Type for default option handler for unsigned integers.
static int video_mode_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static int bridge_template_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static char language[MAX_LANGUAGE]
Definition: chan_alsa.c:117
static int announce_user_count_all_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Their was an error and no changes were applied.
static int user_template_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
void conf_destroy_config(void)
destroy the information loaded from the confbridge.conf file
static struct ast_cli_entry cli_confbridge_parser[]
static struct aco_type * user_types[]
static struct aco_type * bridge_types[]
static int remb_behavior_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static char regcontext[AST_MAX_CONTEXT]
Definition: chan_iax2.c:321
int error(const char *format,...)
Definition: utils/frame.c:999
#define DEFAULT_SILENCE_THRESHOLD
Definition: confbridge.h:49
static int menu_template_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)

◆ conf_menu_entry_destroy()

void conf_menu_entry_destroy ( struct conf_menu_entry menu_entry)

Destroys and frees all the actions stored in a menu_entry structure.

Definition at line 2595 of file conf_config_parser.c.

References conf_menu_entry::actions, ast_free, AST_LIST_REMOVE_HEAD, and NULL.

Referenced by action_playback_and_continue(), conf_menu_profile_copy(), and menu_destructor().

2596 {
2597  struct conf_menu_action *menu_action = NULL;
2598  while ((menu_action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {
2599  ast_free(menu_action);
2600  }
2601 }
#define NULL
Definition: resample.c:96
struct conf_menu_entry::@84 actions
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Definition: linkedlists.h:832
#define ast_free(a)
Definition: astmm.h:182
struct conf_menu_action::@82 action

◆ conf_moh_start()

void conf_moh_start ( struct confbridge_user user)

Start MOH for the conference user.

Parameters
userConference user to start MOH on.
Returns
Nothing

Definition at line 1328 of file app_confbridge.c.

References ast_bridge_lock, ast_bridge_suspend(), ast_bridge_unlock, ast_bridge_unsuspend(), ast_moh_start(), confbridge_conference::bridge, confbridge_user::chan, confbridge_user::conference, user_profile::moh_class, NULL, confbridge_user::playing_moh, confbridge_user::suspended_moh, and confbridge_user::u_profile.

Referenced by conf_mute_moh_inactive_waitmarked(), conf_mute_only_active(), and leave_marked().

1329 {
1330  user->playing_moh = 1;
1331  if (!user->suspended_moh) {
1332  int in_bridge;
1333 
1334  /*
1335  * Locking the ast_bridge here is the only way to hold off the
1336  * call to ast_bridge_join() in confbridge_exec() from
1337  * interfering with the bridge and MOH operations here.
1338  */
1340 
1341  /*
1342  * Temporarily suspend the user from the bridge so we have
1343  * control to start MOH if needed.
1344  */
1345  in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
1346  ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
1347  if (in_bridge) {
1348  ast_bridge_unsuspend(user->conference->bridge, user->chan);
1349  }
1350 
1352  }
1353 }
struct ast_channel * chan
Definition: confbridge.h:276
unsigned int playing_moh
Definition: confbridge.h:282
struct confbridge_conference * conference
Definition: confbridge.h:271
int ast_bridge_unsuspend(struct ast_bridge *bridge, struct ast_channel *chan)
Unsuspend a channel from a bridge.
Definition: bridge.c:3089
unsigned int suspended_moh
Definition: confbridge.h:279
#define NULL
Definition: resample.c:96
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
Definition: channel.c:7765
#define ast_bridge_unlock(bridge)
Unlock the bridge.
Definition: bridge.h:493
#define ast_bridge_lock(bridge)
Lock the bridge.
Definition: bridge.h:480
int ast_bridge_suspend(struct ast_bridge *bridge, struct ast_channel *chan)
Suspend a channel temporarily from a bridge.
Definition: bridge.c:3068
struct user_profile u_profile
Definition: confbridge.h:273
char moh_class[128]
Definition: confbridge.h:154
struct ast_bridge * bridge
Definition: confbridge.h:246

◆ conf_moh_stop()

void conf_moh_stop ( struct confbridge_user user)

Stop MOH for the conference user.

Parameters
userConference user to stop MOH on.
Returns
Nothing

Definition at line 1301 of file app_confbridge.c.

References ast_bridge_lock, ast_bridge_suspend(), ast_bridge_unlock, ast_bridge_unsuspend(), ast_moh_stop(), confbridge_conference::bridge, confbridge_user::chan, confbridge_user::conference, confbridge_user::playing_moh, and confbridge_user::suspended_moh.

Referenced by conf_default_leave_waitmarked(), conf_handle_second_active(), leave_marked(), leave_unmarked(), and transition_to_marked().

1302 {
1303  user->playing_moh = 0;
1304  if (!user->suspended_moh) {
1305  int in_bridge;
1306 
1307  /*
1308  * Locking the ast_bridge here is the only way to hold off the
1309  * call to ast_bridge_join() in confbridge_exec() from
1310  * interfering with the bridge and MOH operations here.
1311  */
1313 
1314  /*
1315  * Temporarily suspend the user from the bridge so we have
1316  * control to stop MOH if needed.
1317  */
1318  in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
1319  ast_moh_stop(user->chan);
1320  if (in_bridge) {
1321  ast_bridge_unsuspend(user->conference->bridge, user->chan);
1322  }
1323 
1325  }
1326 }
struct ast_channel * chan
Definition: confbridge.h:276
unsigned int playing_moh
Definition: confbridge.h:282
struct confbridge_conference * conference
Definition: confbridge.h:271
int ast_bridge_unsuspend(struct ast_bridge *bridge, struct ast_channel *chan)
Unsuspend a channel from a bridge.
Definition: bridge.c:3089
unsigned int suspended_moh
Definition: confbridge.h:279
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
Definition: channel.c:7775
#define ast_bridge_unlock(bridge)
Unlock the bridge.
Definition: bridge.h:493
#define ast_bridge_lock(bridge)
Lock the bridge.
Definition: bridge.h:480
int ast_bridge_suspend(struct ast_bridge *bridge, struct ast_channel *chan)
Suspend a channel temporarily from a bridge.
Definition: bridge.c:3068
struct ast_bridge * bridge
Definition: confbridge.h:246

◆ conf_mute_only_active()

void conf_mute_only_active ( struct confbridge_conference conference)

Attempt to mute/play MOH to the only user in the conference if they require it.

Parameters
conferenceA conference bridge containing a single user

Definition at line 4255 of file app_confbridge.c.

References confbridge_conference::active_list, AST_LIST_FIRST, ast_test_flag, conf_moh_start(), conf_update_user_mute(), confbridge_user::u_profile, and USER_OPT_MUSICONHOLD.

Referenced by transition_to_single(), and transition_to_single_marked().

4256 {
4257  struct confbridge_user *only_user = AST_LIST_FIRST(&conference->active_list);
4258 
4259  /* Turn on MOH if the single participant is set up for it */
4260  if (ast_test_flag(&only_user->u_profile, USER_OPT_MUSICONHOLD)) {
4261  conf_moh_start(only_user);
4262  }
4263  conf_update_user_mute(only_user);
4264 }
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
Definition: linkedlists.h:420
#define ast_test_flag(p, flag)
Definition: utils.h:63
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
void conf_moh_start(struct confbridge_user *user)
Start MOH for the conference user.
struct confbridge_conference::@87 active_list
The structure that represents a conference bridge user.
Definition: confbridge.h:270
struct user_profile u_profile
Definition: confbridge.h:273

◆ conf_record_get_tech()

struct ast_channel_tech* conf_record_get_tech ( void  )

Get ConfBridge record channel technology struct.

Since
12.0.0
Returns
ConfBridge record channel technology.

Definition at line 102 of file conf_chan_record.c.

References record_tech.

Referenced by load_module(), rec_request(), and unload_module().

103 {
104  return &record_tech;
105 }
static struct ast_channel_tech record_tech

◆ conf_reload_config()

int conf_reload_config ( void  )

reload confbridge.conf file

Definition at line 2465 of file conf_config_parser.c.

References aco_process_config(), and ACO_PROCESS_ERROR.

Referenced by reload().

2466 {
2467  if (aco_process_config(&cfg_info, 1) == ACO_PROCESS_ERROR) {
2468  /* On a reload, just keep the config we already have in place. */
2469  return -1;
2470  }
2471  return 0;
2472 }
enum aco_process_status aco_process_config(struct aco_info *info, int reload)
Process a config info via the options registered with an aco_info.
Their was an error and no changes were applied.

◆ conf_remove_user_active()

void conf_remove_user_active ( struct confbridge_conference conference,
struct confbridge_user user 
)

Remove a conference bridge user from the unmarked active conference users in the conference.

Parameters
conferenceThe conference bridge to remove the user from
userThe conference bridge user to remove from the conference

Definition at line 4242 of file app_confbridge.c.

References confbridge_conference::active_list, confbridge_conference::activeusers, AST_LIST_REMOVE, and confbridge_user::list.

Referenced by leave_active(), and leave_unmarked().

4243 {
4244  AST_LIST_REMOVE(&conference->active_list, user, list);
4245  conference->activeusers--;
4246 }
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
Definition: linkedlists.h:855
struct confbridge_conference::@87 active_list
unsigned int activeusers
Definition: confbridge.h:248
struct confbridge_user::@91 list

◆ conf_remove_user_marked()

void conf_remove_user_marked ( struct confbridge_conference conference,
struct confbridge_user user 
)

Remove a conference bridge user from the marked active conference users in the conference.

Parameters
conferenceThe conference bridge to remove the user from
userThe conference bridge user to remove from the conference

Definition at line 4248 of file app_confbridge.c.

References confbridge_conference::active_list, confbridge_conference::activeusers, AST_LIST_REMOVE, confbridge_user::list, and confbridge_conference::markedusers.

Referenced by leave_marked().

4249 {
4250  AST_LIST_REMOVE(&conference->active_list, user, list);
4251  conference->activeusers--;
4252  conference->markedusers--;
4253 }
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
Definition: linkedlists.h:855
unsigned int markedusers
Definition: confbridge.h:249
struct confbridge_conference::@87 active_list
unsigned int activeusers
Definition: confbridge.h:248
struct confbridge_user::@91 list

◆ conf_remove_user_waiting()

void conf_remove_user_waiting ( struct confbridge_conference conference,
struct confbridge_user user 
)

Remove a conference bridge user from the waiting conference users in the conference.

Parameters
conferenceThe conference bridge to remove the user from
userThe conference bridge user to remove from the conference

Definition at line 4266 of file app_confbridge.c.

References AST_LIST_REMOVE, confbridge_user::list, confbridge_conference::waiting_list, and confbridge_conference::waitingusers.

Referenced by conf_default_leave_waitmarked().

4267 {
4268  AST_LIST_REMOVE(&conference->waiting_list, user, list);
4269  conference->waitingusers--;
4270 }
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
Definition: linkedlists.h:855
unsigned int waitingusers
Definition: confbridge.h:250
struct confbridge_conference::@88 waiting_list
struct confbridge_user::@91 list

◆ 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&#39;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)

◆ conf_set_menu_to_user()

int conf_set_menu_to_user ( struct ast_channel chan,
struct confbridge_user user,
const char *  menu_profile_name 
)

find a menu profile given a menu profile's name and apply the menu in DTMF hooks.

Parameters
chanchannel the menu profile is requested for
useruser profile the menu is being applied to
menu_profile_namename of the profile requested (optional)

If menu_profile_name is not provided, this function will check for the presence of a menu profile set by the CONFBRIDGE function on a channel datastore. If that doesn't exist, the default_menu profile is used.

Return values
0on success
-1on failure

Definition at line 2649 of file conf_config_parser.c.

References ao2_bump, ao2_cleanup, ao2_find, ao2_global_obj_ref, apply_menu_to_user(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_strlen_zero, cfg_handle, ast_datastore::data, DEFAULT_MENU_PROFILE, func_confbridge_data::m_usable, func_confbridge_data::menu, NULL, OBJ_KEY, and RAII_VAR.

Referenced by confbridge_exec().

2650 {
2652  RAII_VAR(struct conf_menu *, menu, NULL, ao2_cleanup);
2653 
2654  if (chan && ast_strlen_zero(menu_profile_name)) {
2655  struct ast_datastore *datastore;
2656  struct func_confbridge_data *b_data;
2657 
2658  ast_channel_lock(chan);
2660  ast_channel_unlock(chan);
2661  if (datastore) {
2662  /* If a menu exists in the CONFBRIDGE function datastore, use it. */
2663  b_data = datastore->data;
2664  if (b_data->m_usable) {
2665  menu = ao2_bump(b_data->menu);
2666  return apply_menu_to_user(user, menu);
2667  }
2668  }
2669  }
2670 
2671  /* Otherwise, we need to get whatever menu profile is specified to use (or default). */
2672  if (!cfg) {
2673  return -1;
2674  }
2675 
2676  if (ast_strlen_zero(menu_profile_name)) {
2677  menu_profile_name = DEFAULT_MENU_PROFILE;
2678  }
2679 
2680  if (!(menu = ao2_find(cfg->menus, menu_profile_name, OBJ_KEY))) {
2681  return -1;
2682  }
2683 
2684  return apply_menu_to_user(user, menu);
2685 }
#define ast_channel_lock(chan)
Definition: channel.h:2902
struct conf_menu * menu
#define OBJ_KEY
Definition: astobj2.h:1155
static int apply_menu_to_user(struct confbridge_user *user, struct conf_menu *menu)
#define ao2_global_obj_ref(holder)
Definition: astobj2.h:925
Structure for a data store object.
Definition: datastore.h:68
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition: channel.c:2390
#define NULL
Definition: resample.c:96
#define ao2_bump(obj)
Definition: astobj2.h:491
#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:911
static const struct ast_datastore_info confbridge_datastore
#define ast_strlen_zero(a)
Definition: muted.c:73
#define ast_channel_unlock(chan)
Definition: channel.h:2903
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
static corosync_cfg_handle_t cfg_handle
Definition: res_corosync.c:284
void * data
Definition: datastore.h:70
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
#define DEFAULT_MENU_PROFILE
Definition: confbridge.h:43

◆ conf_update_user_mute()

void conf_update_user_mute ( struct confbridge_user user)

Update the actual mute status of the user and set it on the bridge.

Parameters
userUser to update the mute status.
Returns
Nothing

Definition at line 1243 of file app_confbridge.c.

References ast_channel_name(), ast_debug, ast_test_flag, ast_test_suite_event_notify, confbridge_conference::b_profile, confbridge_user::chan, confbridge_user::conference, confbridge_user::features, confbridge_conference::markedusers, ast_bridge_features::mute, confbridge_user::muted, bridge_profile::name, confbridge_user::playing_moh, confbridge_user::u_profile, and USER_OPT_WAITMARKED.

Referenced by action_toggle_mute_participants(), conf_handle_second_active(), conf_mute_moh_inactive_waitmarked(), conf_mute_only_active(), generic_mute_unmute_user(), join_active(), join_marked(), join_unmarked(), leave_marked(), and transition_to_marked().

1244 {
1245  int mute_user;
1246  int mute_system;
1247  int mute_effective;
1248 
1249  /* User level mute request. */
1250  mute_user = user->muted;
1251 
1252  /* System level mute request. */
1253  mute_system = user->playing_moh
1254  /*
1255  * Do not allow waitmarked users to talk to anyone unless there
1256  * is a marked user present.
1257  */
1258  || (!user->conference->markedusers
1260 
1261  mute_effective = mute_user || mute_system;
1262 
1263  ast_debug(1, "User %s is %s: user:%d system:%d.\n",
1264  ast_channel_name(user->chan), mute_effective ? "muted" : "unmuted",
1265  mute_user, mute_system);
1266  user->features.mute = mute_effective;
1267  ast_test_suite_event_notify("CONF_MUTE_UPDATE",
1268  "Mode: %s\r\n"
1269  "Conference: %s\r\n"
1270  "Channel: %s",
1271  mute_effective ? "muted" : "unmuted",
1272  user->conference->b_profile.name,
1273  ast_channel_name(user->chan));
1274 }
struct ast_channel * chan
Definition: confbridge.h:276
unsigned int playing_moh
Definition: confbridge.h:282
struct confbridge_conference * conference
Definition: confbridge.h:271
#define ast_test_flag(p, flag)
Definition: utils.h:63
char name[MAX_PROFILE_NAME]
Definition: confbridge.h:225
unsigned int markedusers
Definition: confbridge.h:249
struct bridge_profile b_profile
Definition: confbridge.h:247
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:444
#define ast_test_suite_event_notify(s, f,...)
Definition: test.h:196
unsigned int muted
Definition: confbridge.h:280
struct ast_bridge_features features
Definition: confbridge.h:277
const char * ast_channel_name(const struct ast_channel *chan)
struct user_profile u_profile
Definition: confbridge.h:273

◆ confbridge_end_type()

struct stasis_message_type* confbridge_end_type ( void  )

get the confbridge end stasis message type

Since
12.0
Return values
stasismessage type for confbridge end messages if it's available
NULLif it isn't

Referenced by confbridge_event_type_to_string(), manager_confbridge_init(), manager_confbridge_shutdown(), and send_conf_end_event().

◆ 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_handle_atxfer()

void confbridge_handle_atxfer ( struct ast_attended_transfer_message msg)

Create join/leave events for attended transfers.

Since
13.28
16.5
Parameters
msgThe attended transfer stasis message

Definition at line 1530 of file app_confbridge.c.

References confbridge_conference::active_list, ao2_find, ao2_lock, ast_channel_snapshot_dialplan::appl, ast_channel_name(), ast_debug, ast_json_pack(), ast_json_unref(), AST_LIST_TRAVERSE, ast_log, ast_strdupa, ast_strlen_zero, ast_test_flag, ast_channel_snapshot::base, confbridge_user::chan, ast_bridge_channel_snapshot_pair::channel_snapshot, confbridge_join_type(), confbridge_leave_type(), confbridge_unlock_and_unref(), hangup_data::conference, ast_channel_snapshot_dialplan::data, ast_channel_snapshot::dialplan, LOG_ERROR, confbridge_user::muted, ast_channel_snapshot_base::name, NULL, OBJ_SEARCH_KEY, RAII_VAR, send_conf_stasis_snapshots(), ast_attended_transfer_message::target, ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, ast_attended_transfer_message::transferee, confbridge_user::u_profile, USER_OPT_ADMIN, confbridge_conference::waiting_list, and confbridge_conference::waitingusers.

Referenced by confbridge_atxfer_cb().

1531 {
1532  struct ast_channel_snapshot *old_snapshot;
1533  struct ast_channel_snapshot *new_snapshot;
1534  char *confbr_name = NULL;
1535  char *comma;
1537  struct confbridge_user *user = NULL;
1538  int found_user = 0;
1539  struct ast_json *json_object;
1540 
1542  && strcmp(msg->to_transferee.channel_snapshot->dialplan->appl, "ConfBridge") == 0
1543  && msg->target) {
1544  /* We're transferring a bridge to an extension */
1545  old_snapshot = msg->to_transferee.channel_snapshot;
1546  new_snapshot = msg->target;
1547  } else if (msg->to_transfer_target.channel_snapshot
1548  && strcmp(msg->to_transfer_target.channel_snapshot->dialplan->appl, "ConfBridge") == 0
1549  && msg->transferee) {
1550  /* We're transferring a call to a bridge */
1551  old_snapshot = msg->to_transfer_target.channel_snapshot;
1552  new_snapshot = msg->transferee;
1553  } else {
1554  ast_log(LOG_ERROR, "Could not determine proper channels\n");
1555  return;
1556  }
1557 
1558  /*
1559  * old_snapshot->data should have the original parameters passed to
1560  * the ConfBridge app:
1561  * conference[,bridge_profile[,user_profile[,menu]]]
1562  * We'll use "conference" to look up the bridge.
1563  *
1564  * We _could_ use old_snapshot->bridgeid to get the bridge but
1565  * that would involve locking the conference_bridges container
1566  * and iterating over it looking for a matching bridge.
1567  */
1568  if (ast_strlen_zero(old_snapshot->dialplan->data)) {
1569  ast_log(LOG_ERROR, "Channel '%s' didn't have app data set\n", old_snapshot->base->name);
1570  return;
1571  }
1572  confbr_name = ast_strdupa(old_snapshot->dialplan->data);
1573  comma = strchr(confbr_name, ',');
1574  if (comma) {
1575  *comma = '\0';
1576  }
1577 
1578  ast_debug(1, "Confbr: %s Leaving: %s Joining: %s\n", confbr_name, old_snapshot->base->name, new_snapshot->base->name);
1579 
1580  conference = ao2_find(conference_bridges, confbr_name, OBJ_SEARCH_KEY);
1581  if (!conference) {
1582  ast_log(LOG_ERROR, "Conference bridge '%s' not found\n", confbr_name);
1583  return;
1584  }
1585  ao2_lock(conference);
1586 
1587  /*
1588  * We need to grab the user profile for the departing user in order to
1589  * properly format the join/leave messages.
1590  */
1591  AST_LIST_TRAVERSE(&conference->active_list, user, list) {
1592  if (strcasecmp(ast_channel_name(user->chan), old_snapshot->base->name) == 0) {
1593  found_user = 1;
1594  break;
1595  }
1596  }
1597 
1598  /*
1599  * If we didn't find the user in the active list, try the waiting list.
1600  */
1601  if (!found_user && conference->waitingusers) {
1602  AST_LIST_TRAVERSE(&conference->waiting_list, user, list) {
1603  if (strcasecmp(ast_channel_name(user->chan), old_snapshot->base->name) == 0) {
1604  found_user = 1;
1605  break;
1606  }
1607  }
1608  }
1609 
1610  if (!found_user) {
1611  ast_log(LOG_ERROR, "Unable to find user profile for channel '%s' in bridge '%s'\n",
1612  old_snapshot->base->name, confbr_name);
1613  return;
1614  }
1615 
1616  /*
1617  * We're going to use the existing user profile to create the messages.
1618  */
1619  json_object = ast_json_pack("{s: b}",
1620  "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN)
1621  );
1622  if (!json_object) {
1623  return;
1624  }
1625 
1626  send_conf_stasis_snapshots(conference, old_snapshot, confbridge_leave_type(), json_object);
1627  ast_json_unref(json_object);
1628 
1629  json_object = ast_json_pack("{s: b, s: b}",
1630  "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN),
1631  "muted", user->muted);
1632  if (!json_object) {
1633  return;
1634  }
1635  send_conf_stasis_snapshots(conference, new_snapshot, confbridge_join_type(), json_object);
1636  ast_json_unref(json_object);
1637 }
const ast_string_field data
struct ast_channel_snapshot_base * base
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.
Definition: json.c:591
struct ast_channel * chan
Definition: confbridge.h:276
The arg parameter is a search key, but is not an object.
Definition: astobj2.h:1105
#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
Structure representing a snapshot of channel state.
struct ast_channel_snapshot * target
#define NULL
Definition: resample.c:96
struct ast_channel_snapshot_dialplan * dialplan
struct ast_bridge_channel_snapshot_pair to_transferee
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave stasis message type
struct ast_bridge_channel_snapshot_pair to_transfer_target
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:444
#define ast_log
Definition: astobj2.c:42
const ast_string_field appl
#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:911
struct ast_channel_snapshot * transferee
#define ao2_lock(a)
Definition: astobj2.h:718
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
struct ao2_container * conference_bridges
Container to hold all conference bridges in progress.
struct ast_channel_snapshot * channel_snapshot
#define LOG_ERROR
Definition: logger.h:285
static void confbridge_unlock_and_unref(void *obj)
unsigned int muted
Definition: confbridge.h:280
static void send_conf_stasis_snapshots(struct confbridge_conference *conference, struct ast_channel_snapshot *chan_snapshot, struct stasis_message_type *type, struct ast_json *extras)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:490
#define ast_strlen_zero(a)
Definition: muted.c:73
The structure that represents a conference bridge.
Definition: confbridge.h:243
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
structure to hold users read from users.conf
const char * ast_channel_name(const struct ast_channel *chan)
Abstract JSON element (object, array, string, int, ...).
The structure that represents a conference bridge user.
Definition: confbridge.h:270
struct user_profile u_profile
Definition: confbridge.h:273
const ast_string_field name

◆ confbridge_join_type()

struct stasis_message_type* confbridge_join_type ( void  )

get the confbridge join stasis message type

Since
12.0
Return values
stasismessage type for confbridge join messages if it's available
NULLif it isn't

Referenced by conf_send_event_to_participants(), confbridge_event_type_to_string(), confbridge_handle_atxfer(), manager_confbridge_init(), manager_confbridge_shutdown(), and send_join_event().

◆ confbridge_leave_type()

struct stasis_message_type* confbridge_leave_type ( void  )

get the confbridge leave stasis message type

Since
12.0
Return values
stasismessage type for confbridge leave messages if it's available
NULLif it isn't

Referenced by confbridge_event_type_to_string(), confbridge_handle_atxfer(), manager_confbridge_init(), manager_confbridge_shutdown(), send_leave_event(), and send_message().

◆ confbridge_mute_type()

struct stasis_message_type* confbridge_mute_type ( void  )

get the confbridge mute stasis message type

Since
12.0
Return values
stasismessage type for confbridge mute messages if it's available
NULLif it isn't

Referenced by confbridge_event_type_to_string(), manager_confbridge_init(), manager_confbridge_shutdown(), and send_mute_event().

◆ confbridge_start_record_type()

struct stasis_message_type* confbridge_start_record_type ( void  )

get the confbridge start_record stasis message type

Since
12.0
Return values
stasismessage type for confbridge start_record messages if it's available
NULLif it isn't

Referenced by confbridge_event_type_to_string(), manager_confbridge_init(), manager_confbridge_shutdown(), and send_start_record_event().

◆ confbridge_start_type()

struct stasis_message_type* confbridge_start_type ( void  )

get the confbridge start stasis message type

Since
12.0
Return values
stasismessage type for confbridge start messages if it's available
NULLif it isn't

Referenced by confbridge_event_type_to_string(), manager_confbridge_init(), manager_confbridge_shutdown(), and send_conf_start_event().

◆ confbridge_stop_record_type()

struct stasis_message_type* confbridge_stop_record_type ( void  )

get the confbridge stop_record stasis message type

Since
12.0
Return values
stasismessage type for confbridge stop_record messages if it's available
NULLif it isn't

Referenced by confbridge_event_type_to_string(), manager_confbridge_init(), manager_confbridge_shutdown(), and send_stop_record_event().

◆ confbridge_talking_type()

struct stasis_message_type* confbridge_talking_type ( void  )

get the confbridge talking stasis message type

Since
12.0
Return values
stasismessage type for confbridge talking messages if it's available
NULLif it isn't

Referenced by conf_handle_talker_cb(), confbridge_event_type_to_string(), manager_confbridge_init(), and manager_confbridge_shutdown().

◆ confbridge_unmute_type()

struct stasis_message_type* confbridge_unmute_type ( void  )

get the confbridge unmute stasis message type

Since
12.0
Return values
stasismessage type for confbridge unmute messages if it's available
NULLif it isn't

Referenced by confbridge_event_type_to_string(), manager_confbridge_init(), manager_confbridge_shutdown(), and send_unmute_event().

◆ confbridge_welcome_type()

struct stasis_message_type* confbridge_welcome_type ( void  )

get the confbridge welcome stasis message type

Since
15.5
Return values
stasismessage type for confbridge welcome messages if it's available
NULLif it isn't

Referenced by conf_send_event_to_participants(), confbridge_event_type_to_string(), manager_confbridge_init(), and manager_confbridge_shutdown().

◆ func_confbridge_helper()

int func_confbridge_helper ( struct ast_channel chan,
const char *  cmd,
char *  data,
const char *  value 
)

Definition at line 1112 of file conf_config_parser.c.

References aco_process_var(), ao2_cleanup, args, AST_APP_ARG, ast_calloc, ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc, ast_datastore_free(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, func_confbridge_data::b_profile, func_confbridge_data::b_usable, bridge_profile_sounds_alloc(), conf_bridge_profile_destroy(), ast_datastore::data, DEFAULT_BRIDGE_PROFILE, DEFAULT_MENU_PROFILE, DEFAULT_USER_PROFILE, ast_variable::file, LOG_WARNING, func_confbridge_data::m_usable, func_confbridge_data::menu, menu_alloc(), ast_variable::name, NULL, parse(), bridge_profile::sounds, type, func_confbridge_data::u_profile, func_confbridge_data::u_usable, user_profile_destructor(), value, and ast_variable::value.

1113 {
1114  struct ast_datastore *datastore;
1115  struct func_confbridge_data *b_data;
1116  char *parse;
1117  struct ast_variable tmpvar = { 0, };
1118  struct ast_variable template = {
1119  .name = "template",
1120  .file = "CONFBRIDGE"
1121  };
1123  AST_APP_ARG(type);
1124  AST_APP_ARG(option);
1125  );
1126 
1127  if (!chan) {
1128  ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
1129  return -1;
1130  }
1131 
1132  /* parse all the required arguments and make sure they exist. */
1133  if (ast_strlen_zero(data)) {
1134  return -1;
1135  }
1136  parse = ast_strdupa(data);
1137  AST_STANDARD_APP_ARGS(args, parse);
1138  if (ast_strlen_zero(args.type) || ast_strlen_zero(args.option)) {
1139  return -1;
1140  }
1141 
1142  ast_channel_lock(chan);
1144  if (!datastore) {
1146  if (!datastore) {
1147  ast_channel_unlock(chan);
1148  return 0;
1149  }
1150  b_data = ast_calloc(1, sizeof(*b_data));
1151  if (!b_data) {
1152  ast_channel_unlock(chan);
1153  ast_datastore_free(datastore);
1154  return 0;
1155  }
1156  datastore->data = b_data;
1158  if (!b_data->b_profile.sounds) {
1159  ast_channel_unlock(chan);
1160  ast_datastore_free(datastore);
1161  return 0;
1162  }
1163  if (!(b_data->menu = menu_alloc("dialplan"))) {
1164  ast_channel_unlock(chan);
1165  ast_datastore_free(datastore);
1166  return 0;
1167  }
1168  ast_channel_datastore_add(chan, datastore);
1169  } else {
1170  b_data = datastore->data;
1171  }
1172  ast_channel_unlock(chan);
1173 
1174  /* SET(CONFBRIDGE(type,option)=value) */
1175  if (!value) {
1176  value = "";
1177  }
1178  tmpvar.name = args.option;
1179  tmpvar.value = value;
1180  tmpvar.file = "CONFBRIDGE";
1181  if (!strcasecmp(args.type, "bridge")) {
1182  if (!strcasecmp(args.option, "clear")) {
1183  b_data->b_usable = 0;
1185  memset(&b_data->b_profile, 0, sizeof(b_data->b_profile)) ;
1186  if (!(b_data->b_profile.sounds = bridge_profile_sounds_alloc())) {
1187  /* If this reallocation fails, the datastore has become unusable and must be destroyed. */
1188  ast_channel_lock(chan);
1189  ast_channel_datastore_remove(chan, datastore);
1190  ast_channel_unlock(chan);
1191  ast_datastore_free(datastore);
1192  }
1193  return 0;
1194  }
1195 
1196  if (b_data && !b_data->b_usable && strcasecmp(args.option, "template")) {
1197  template.value = DEFAULT_BRIDGE_PROFILE;
1198  aco_process_var(&bridge_type, "dialplan", &template, &b_data->b_profile);
1199  }
1200 
1201  if (!aco_process_var(&bridge_type, "dialplan", &tmpvar, &b_data->b_profile)) {
1202  b_data->b_usable = 1;
1203  return 0;
1204  }
1205  } else if (!strcasecmp(args.type, "user")) {
1206  if (!strcasecmp(args.option, "clear")) {
1207  b_data->u_usable = 0;
1209  memset(&b_data->u_profile, 0, sizeof(b_data->u_profile));
1210  return 0;
1211  }
1212 
1213  if (b_data && !b_data->u_usable && strcasecmp(args.option, "template")) {
1214  template.value = DEFAULT_USER_PROFILE;
1215  aco_process_var(&user_type, "dialplan", &template, &b_data->u_profile);
1216  }
1217 
1218  if (!aco_process_var(&user_type, "dialplan", &tmpvar, &b_data->u_profile)) {
1219  b_data->u_usable = 1;
1220  return 0;
1221  }
1222  } else if (!strcasecmp(args.type, "menu")) {
1223  if (!strcasecmp(args.option, "clear")) {
1224  b_data->m_usable = 0;
1225  ao2_cleanup(b_data->menu);
1226  if (!(b_data->menu = menu_alloc("dialplan"))) {
1227  /* If this reallocation fails, the datastore has become unusable and must be destroyed */
1228  ast_channel_lock(chan);
1229  ast_channel_datastore_remove(chan, datastore);
1230  ast_channel_unlock(chan);
1231  ast_datastore_free(datastore);
1232  }
1233  return 0;
1234  }
1235 
1236  if (b_data && !b_data->m_usable && strcasecmp(args.option, "template")) {
1237  template.value = DEFAULT_MENU_PROFILE;
1238  aco_process_var(&menu_type, "dialplan", &template, &b_data->menu);
1239  }
1240 
1241  if (!aco_process_var(&menu_type, "dialplan", &tmpvar, b_data->menu)) {
1242  b_data->m_usable = 1;
1243  return 0;
1244  }
1245  }
1246 
1247  ast_log(LOG_WARNING, "%s(%s,%s) cannot be set to '%s'. Invalid type, option, or value.\n",
1248  cmd, args.type, args.option, value);
1249  return -1;
1250 }
static const char type[]
Definition: chan_ooh323.c:109
#define ast_channel_lock(chan)
Definition: channel.h:2902
struct conf_menu * menu
struct user_profile u_profile
static struct aco_type user_type
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the &#39;standard&#39; argument separation process for an application.
#define LOG_WARNING
Definition: logger.h:274
Structure for variables, used for configurations and for channel variables.
struct bridge_profile_sounds * sounds
Definition: confbridge.h:235
struct bridge_profile b_profile
Structure for a data store object.
Definition: datastore.h:68
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition: channel.c:2390
const char * args
static struct aco_type bridge_type
#define NULL
Definition: resample.c:96
int value
Definition: syslog.c:37
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
Definition: datastore.c:68
#define ast_log
Definition: astobj2.c:42
static struct aco_type menu_type
void conf_bridge_profile_destroy(struct bridge_profile *b_profile)
Destroy a bridge profile found by &#39;conf_find_bridge_profile&#39;.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
static const struct ast_datastore_info confbridge_datastore
#define ast_strlen_zero(a)
Definition: muted.c:73
static void * menu_alloc(const char *category)
#define ast_channel_unlock(chan)
Definition: channel.h:2903
static void parse(struct mgcp_request *req)
Definition: chan_mgcp.c:1872
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:204
void * data
Definition: datastore.h:70
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
#define DEFAULT_MENU_PROFILE
Definition: confbridge.h:43
#define DEFAULT_BRIDGE_PROFILE
Definition: confbridge.h:42
#define ast_datastore_alloc(info, uid)
Definition: datastore.h:89
#define DEFAULT_USER_PROFILE
Definition: confbridge.h:41
int aco_process_var(struct aco_type *type, const char *cat, struct ast_variable *var, void *obj)
Parse a single ast_variable and apply it to an object.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
Definition: channel.c:2376
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application&#39;s arguments.
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
Definition: channel.c:2385
static void user_profile_destructor(void *obj)
static struct bridge_profile_sounds * bridge_profile_sounds_alloc(void)
#define AST_APP_ARG(name)
Define an application argument.

◆ 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

◆ play_sound_file()

int play_sound_file ( struct confbridge_conference conference,
const char *  filename 
)

Play sound file into conference bridge.

Parameters
conferenceThe conference bridge to play sound file into
filenameSound file to play
Return values
0success
-1failure

Definition at line 2003 of file app_confbridge.c.

References play_sound_helper().

Referenced by action_toggle_mute_participants(), announce_user_count(), confbridge_exec(), and post_join_play_begin().

2004 {
2005  return play_sound_helper(conference, filename, -1);
2006 }
static int play_sound_helper(struct confbridge_conference *conference, const char *filename, int say_number)

Variable Documentation

◆ conference_bridges

struct ao2_container* conference_bridges

Container to hold all conference bridges in progress.

Definition at line 437 of file app_confbridge.c.

Referenced by announce_request().