Asterisk - The Open Source Telephony Project GIT-master-8924258
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"
Include dependency graph for confbridge.h:
This graph shows which files directly or indirectly include this file:

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) ,
  USER_OPT_ANSWER_CHANNEL = (1 << 20) , USER_OPT_HEAR_OWN_JOIN_SOUND = (1 << 21) , USER_OPT_ENDMARKEDANY = (1 << 22)
}
 

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"

Definition at line 42 of file confbridge.h.

◆ DEFAULT_MENU_PROFILE

#define DEFAULT_MENU_PROFILE   "default_menu"

Definition at line 43 of file confbridge.h.

◆ 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.

◆ 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.

◆ DEFAULT_USER_PROFILE

#define DEFAULT_USER_PROFILE   "default_user"

Definition at line 41 of file confbridge.h.

◆ 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.

◆ 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 77 of file confbridge.h.

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

◆ 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 96 of file confbridge.h.

96 {
116};
@ MENU_ACTION_RELEASE_SINGLE_VIDEO_SRC
Definition: confbridge.h:112
@ MENU_ACTION_SET_SINGLE_VIDEO_SRC
Definition: confbridge.h:111
@ MENU_ACTION_ADMIN_KICK_LAST
Definition: confbridge.h:108
@ MENU_ACTION_TOGGLE_BINAURAL
Definition: confbridge.h:115
@ MENU_ACTION_PLAYBACK
Definition: confbridge.h:98
@ MENU_ACTION_LEAVE
Definition: confbridge.h:109
@ MENU_ACTION_RESET_LISTENING
Definition: confbridge.h:102
@ MENU_ACTION_INCREASE_TALKING
Definition: confbridge.h:104
@ MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS
Definition: confbridge.h:114
@ MENU_ACTION_INCREASE_LISTENING
Definition: confbridge.h:100
@ MENU_ACTION_DIALPLAN_EXEC
Definition: confbridge.h:106
@ MENU_ACTION_DECREASE_LISTENING
Definition: confbridge.h:101
@ MENU_ACTION_PLAYBACK_AND_CONTINUE
Definition: confbridge.h:99
@ MENU_ACTION_ADMIN_TOGGLE_LOCK
Definition: confbridge.h:107
@ MENU_ACTION_DECREASE_TALKING
Definition: confbridge.h:105
@ MENU_ACTION_PARTICIPANT_COUNT
Definition: confbridge.h:113
@ MENU_ACTION_TOGGLE_MUTE
Definition: confbridge.h:97
@ MENU_ACTION_NOOP
Definition: confbridge.h:110
@ MENU_ACTION_RESET_TALKING
Definition: confbridge.h:103

◆ 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 169 of file confbridge.h.

169 {
195};
@ CONF_SOUND_JOIN
Definition: confbridge.h:188
@ CONF_SOUND_OTHER_IN_PARTY
Definition: confbridge.h:177
@ CONF_SOUND_INVALID_PIN
Definition: confbridge.h:182
@ CONF_SOUND_LOCKED_NOW
Definition: confbridge.h:185
@ CONF_SOUND_THERE_ARE
Definition: confbridge.h:176
@ CONF_SOUND_ONLY_ONE
Definition: confbridge.h:175
@ CONF_SOUND_GET_PIN
Definition: confbridge.h:181
@ CONF_SOUND_ERROR_MENU
Definition: confbridge.h:187
@ CONF_SOUND_PARTICIPANTS_UNMUTED
Definition: confbridge.h:191
@ CONF_SOUND_BINAURAL_ON
Definition: confbridge.h:193
@ CONF_SOUND_ONLY_PERSON
Definition: confbridge.h:183
@ CONF_SOUND_BEGIN
Definition: confbridge.h:192
@ CONF_SOUND_PARTICIPANTS_MUTED
Definition: confbridge.h:190
@ CONF_SOUND_WAIT_FOR_LEADER
Definition: confbridge.h:179
@ CONF_SOUND_HAS_LEFT
Definition: confbridge.h:171
@ CONF_SOUND_BINAURAL_OFF
Definition: confbridge.h:194
@ CONF_SOUND_LEAVE
Definition: confbridge.h:189
@ CONF_SOUND_LEADER_HAS_LEFT
Definition: confbridge.h:180
@ CONF_SOUND_PLACE_IN_CONF
Definition: confbridge.h:178
@ CONF_SOUND_HAS_JOINED
Definition: confbridge.h:170
@ CONF_SOUND_UNLOCKED_NOW
Definition: confbridge.h:186
@ CONF_SOUND_UNMUTED
Definition: confbridge.h:174
@ CONF_SOUND_MUTED
Definition: confbridge.h:173
@ CONF_SOUND_LOCKED
Definition: confbridge.h:184
@ CONF_SOUND_KICKED
Definition: confbridge.h:172

◆ 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

USER_OPT_ANSWER_CHANNEL 

Sets if the channel should be answered if currently unanswered

USER_OPT_HEAR_OWN_JOIN_SOUND 

Set if the caller should hear the join sound

USER_OPT_ENDMARKEDANY 

Set if the user should be kicked after any marked user exits

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 USER_OPT_ANSWER_CHANNEL = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */
73 USER_OPT_HEAR_OWN_JOIN_SOUND = (1 << 21), /*!< Set if the caller should hear the join sound */
74 USER_OPT_ENDMARKEDANY = (1 << 22), /*!< Set if the user should be kicked after any marked user exits */
75};
@ USER_OPT_ENDMARKED
Definition: confbridge.h:60
@ USER_OPT_WAITMARKED
Definition: confbridge.h:59
@ USER_OPT_ANNOUNCEUSERCOUNTALL
Definition: confbridge.h:66
@ USER_OPT_HEAR_OWN_JOIN_SOUND
Definition: confbridge.h:73
@ USER_OPT_TEXT_MESSAGING
Definition: confbridge.h:71
@ USER_OPT_QUIET
Definition: confbridge.h:57
@ USER_OPT_DENOISE
Definition: confbridge.h:61
@ USER_OPT_MARKEDUSER
Definition: confbridge.h:54
@ USER_OPT_DTMF_PASS
Definition: confbridge.h:65
@ USER_OPT_NOONLYPERSON
Definition: confbridge.h:53
@ USER_OPT_TALKER_DETECT
Definition: confbridge.h:63
@ USER_OPT_MUSICONHOLD
Definition: confbridge.h:56
@ USER_OPT_ANNOUNCEUSERCOUNT
Definition: confbridge.h:58
@ USER_OPT_STARTMUTED
Definition: confbridge.h:55
@ USER_OPT_DROP_SILENCE
Definition: confbridge.h:64
@ USER_OPT_ANSWER_CHANNEL
Definition: confbridge.h:72
@ USER_OPT_SEND_EVENTS
Definition: confbridge.h:69
@ USER_OPT_ENDMARKEDANY
Definition: confbridge.h:74
@ USER_OPT_ADMIN
Definition: confbridge.h:52
@ USER_OPT_JITTERBUFFER
Definition: confbridge.h:67
@ USER_OPT_ECHO_EVENTS
Definition: confbridge.h:70
@ USER_OPT_ANNOUNCE_JOIN_LEAVE
Definition: confbridge.h:62
@ USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW
Definition: confbridge.h:68

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 2418 of file app_confbridge.c.

2420{
2421 return async_play_sound_helper(conference, filename, -1, initiator);
2422}
static int async_play_sound_helper(struct confbridge_conference *conference, const char *filename, int say_number, struct ast_channel *initiator)

References async_play_sound_helper(), async_playback_task_data::conference, async_playback_task_data::filename, and async_playback_task_data::initiator.

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

◆ 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 2424 of file app_confbridge.c.

2425{
2426 struct ast_datastore *async_datastore;
2427 struct async_datastore_data *add;
2428
2429 ast_channel_lock(chan);
2430 async_datastore = ast_channel_datastore_find(chan, &async_datastore_info, NULL);
2431 ast_channel_unlock(chan);
2432 if (!async_datastore) {
2433 return;
2434 }
2435
2436 add = async_datastore->data;
2437
2438 ast_mutex_lock(&add->lock);
2439 add->wait = 0;
2440 ast_cond_signal(&add->cond);
2441 ast_mutex_unlock(&add->lock);
2442}
static struct ast_datastore_info async_datastore_info
Datastore used for timing of async announcement playback.
#define ast_channel_lock(chan)
Definition: channel.h:2970
#define ast_channel_unlock(chan)
Definition: channel.h:2971
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:2428
#define ast_mutex_unlock(a)
Definition: lock.h:194
#define ast_mutex_lock(a)
Definition: lock.h:193
#define ast_cond_signal(cond)
Definition: lock.h:207
#define NULL
Definition: resample.c:96
Structure for a data store object.
Definition: datastore.h:64
void * data
Definition: datastore.h:66

References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_cond_signal, ast_mutex_lock, ast_mutex_unlock, async_datastore_info, 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().

◆ 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 1579 of file app_confbridge.c.

1580{
1581 struct post_join_action *action;
1582 if (!(action = ast_calloc(1, sizeof(*action)))) {
1583 return -1;
1584 }
1585 action->func = func;
1586 AST_LIST_INSERT_TAIL(&user->post_join_list, action, list);
1587 return 0;
1588}
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:202
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
Definition: linkedlists.h:731
int(* func)(struct confbridge_user *user)
Definition: confbridge.h:268
struct post_join_action::@96 list
structure to hold users read from users.conf

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

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

◆ 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 4532 of file app_confbridge.c.

4533{
4534 AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4535 conference->activeusers++;
4536}
unsigned int activeusers
Definition: confbridge.h:251
struct confbridge_conference::@94 active_list

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

Referenced by join_active(), and join_unmarked().

◆ 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 4538 of file app_confbridge.c.

4539{
4540 AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4541 conference->activeusers++;
4542 conference->markedusers++;
4543}
unsigned int markedusers
Definition: confbridge.h:252

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

Referenced by join_marked().

◆ 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 4545 of file app_confbridge.c.

4546{
4547 AST_LIST_INSERT_TAIL(&conference->waiting_list, user, list);
4548 conference->waitingusers++;
4549}
unsigned int waitingusers
Definition: confbridge.h:253
struct confbridge_conference::@95 waiting_list

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

Referenced by conf_default_join_waitmarked().

◆ 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.

145{
146 struct ast_bridge_features *features;
147 struct ast_channel *chan;
148 RAII_VAR(struct announce_pvt *, p, NULL, ao2_cleanup);
149
150 {
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}
ast_mutex_t lock
Definition: app_sla.c:337
#define ao2_cleanup(obj)
Definition: astobj2.h:1934
#define ao2_unlock(a)
Definition: astobj2.h:729
#define ao2_lock(a)
Definition: astobj2.h:717
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
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:1947
@ AST_BRIDGE_IMPART_CHAN_INDEPENDENT
Definition: bridge.h:594
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
Definition: bridge.c:3752
@ AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define AST_UNREAL_CARETAKER_THREAD
Definition: core_unreal.h:107
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
Definition: lock.h:623
Structure that contains features information.
struct ast_flags feature_flags
Main Channel structure associated with a channel.
#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:941
#define ast_set_flag(p, flag)
Definition: utils.h:70

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().

◆ 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.

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

References announce_tech.

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

◆ 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 2749 of file conf_config_parser.c.

2750{
2751 *dst = *src;
2752 if (src->sounds) {
2753 ao2_ref(src->sounds, +1);
2754 }
2755}
struct bridge_profile_sounds * sounds
Definition: confbridge.h:238

References ao2_ref, and bridge_profile::sounds.

Referenced by conf_find_bridge_profile(), and join_conference_bridge().

◆ 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 2757 of file conf_config_parser.c.

2758{
2759 if (b_profile->sounds) {
2760 ao2_ref(b_profile->sounds, -1);
2761 b_profile->sounds = NULL;
2762 }
2763}

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().

◆ conf_destroy_config()

void conf_destroy_config ( void  )

destroy the information loaded from the confbridge.conf file

Definition at line 2920 of file conf_config_parser.c.

2921{
2923 aco_info_destroy(&cfg_info);
2925}
#define ao2_global_obj_release(holder)
Release the ao2 object held in the global holder.
Definition: astobj2.h:859
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
Definition: clicompat.c:30
static struct ast_cli_entry cli_confbridge_parser[]
void aco_info_destroy(struct aco_info *info)
Destroy an initialized aco_info struct.
static corosync_cfg_handle_t cfg_handle
Definition: res_corosync.c:284
#define ARRAY_LEN(a)
Definition: utils.h:666

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

Referenced by conf_load_config(), and unload_module().

◆ 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 1607 of file app_confbridge.c.

1608{
1609 struct pbx_find_info q = { .stacklen = 0 };
1610
1611 /* Called with a reference to conference */
1612 ao2_unlink(conference_bridges, conference);
1613 send_conf_end_event(conference);
1614 if (!ast_strlen_zero(conference->b_profile.regcontext) &&
1616 conference->name, 1, NULL, "", E_MATCH)) {
1618 conference->name, 1, NULL);
1619 }
1620 ao2_lock(conference);
1621 conf_stop_record(conference);
1622 ao2_unlock(conference);
1623}
static int conf_stop_record(struct confbridge_conference *conference)
struct ao2_container * conference_bridges
Container to hold all conference bridges in progress.
static void send_conf_end_event(struct confbridge_conference *conference)
#define ao2_unlink(container, obj)
Remove an object from a container.
Definition: astobj2.h:1578
@ E_MATCH
Definition: extconf.h:217
int ast_context_remove_extension(const char *context, const char *extension, int priority, const char *registrar)
Simply remove extension from context.
Definition: pbx.c:4963
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
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
char regcontext[AST_MAX_CONTEXT]
Definition: confbridge.h:239
char name[MAX_CONF_NAME]
Definition: confbridge.h:247
struct bridge_profile b_profile
Definition: confbridge.h:250
int stacklen
Definition: extconf.h:237

References ao2_lock, ao2_unlink, ao2_unlock, ast_context_remove_extension(), ast_strlen_zero(), confbridge_conference::b_profile, conf_stop_record(), conference_bridges, 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().

◆ 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
conference_nameThe name to search for
Returns
ConfBridge (which must be unreffed) or NULL.

Definition at line 922 of file app_confbridge.c.

923{
924 return ao2_find(conference_bridges, conference_name, OBJ_KEY);
925}
#define OBJ_KEY
Definition: astobj2.h:1151
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1736

References ao2_find, conference_bridges, and OBJ_KEY.

Referenced by confbridge_publish_manager_event().

◆ 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 2765 of file conf_config_parser.c.

2766{
2767 struct bridge_profile *tmp2;
2768 struct ast_datastore *datastore = NULL;
2769 struct func_confbridge_data *b_data = NULL;
2771
2772 if (chan && ast_strlen_zero(bridge_profile_name)) {
2773 ast_channel_lock(chan);
2775 ast_channel_unlock(chan);
2776 if (datastore) {
2777 b_data = datastore->data;
2778 if (b_data->b_usable) {
2780 return result;
2781 }
2782 }
2783 }
2784
2785 if (!cfg) {
2786 return NULL;
2787 }
2788 if (ast_strlen_zero(bridge_profile_name)) {
2789 bridge_profile_name = DEFAULT_BRIDGE_PROFILE;
2790 }
2791 if (!(tmp2 = ao2_find(cfg->bridge_profiles, bridge_profile_name, OBJ_KEY))) {
2792 return NULL;
2793 }
2794 ao2_lock(tmp2);
2796 ao2_unlock(tmp2);
2797 ao2_ref(tmp2, -1);
2798
2799 return result;
2800}
#define ao2_global_obj_ref(holder)
Get a reference to the object stored in the global holder.
Definition: astobj2.h:918
static PGresult * result
Definition: cel_pgsql.c:84
void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src)
copies a bridge profile
static const struct ast_datastore_info confbridge_datastore
#define DEFAULT_BRIDGE_PROFILE
Definition: confbridge.h:42
struct bridge_profile b_profile

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(), confbridge_datastore, 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().

◆ 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 2836 of file conf_config_parser.c.

2837{
2838 struct conf_menu_entry *menu_entry = NULL;
2839
2840 ao2_lock(menu);
2841 AST_LIST_TRAVERSE(&menu->entries, menu_entry, entry) {
2842 if (!strcasecmp(menu_entry->dtmf, dtmf_sequence)) {
2843 copy_menu_entry(result, menu_entry);
2844 ao2_unlock(menu);
2845 return 1;
2846 }
2847 }
2848 ao2_unlock(menu);
2849
2850 return 0;
2851}
static int copy_menu_entry(struct conf_menu_entry *dst, struct conf_menu_entry *src)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
Definition: linkedlists.h:491
Definition: confbridge.h:138
char dtmf[MAXIMUM_DTMF_FEATURE_STRING]
Definition: confbridge.h:140
struct conf_menu_entry::@92 entry
struct conf_menu::@93 entries

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

Referenced by action_playback_and_continue().

◆ 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 2712 of file conf_config_parser.c.

2713{
2714 struct user_profile *tmp2;
2715 struct ast_datastore *datastore = NULL;
2716 struct func_confbridge_data *b_data = NULL;
2718
2719 if (chan && ast_strlen_zero(user_profile_name)) {
2720 ast_channel_lock(chan);
2722 ast_channel_unlock(chan);
2723 if (datastore) {
2724 b_data = datastore->data;
2725 if (b_data->u_usable) {
2727 return result;
2728 }
2729 }
2730 }
2731
2732 if (!cfg) {
2733 return NULL;
2734 }
2735 if (ast_strlen_zero(user_profile_name)) {
2736 user_profile_name = DEFAULT_USER_PROFILE;
2737 }
2738 if (!(tmp2 = ao2_find(cfg->user_profiles, user_profile_name, OBJ_KEY))) {
2739 return NULL;
2740 }
2741 ao2_lock(tmp2);
2743 ao2_unlock(tmp2);
2744 ao2_ref(tmp2, -1);
2745
2746 return result;
2747}
static void conf_user_profile_copy(struct user_profile *dst, struct user_profile *src)
#define DEFAULT_USER_PROFILE
Definition: confbridge.h:41
struct user_profile u_profile

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(), confbridge_datastore, 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().

◆ 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 661 of file app_confbridge.c.

662{
663 switch (sound) {
665 return S_OR(custom_sounds->hasjoin, "conf-hasjoin");
667 return S_OR(custom_sounds->hasleft, "conf-hasleft");
669 return S_OR(custom_sounds->kicked, "conf-kicked");
670 case CONF_SOUND_MUTED:
671 return S_OR(custom_sounds->muted, "conf-muted");
673 return S_OR(custom_sounds->unmuted, "conf-unmuted");
675 return S_OR(custom_sounds->binauralon, "confbridge-binaural-on");
677 return S_OR(custom_sounds->binauraloff, "confbridge-binaural-off");
679 return S_OR(custom_sounds->onlyone, "conf-onlyone");
681 return S_OR(custom_sounds->thereare, "conf-thereare");
683 return S_OR(custom_sounds->otherinparty, "conf-otherinparty");
685 return S_OR(custom_sounds->placeintoconf, "conf-placeintoconf");
687 return S_OR(custom_sounds->waitforleader, "conf-waitforleader");
689 return S_OR(custom_sounds->leaderhasleft, "conf-leaderhasleft");
691 return S_OR(custom_sounds->getpin, "conf-getpin");
693 return S_OR(custom_sounds->invalidpin, "conf-invalidpin");
695 return S_OR(custom_sounds->onlyperson, "conf-onlyperson");
697 return S_OR(custom_sounds->locked, "conf-locked");
699 return S_OR(custom_sounds->lockednow, "conf-lockednow");
701 return S_OR(custom_sounds->unlockednow, "conf-unlockednow");
703 return S_OR(custom_sounds->errormenu, "conf-errormenu");
704 case CONF_SOUND_JOIN:
705 return S_OR(custom_sounds->join, "confbridge-join");
706 case CONF_SOUND_LEAVE:
707 return S_OR(custom_sounds->leave, "confbridge-leave");
709 return S_OR(custom_sounds->participantsmuted, "conf-now-muted");
711 return S_OR(custom_sounds->participantsunmuted, "conf-now-unmuted");
712 case CONF_SOUND_BEGIN:
713 return S_OR(custom_sounds->begin, "confbridge-conf-begin");
714 }
715
716 return "";
717}
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition: strings.h:80
const ast_string_field waitforleader
Definition: confbridge.h:224
const ast_string_field invalidpin
Definition: confbridge.h:224
const ast_string_field placeintoconf
Definition: confbridge.h:224
const ast_string_field onlyone
Definition: confbridge.h:224
const ast_string_field otherinparty
Definition: confbridge.h:224
const ast_string_field unlockednow
Definition: confbridge.h:224
const ast_string_field binauralon
Definition: confbridge.h:224
const ast_string_field getpin
Definition: confbridge.h:224
const ast_string_field errormenu
Definition: confbridge.h:224
const ast_string_field participantsunmuted
Definition: confbridge.h:224
const ast_string_field participantsmuted
Definition: confbridge.h:224
const ast_string_field leave
Definition: confbridge.h:224
const ast_string_field locked
Definition: confbridge.h:224
const ast_string_field join
Definition: confbridge.h:224
const ast_string_field kicked
Definition: confbridge.h:224
const ast_string_field hasleft
Definition: confbridge.h:224
const ast_string_field unmuted
Definition: confbridge.h:224
const ast_string_field leaderhasleft
Definition: confbridge.h:224
const ast_string_field lockednow
Definition: confbridge.h:224
const ast_string_field hasjoin
Definition: confbridge.h:224
const ast_string_field binauraloff
Definition: confbridge.h:224
const ast_string_field onlyperson
Definition: confbridge.h:224
const ast_string_field thereare
Definition: confbridge.h:224
const ast_string_field muted
Definition: confbridge.h:224
const ast_string_field begin
Definition: confbridge.h:224

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().

◆ 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 3357 of file app_confbridge.c.

3361{
3362 /* See if music on hold is playing */
3364
3365 /* execute the list of actions associated with this menu entry */
3366 execute_menu_entry(user->conference, user, bridge_channel, menu_entry, menu);
3367
3368 /* See if music on hold needs to be started back up again */
3370
3371 async_play_sound_ready(bridge_channel->chan);
3372
3373 return 0;
3374}
static void conf_moh_unsuspend(struct confbridge_user *user)
static void conf_moh_suspend(struct confbridge_user *user)
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)
void async_play_sound_ready(struct ast_channel *chan)
Indicate the initiator of an async sound file is ready for it to play.
struct ast_channel * chan

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

Referenced by menu_hook_callback().

◆ 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

Definition at line 1591 of file app_confbridge.c.

1592{
1593 ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", conference->name);
1594}
@ AST_DEVSTATE_CACHABLE
Definition: devicestate.h:70
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:513
@ AST_DEVICE_INUSE
Definition: devicestate.h:55

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

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

◆ 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 1555 of file app_confbridge.c.

1556{
1557 /* If we have not been quieted play back that they are waiting for the leader */
1559 conf_get_sound(CONF_SOUND_WAIT_FOR_LEADER, user->conference->b_profile.sounds))) {
1560 /* user hungup while the sound was playing */
1561 return -1;
1562 }
1563 return 0;
1564}
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.
static int play_prompt_to_user(struct confbridge_user *user, const char *filename)
Play back an audio file to a channel.
#define ast_test_flag(p, flag)
Definition: utils.h:63

References ast_test_flag, conf_get_sound(), CONF_SOUND_WAIT_FOR_LEADER, play_prompt_to_user(), and USER_OPT_QUIET.

Referenced by conf_default_join_waitmarked().

◆ 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 1566 of file app_confbridge.c.

1567{
1568 /* If audio prompts have not been quieted or this prompt quieted play it on out */
1571 conf_get_sound(CONF_SOUND_ONLY_PERSON, user->conference->b_profile.sounds))) {
1572 /* user hungup while the sound was playing */
1573 return -1;
1574 }
1575 }
1576 return 0;
1577}

References ast_test_flag, conf_get_sound(), CONF_SOUND_ONLY_PERSON, play_prompt_to_user(), USER_OPT_NOONLYPERSON, and USER_OPT_QUIET.

Referenced by join_marked(), and join_unmarked().

◆ 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 1596 of file app_confbridge.c.

1597{
1598 /* If we are the second participant we may need to stop music on hold on the first */
1599 struct confbridge_user *first_user = AST_LIST_FIRST(&conference->active_list);
1600
1601 if (ast_test_flag(&first_user->u_profile, USER_OPT_MUSICONHOLD)) {
1602 conf_moh_stop(first_user);
1603 }
1604 conf_update_user_mute(first_user);
1605}
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
#define AST_LIST_FIRST(head)
Returns the first entry contained in a list.
Definition: linkedlists.h:421
The structure that represents a conference bridge user.
Definition: confbridge.h:273
struct confbridge_conference * conference
Definition: confbridge.h:274
struct user_profile u_profile
Definition: confbridge.h:276

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

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

◆ conf_load_config()

int conf_load_config ( void  )

load confbridge.conf file

Definition at line 2609 of file conf_config_parser.c.

2610{
2611 if (aco_info_init(&cfg_info)) {
2612 return -1;
2613 }
2614
2615 /* User options */
2616 aco_option_register(&cfg_info, "type", ACO_EXACT, user_types, NULL, OPT_NOOP_T, 0, 0);
2617 aco_option_register(&cfg_info, "admin", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ADMIN);
2618 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);
2619 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);
2620 aco_option_register(&cfg_info, "marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MARKEDUSER);
2621 aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);
2622 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);
2623 aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);
2624 aco_option_register(&cfg_info, "hear_own_join_sound", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_HEAR_OWN_JOIN_SOUND);
2625 aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);
2626 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);
2627 /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */
2628 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);
2629 aco_option_register(&cfg_info, "wait_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_WAITMARKED);
2630 aco_option_register(&cfg_info, "end_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKED);
2631 aco_option_register(&cfg_info, "end_marked_any", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKEDANY);
2632 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);
2633 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);
2634 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);
2635 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);
2637 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));
2638 aco_option_register(&cfg_info, "announcement", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, announcement));
2639 aco_option_register(&cfg_info, "denoise", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DENOISE);
2640 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);
2641 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));
2642 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));
2643 aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);
2644 aco_option_register(&cfg_info, "timeout", ACO_EXACT, user_types, "0", OPT_UINT_T, 0, FLDSET(struct user_profile, timeout));
2645 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);
2646 aco_option_register(&cfg_info, "answer_channel", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANSWER_CHANNEL);
2647
2648 /* This option should only be used with the CONFBRIDGE dialplan function */
2650
2651/* XXX ASTERISK-21271 need a user supplied bridge merge_priority to merge ConfBridges (default = 1, range 1-INT_MAX) */
2652 /* Bridge options */
2653 aco_option_register(&cfg_info, "type", ACO_EXACT, bridge_types, NULL, OPT_NOOP_T, 0, 0);
2654 aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), USER_OPT_JITTERBUFFER);
2655 aco_option_register_custom(&cfg_info, "internal_sample_rate", ACO_EXACT, bridge_types, "auto", sample_rate_handler, 0);
2656 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);
2657 aco_option_register_custom(&cfg_info, "maximum_sample_rate", ACO_EXACT, bridge_types, "none", sample_rate_handler, 0);
2658 aco_option_register_custom(&cfg_info, "mixing_interval", ACO_EXACT, bridge_types, "20", mix_interval_handler, 0);
2659 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);
2661 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);
2662 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);
2663 aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
2664 aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
2665 aco_option_register(&cfg_info, "record_options", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_options));
2666 aco_option_register(&cfg_info, "record_command", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_command));
2670 aco_option_register(&cfg_info, "video_update_discard", ACO_EXACT, bridge_types, "2000", OPT_UINT_T, 0, FLDSET(struct bridge_profile, video_update_discard));
2671 aco_option_register(&cfg_info, "remb_send_interval", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_send_interval));
2672 aco_option_register_custom(&cfg_info, "remb_behavior", ACO_EXACT, bridge_types, "average", remb_behavior_handler, 0);
2673 aco_option_register(&cfg_info, "remb_estimated_bitrate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_estimated_bitrate));
2674 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);
2675 /* This option should only be used with the CONFBRIDGE dialplan function */
2677
2678 /* Menu options */
2679 aco_option_register(&cfg_info, "type", ACO_EXACT, menu_types, NULL, OPT_NOOP_T, 0, 0);
2680 /* This option should only be used with the CONFBRIDGE dialplan function */
2682 aco_option_register_custom(&cfg_info, "^[0-9A-D*#]+$", ACO_REGEX, menu_types, NULL, menu_option_handler, 0);
2683
2684 if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
2685 goto error;
2686 }
2687
2689 goto error;
2690 }
2691
2692 return 0;
2693error:
2695 return -1;
2696}
#define __stringify(x)
Definition: asterisk.h:216
static char regcontext[AST_MAX_CONTEXT]
Definition: chan_iax2.c:349
static char language[MAX_LANGUAGE]
Definition: chan_iax2.c:348
#define ast_cli_register_multiple(e, len)
Register multiple commands.
Definition: cli.h:265
static int user_template_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static int remb_behavior_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static int announce_user_count_all_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static int sample_rate_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static struct aco_type * user_types[]
static int video_mode_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static int sound_option_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static struct aco_type * bridge_types[]
static struct aco_type * menu_types[]
void conf_destroy_config(void)
destroy the information loaded from the confbridge.conf file
static int menu_option_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static int menu_template_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 int mix_interval_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
#define DEFAULT_SILENCE_THRESHOLD
Definition: confbridge.h:49
#define DEFAULT_TALKING_THRESHOLD
Definition: confbridge.h:46
@ ACO_PREFIX
@ ACO_EXACT
@ ACO_REGEX
@ ACO_PROCESS_ERROR
Their was an error and no changes were applied.
int aco_info_init(struct aco_info *info)
Initialize an aco_info structure.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
#define CHARFLDSET(type, field)
A helper macro to pass the appropriate arguments to aco_option_register for OPT_CHAR_ARRAY_T.
#define aco_option_register(info, name, matchtype, types, default_val, opt_type, flags,...)
Register a config option.
@ OPT_UINT_T
Type for default option handler for unsigned integers.
@ OPT_NOOP_T
Type for a default handler that should do nothing.
@ OPT_BOOLFLAG_T
Type for default option handler for bools (ast_true/ast_false) that are stored in a flag.
@ OPT_CHAR_ARRAY_T
Type for default option handler for character array strings.
#define aco_option_register_custom(info, name, matchtype, types, default_val, handler, flags)
Register a config option.
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.
int error(const char *format,...)
Definition: utils/frame.c:999

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(), bridge_types, CHARFLDSET, cli_confbridge_parser, conf_destroy_config(), DEFAULT_SILENCE_THRESHOLD, DEFAULT_TALKING_THRESHOLD, error(), FLDSET, language, menu_option_handler(), menu_template_handler(), menu_types, mix_interval_handler(), NULL, OPT_BOOLFLAG_T, OPT_CHAR_ARRAY_T, OPT_NOOP_T, OPT_UINT_T, regcontext, remb_behavior_handler(), sample_rate_handler(), sound_option_handler(), USER_OPT_ADMIN, USER_OPT_ANNOUNCE_JOIN_LEAVE, USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW, USER_OPT_ANNOUNCEUSERCOUNT, USER_OPT_ANSWER_CHANNEL, USER_OPT_DENOISE, USER_OPT_DROP_SILENCE, USER_OPT_DTMF_PASS, USER_OPT_ECHO_EVENTS, USER_OPT_ENDMARKED, USER_OPT_ENDMARKEDANY, USER_OPT_HEAR_OWN_JOIN_SOUND, 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(), user_types, and video_mode_handler().

Referenced by load_module().

◆ 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 2828 of file conf_config_parser.c.

2829{
2830 struct conf_menu_action *menu_action = NULL;
2831 while ((menu_action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {
2832 ast_free(menu_action);
2833 }
2834}
#define ast_free(a)
Definition: astmm.h:180
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
Definition: linkedlists.h:833
struct conf_menu_action::@89 action
struct conf_menu_entry::@91 actions

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

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

◆ conf_moh_start()

void conf_moh_start ( struct confbridge_user user)

Start MOH for the conference user.

Parameters
userConference user to start MOH on.

Definition at line 1498 of file app_confbridge.c.

1499{
1500 user->playing_moh = 1;
1501 if (!user->suspended_moh) {
1502 int in_bridge;
1503
1504 /*
1505 * Locking the ast_bridge here is the only way to hold off the
1506 * call to ast_bridge_join() in confbridge_exec() from
1507 * interfering with the bridge and MOH operations here.
1508 */
1509 ast_bridge_lock(user->conference->bridge);
1510
1511 /*
1512 * Temporarily suspend the user from the bridge so we have
1513 * control to start MOH if needed.
1514 */
1515 in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
1516 ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
1517 if (in_bridge) {
1518 ast_bridge_unsuspend(user->conference->bridge, user->chan);
1519 }
1520
1521 ast_bridge_unlock(user->conference->bridge);
1522 }
1523}
#define ast_bridge_unlock(bridge)
Unlock the bridge.
Definition: bridge.h:485
int ast_bridge_suspend(struct ast_bridge *bridge, struct ast_channel *chan)
Suspend a channel temporarily from a bridge.
Definition: bridge.c:3076
int ast_bridge_unsuspend(struct ast_bridge *bridge, struct ast_channel *chan)
Unsuspend a channel from a bridge.
Definition: bridge.c:3097
#define ast_bridge_lock(bridge)
Lock the bridge.
Definition: bridge.h:474
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:7787

References ast_bridge_lock, ast_bridge_suspend(), ast_bridge_unlock, ast_bridge_unsuspend(), ast_moh_start(), and NULL.

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

◆ conf_moh_stop()

void conf_moh_stop ( struct confbridge_user user)

Stop MOH for the conference user.

Parameters
userConference user to stop MOH on.

Definition at line 1471 of file app_confbridge.c.

1472{
1473 user->playing_moh = 0;
1474 if (!user->suspended_moh) {
1475 int in_bridge;
1476
1477 /*
1478 * Locking the ast_bridge here is the only way to hold off the
1479 * call to ast_bridge_join() in confbridge_exec() from
1480 * interfering with the bridge and MOH operations here.
1481 */
1482 ast_bridge_lock(user->conference->bridge);
1483
1484 /*
1485 * Temporarily suspend the user from the bridge so we have
1486 * control to stop MOH if needed.
1487 */
1488 in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
1489 ast_moh_stop(user->chan);
1490 if (in_bridge) {
1491 ast_bridge_unsuspend(user->conference->bridge, user->chan);
1492 }
1493
1494 ast_bridge_unlock(user->conference->bridge);
1495 }
1496}
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
Definition: channel.c:7797

References ast_bridge_lock, ast_bridge_suspend(), ast_bridge_unlock, ast_bridge_unsuspend(), and ast_moh_stop().

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

◆ 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 4564 of file app_confbridge.c.

4565{
4567
4568 /* Turn on MOH if the single participant is set up for it */
4569 if (ast_test_flag(&only_user->u_profile, USER_OPT_MUSICONHOLD)) {
4570 conf_moh_start(only_user);
4571 }
4572 conf_update_user_mute(only_user);
4573}
void conf_moh_start(struct confbridge_user *user)
Start MOH for the conference user.

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

Referenced by transition_to_single(), and transition_to_single_marked().

◆ 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.

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

References record_tech.

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

◆ conf_reload_config()

int conf_reload_config ( void  )

reload confbridge.conf file

Definition at line 2698 of file conf_config_parser.c.

2699{
2700 if (aco_process_config(&cfg_info, 1) == ACO_PROCESS_ERROR) {
2701 /* On a reload, just keep the config we already have in place. */
2702 return -1;
2703 }
2704 return 0;
2705}

References aco_process_config(), and ACO_PROCESS_ERROR.

Referenced by reload().

◆ 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 4551 of file app_confbridge.c.

4552{
4553 AST_LIST_REMOVE(&conference->active_list, user, list);
4554 conference->activeusers--;
4555}
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.
Definition: linkedlists.h:856

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

Referenced by leave_active(), and leave_unmarked().

◆ 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 4557 of file app_confbridge.c.

4558{
4559 AST_LIST_REMOVE(&conference->active_list, user, list);
4560 conference->activeusers--;
4561 conference->markedusers--;
4562}

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

Referenced by leave_marked().

◆ 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 4575 of file app_confbridge.c.

4576{
4577 AST_LIST_REMOVE(&conference->waiting_list, user, list);
4578 conference->waitingusers--;
4579}

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

Referenced by conf_default_leave_waitmarked().

◆ 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 453 of file confbridge_manager.c.

455{
456 struct ast_bridge_blob *obj = stasis_message_data(msg);
457 struct ast_json *extras = obj->blob;
458 struct user_profile u_profile = {{0}};
459 int source_send_events = 0;
460 int source_echo_events = 0;
461 struct ast_json* json_channels = NULL;
462 struct confbridge_user *user;
463 const char *msg_name = confbridge_event_type_to_string(stasis_message_type(msg));
464
465 ast_debug(3, "Distributing %s event to participants\n", msg_name);
466
467 /* This could be a channel level event or a bridge level event */
468 if (chan) {
470 ast_log(LOG_ERROR, "Unable to retrieve user profile for channel '%s'\n",
472 return;
473 }
474 source_send_events = ast_test_flag(&u_profile, USER_OPT_SEND_EVENTS);
475 source_echo_events = ast_test_flag(&u_profile, USER_OPT_ECHO_EVENTS);
476 ast_debug(3, "send_events: %d echo_events: %d for profile %s\n",
477 source_send_events, source_echo_events, u_profile.name);
478 }
479
480 /* Now send a message to the participants with the json string. */
483 struct ast_json *json_object;
484
485 /*
486 * If the msg type is join, we need to capture all targets channel info so we can
487 * send a welcome message to the source channel with all current participants.
488 */
489 if (source_send_events && stasis_message_type(msg) == confbridge_join_type()) {
490 struct ast_channel_snapshot *target_snapshot;
491 struct ast_json *target_json_channel;
492
494 if (!target_snapshot) {
495 ast_log(LOG_ERROR, "Unable to get a channel snapshot for '%s'\n",
496 ast_channel_name(user->chan));
497 continue;
498 }
499
500 target_json_channel = channel_to_json(target_snapshot, extras, NULL);
501 ao2_ref(target_snapshot, -1);
502
503 if (!json_channels) {
504 json_channels = ast_json_array_create();
505 if (!json_channels) {
506 ast_log(LOG_ERROR, "Unable to allocate json array\n");
507 ast_json_unref(target_json_channel);
508 return;
509 }
510 }
511
512 ast_json_array_append(json_channels, target_json_channel);
513 }
514
515 /* Don't send a message to the user that triggered the event. */
516 if (!source_echo_events && user->chan == chan) {
517 ast_debug(3, "Skipping queueing %s message to '%s'. Same channel.\n", msg_name,
518 ast_channel_name(user->chan));
519 continue;
520 }
521
522 /* Don't send a message to users in profiles not sending events. */
523 if (!ast_test_flag(&user->u_profile, USER_OPT_SEND_EVENTS)) {
524 ast_debug(3, "Skipping queueing %s message to '%s'. Not receiving events.\n", msg_name,
525 ast_channel_name(user->chan));
526 continue;
527 }
528
529 json_object = pack_snapshots(obj->bridge, obj->channel, extras, NULL, msg);
530
531 if (!json_object) {
532 ast_log(LOG_ERROR, "Unable to convert %s message to json\n", msg_name);
533 continue;
534 }
535
536 send_message(msg_name, conference->name, json_object, user->chan);
537 ast_json_unref(json_object);
538 }
539 ao2_unlock(conference);
540
541 /*
542 * If this is a join event, send the welcome message to just the joining user
543 * if it's not audio-only or otherwise restricted.
544 */
545 if (source_send_events && json_channels
547 struct ast_json *json_object;
548 struct ast_json *json_bridge;
549 const char *welcome_msg_name = confbridge_event_type_to_string(confbridge_welcome_type());
550
551 json_bridge = bridge_to_json(obj->bridge);
552 json_object = pack_bridge_and_channels(json_bridge, json_channels, msg);
553 if (!json_object) {
554 ast_log(LOG_ERROR, "Unable to convert ConfbridgeWelcome message to json\n");
555 return;
556 }
557 ast_json_string_set(ast_json_object_get(json_object, "type"), welcome_msg_name);
558
559 send_message(welcome_msg_name, conference->name, json_object, chan);
560 ast_json_unref(json_object);
561 }
562}
#define ast_log
Definition: astobj2.c:42
const char * ast_channel_name(const struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
const struct user_profile * conf_find_user_profile(struct ast_channel *chan, const char *user_profile_name, struct user_profile *result)
find a user profile given a user profile's name and store that profile in result structure.
struct stasis_message_type * confbridge_welcome_type(void)
get the confbridge welcome stasis message type
struct stasis_message_type * confbridge_join_type(void)
get the confbridge join stasis message type
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
static struct ast_json * bridge_to_json(struct ast_bridge_snapshot *bridge_snapshot)
static struct ast_json * channel_to_json(struct ast_channel_snapshot *channel_snapshot, struct ast_json *conf_blob, struct ast_json *labels_blob)
static struct ast_json * pack_snapshots(struct ast_bridge_snapshot *bridge_snapshot, struct ast_channel_snapshot *channel_snapshot, struct ast_json *conf_blob, struct ast_json *labels_blob, struct stasis_message *msg)
static void send_message(const char *msg_name, char *conf_name, struct ast_json *json_object, struct ast_channel *chan)
static struct ast_json * pack_bridge_and_channels(struct ast_json *json_bridge, struct ast_json *json_channels, struct stasis_message *msg)
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,...
#define ast_debug(level,...)
Log a DEBUG message.
#define LOG_ERROR
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
Definition: json.c:73
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
Definition: json.c:378
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
Definition: json.c:362
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
Definition: json.c:407
int ast_json_string_set(struct ast_json *string, const char *value)
Change the value of a JSON string.
Definition: json.c:288
static char user[512]
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
Blob of data associated with a bridge.
struct ast_bridge_snapshot * bridge
struct ast_channel_snapshot * channel
struct ast_json * blob
Structure representing a snapshot of channel state.
Abstract JSON element (object, array, string, int, ...).
struct confbridge_user::@98 list
struct ast_channel * chan
Definition: confbridge.h:279
char name[MAX_PROFILE_NAME]
Definition: confbridge.h:155

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::conference, confbridge_user::list, LOG_ERROR, confbridge_conference::name, user_profile::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().

◆ 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 2882 of file conf_config_parser.c.

2883{
2885 RAII_VAR(struct conf_menu *, menu, NULL, ao2_cleanup);
2886
2887 if (chan && ast_strlen_zero(menu_profile_name)) {
2888 struct ast_datastore *datastore;
2889 struct func_confbridge_data *b_data;
2890
2891 ast_channel_lock(chan);
2893 ast_channel_unlock(chan);
2894 if (datastore) {
2895 /* If a menu exists in the CONFBRIDGE function datastore, use it. */
2896 b_data = datastore->data;
2897 if (b_data->m_usable) {
2898 menu = ao2_bump(b_data->menu);
2899 return apply_menu_to_user(user, menu);
2900 }
2901 }
2902 }
2903
2904 /* Otherwise, we need to get whatever menu profile is specified to use (or default). */
2905 if (!cfg) {
2906 return -1;
2907 }
2908
2909 if (ast_strlen_zero(menu_profile_name)) {
2910 menu_profile_name = DEFAULT_MENU_PROFILE;
2911 }
2912
2913 if (!(menu = ao2_find(cfg->menus, menu_profile_name, OBJ_KEY))) {
2914 return -1;
2915 }
2916
2917 return apply_menu_to_user(user, menu);
2918}
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
Definition: astobj2.h:480
static int apply_menu_to_user(struct confbridge_user *user, struct conf_menu *menu)
#define DEFAULT_MENU_PROFILE
Definition: confbridge.h:43
struct conf_menu * menu

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, confbridge_datastore, 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().

◆ 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.

Definition at line 1413 of file app_confbridge.c.

1414{
1415 int mute_user;
1416 int mute_system;
1417 int mute_effective;
1418
1419 /* User level mute request. */
1420 mute_user = user->muted;
1421
1422 /* System level mute request. */
1423 mute_system = user->playing_moh
1424 /*
1425 * Do not allow waitmarked users to talk to anyone unless there
1426 * is a marked user present.
1427 */
1428 || (!user->conference->markedusers
1429 && ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED));
1430
1431 mute_effective = mute_user || mute_system;
1432
1433 ast_debug(1, "User %s is %s: user:%d system:%d.\n",
1434 ast_channel_name(user->chan), mute_effective ? "muted" : "unmuted",
1435 mute_user, mute_system);
1436 user->features.mute = mute_effective;
1437 ast_test_suite_event_notify("CONF_MUTE_UPDATE",
1438 "Mode: %s\r\n"
1439 "Conference: %s\r\n"
1440 "Channel: %s",
1441 mute_effective ? "muted" : "unmuted",
1442 user->conference->b_profile.name,
1443 ast_channel_name(user->chan));
1444}
#define ast_test_suite_event_notify(s, f,...)
Definition: test.h:189

References ast_channel_name(), ast_debug, ast_test_flag, ast_test_suite_event_notify, 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().

◆ 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 276 of file confbridge_manager.c.

277{
278 if (event_type == confbridge_start_type()) {
279 return "ConfbridgeStart";
280 } else if (event_type == confbridge_end_type()) {
281 return "ConfbridgeEnd";
282 } else if (event_type == confbridge_join_type()) {
283 return "ConfbridgeJoin";
284 } else if (event_type == confbridge_leave_type()) {
285 return "ConfbridgeLeave";
286 } else if (event_type == confbridge_start_record_type()) {
287 return "ConfbridgeRecord";
288 } else if (event_type == confbridge_stop_record_type()) {
289 return "ConfbridgeStopRecord";
290 } else if (event_type == confbridge_mute_type()) {
291 return "ConfbridgeMute";
292 } else if (event_type == confbridge_unmute_type()) {
293 return "ConfbridgeUnmute";
294 } else if (event_type == confbridge_talking_type()) {
295 return "ConfbridgeTalking";
296 } else if (event_type == confbridge_welcome_type()) {
297 return "ConfbridgeWelcome";
298 } else {
299 return "unknown";
300 }
301}
struct stasis_message_type * confbridge_mute_type(void)
get the confbridge mute stasis message type
struct stasis_message_type * confbridge_talking_type(void)
get the confbridge talking stasis message type
struct stasis_message_type * confbridge_stop_record_type(void)
get the confbridge stop_record stasis message type
struct stasis_message_type * confbridge_end_type(void)
get the confbridge end stasis message type
struct stasis_message_type * confbridge_start_type(void)
get the confbridge start stasis message type
struct stasis_message_type * confbridge_start_record_type(void)
get the confbridge start_record stasis message type
struct stasis_message_type * confbridge_unmute_type(void)
get the confbridge unmute stasis message type
struct stasis_message_type * confbridge_leave_type(void)
get the confbridge leave stasis message type

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_channel(), pack_bridge_and_channels(), and send_message().

◆ 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 1696 of file app_confbridge.c.

1697{
1698 struct ast_channel_snapshot *old_snapshot;
1699 struct ast_channel_snapshot *new_snapshot;
1700 char *confbr_name = NULL;
1701 char *comma;
1703 struct confbridge_user *user = NULL;
1704 int found_user = 0;
1705 struct ast_json *json_object;
1706
1708 && strcmp(msg->to_transferee.channel_snapshot->dialplan->appl, "ConfBridge") == 0
1709 && msg->target) {
1710 /* We're transferring a bridge to an extension */
1711 old_snapshot = msg->to_transferee.channel_snapshot;
1712 new_snapshot = msg->target;
1713 } else if (msg->to_transfer_target.channel_snapshot
1714 && strcmp(msg->to_transfer_target.channel_snapshot->dialplan->appl, "ConfBridge") == 0
1715 && msg->transferee) {
1716 /* We're transferring a call to a bridge */
1717 old_snapshot = msg->to_transfer_target.channel_snapshot;
1718 new_snapshot = msg->transferee;
1719 } else {
1720 ast_log(LOG_ERROR, "Could not determine proper channels\n");
1721 return;
1722 }
1723
1724 /*
1725 * old_snapshot->data should have the original parameters passed to
1726 * the ConfBridge app:
1727 * conference[,bridge_profile[,user_profile[,menu]]]
1728 * We'll use "conference" to look up the bridge.
1729 *
1730 * We _could_ use old_snapshot->bridgeid to get the bridge but
1731 * that would involve locking the conference_bridges container
1732 * and iterating over it looking for a matching bridge.
1733 */
1734 if (ast_strlen_zero(old_snapshot->dialplan->data)) {
1735 ast_log(LOG_ERROR, "Channel '%s' didn't have app data set\n", old_snapshot->base->name);
1736 return;
1737 }
1738 confbr_name = ast_strdupa(old_snapshot->dialplan->data);
1739 comma = strchr(confbr_name, ',');
1740 if (comma) {
1741 *comma = '\0';
1742 }
1743
1744 ast_debug(1, "Confbr: %s Leaving: %s Joining: %s\n", confbr_name, old_snapshot->base->name, new_snapshot->base->name);
1745
1746 conference = ao2_find(conference_bridges, confbr_name, OBJ_SEARCH_KEY);
1747 if (!conference) {
1748 ast_log(LOG_ERROR, "Conference bridge '%s' not found\n", confbr_name);
1749 return;
1750 }
1751 ao2_lock(conference);
1752
1753 /*
1754 * We need to grab the user profile for the departing user in order to
1755 * properly format the join/leave messages.
1756 */
1757 AST_LIST_TRAVERSE(&conference->active_list, user, list) {
1758 if (strcasecmp(ast_channel_name(user->chan), old_snapshot->base->name) == 0) {
1759 found_user = 1;
1760 break;
1761 }
1762 }
1763
1764 /*
1765 * If we didn't find the user in the active list, try the waiting list.
1766 */
1767 if (!found_user && conference->waitingusers) {
1768 AST_LIST_TRAVERSE(&conference->waiting_list, user, list) {
1769 if (strcasecmp(ast_channel_name(user->chan), old_snapshot->base->name) == 0) {
1770 found_user = 1;
1771 break;
1772 }
1773 }
1774 }
1775
1776 if (!found_user) {
1777 ast_log(LOG_ERROR, "Unable to find user profile for channel '%s' in bridge '%s'\n",
1778 old_snapshot->base->name, confbr_name);
1779 return;
1780 }
1781
1782 /*
1783 * We're going to use the existing user profile to create the messages.
1784 */
1785 json_object = ast_json_pack("{s: b}",
1786 "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN)
1787 );
1788 if (!json_object) {
1789 return;
1790 }
1791
1792 send_conf_stasis_snapshots(conference, old_snapshot, confbridge_leave_type(), json_object);
1793 ast_json_unref(json_object);
1794
1795 json_object = ast_json_pack("{s: b, s: b}",
1796 "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN),
1797 "muted", user->muted);
1798 if (!json_object) {
1799 return;
1800 }
1801 send_conf_stasis_snapshots(conference, new_snapshot, confbridge_join_type(), json_object);
1802 ast_json_unref(json_object);
1803}
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)
static void confbridge_unlock_and_unref(void *obj)
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:298
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
Definition: astobj2.h:1101
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
Definition: json.c:612
struct ast_bridge_channel_snapshot_pair to_transfer_target
struct ast_channel_snapshot * transferee
struct ast_bridge_channel_snapshot_pair to_transferee
struct ast_channel_snapshot * target
struct ast_channel_snapshot * channel_snapshot
const ast_string_field name
const ast_string_field data
const ast_string_field appl
struct ast_channel_snapshot_dialplan * dialplan
struct ast_channel_snapshot_base * base
The structure that represents a conference bridge.
Definition: confbridge.h:246

References 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, ast_bridge_channel_snapshot_pair::channel_snapshot, confbridge_join_type(), confbridge_leave_type(), confbridge_unlock_and_unref(), conference_bridges, ast_channel_snapshot_dialplan::data, ast_channel_snapshot::dialplan, LOG_ERROR, 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, and USER_OPT_ADMIN.

Referenced by confbridge_atxfer_cb().

◆ 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 1312 of file conf_config_parser.c.

1313{
1314 struct ast_datastore *datastore;
1315 struct func_confbridge_data *b_data;
1316 char *parse;
1317 struct ast_variable tmpvar = { 0, };
1318 struct ast_variable template = {
1319 .name = "template",
1320 .file = "CONFBRIDGE"
1321 };
1324 AST_APP_ARG(option);
1325 );
1326
1327 if (!chan) {
1328 ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
1329 return -1;
1330 }
1331
1332 /* parse all the required arguments and make sure they exist. */
1333 if (ast_strlen_zero(data)) {
1334 return -1;
1335 }
1336 parse = ast_strdupa(data);
1338 if (ast_strlen_zero(args.type) || ast_strlen_zero(args.option)) {
1339 return -1;
1340 }
1341
1342 ast_channel_lock(chan);
1344 if (!datastore) {
1346 if (!datastore) {
1347 ast_channel_unlock(chan);
1348 return 0;
1349 }
1350 b_data = ast_calloc(1, sizeof(*b_data));
1351 if (!b_data) {
1352 ast_channel_unlock(chan);
1353 ast_datastore_free(datastore);
1354 return 0;
1355 }
1356 datastore->data = b_data;
1358 if (!b_data->b_profile.sounds) {
1359 ast_channel_unlock(chan);
1360 ast_datastore_free(datastore);
1361 return 0;
1362 }
1363 if (!(b_data->menu = menu_alloc("dialplan"))) {
1364 ast_channel_unlock(chan);
1365 ast_datastore_free(datastore);
1366 return 0;
1367 }
1368 ast_channel_datastore_add(chan, datastore);
1369 } else {
1370 b_data = datastore->data;
1371 }
1372 ast_channel_unlock(chan);
1373
1374 /* SET(CONFBRIDGE(type,option)=value) */
1375 if (!value) {
1376 value = "";
1377 }
1378 tmpvar.name = args.option;
1379 tmpvar.value = value;
1380 tmpvar.file = "CONFBRIDGE";
1381 if (!strcasecmp(args.type, "bridge")) {
1382 if (!strcasecmp(args.option, "clear")) {
1383 b_data->b_usable = 0;
1385 memset(&b_data->b_profile, 0, sizeof(b_data->b_profile)) ;
1386 if (!(b_data->b_profile.sounds = bridge_profile_sounds_alloc())) {
1387 /* If this reallocation fails, the datastore has become unusable and must be destroyed. */
1388 ast_channel_lock(chan);
1389 ast_channel_datastore_remove(chan, datastore);
1390 ast_channel_unlock(chan);
1391 ast_datastore_free(datastore);
1392 }
1393 return 0;
1394 }
1395
1396 if (b_data && !b_data->b_usable && strcasecmp(args.option, "template")) {
1397 template.value = DEFAULT_BRIDGE_PROFILE;
1398 aco_process_var(&bridge_type, "dialplan", &template, &b_data->b_profile);
1399 }
1400
1401 if (!aco_process_var(&bridge_type, "dialplan", &tmpvar, &b_data->b_profile)) {
1402 b_data->b_usable = 1;
1403 return 0;
1404 }
1405 } else if (!strcasecmp(args.type, "user")) {
1406 if (!strcasecmp(args.option, "clear")) {
1407 b_data->u_usable = 0;
1409 memset(&b_data->u_profile, 0, sizeof(b_data->u_profile));
1410 return 0;
1411 }
1412
1413 if (b_data && !b_data->u_usable && strcasecmp(args.option, "template")) {
1414 template.value = DEFAULT_USER_PROFILE;
1415 aco_process_var(&user_type, "dialplan", &template, &b_data->u_profile);
1416 }
1417
1418 if (!aco_process_var(&user_type, "dialplan", &tmpvar, &b_data->u_profile)) {
1419 b_data->u_usable = 1;
1420 return 0;
1421 }
1422 } else if (!strcasecmp(args.type, "menu")) {
1423 if (!strcasecmp(args.option, "clear")) {
1424 b_data->m_usable = 0;
1425 ao2_cleanup(b_data->menu);
1426 if (!(b_data->menu = menu_alloc("dialplan"))) {
1427 /* If this reallocation fails, the datastore has become unusable and must be destroyed */
1428 ast_channel_lock(chan);
1429 ast_channel_datastore_remove(chan, datastore);
1430 ast_channel_unlock(chan);
1431 ast_datastore_free(datastore);
1432 }
1433 return 0;
1434 }
1435
1436 if (b_data && !b_data->m_usable && strcasecmp(args.option, "template")) {
1437 template.value = DEFAULT_MENU_PROFILE;
1438 aco_process_var(&menu_type, "dialplan", &template, &b_data->menu);
1439 }
1440
1441 if (!aco_process_var(&menu_type, "dialplan", &tmpvar, b_data->menu)) {
1442 b_data->m_usable = 1;
1443 return 0;
1444 }
1445 }
1446
1447 ast_log(LOG_WARNING, "%s(%s,%s) cannot be set to '%s'. Invalid type, option, or value.\n",
1448 cmd, args.type, args.option, value);
1449 return -1;
1450}
static const char type[]
Definition: chan_ooh323.c:109
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
Definition: channel.c:2414
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
Definition: channel.c:2423
static struct aco_type bridge_type
static void * menu_alloc(const char *category)
void conf_bridge_profile_destroy(struct bridge_profile *b_profile)
Destroy a bridge profile found by 'conf_find_bridge_profile'.
static void user_profile_destructor(void *obj)
static struct aco_type menu_type
static struct aco_type user_type
static struct bridge_profile_sounds * bridge_profile_sounds_alloc(void)
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.
#define ast_datastore_alloc(info, uid)
Definition: datastore.h:85
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
Definition: datastore.c:68
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
#define LOG_WARNING
Structure for variables, used for configurations and for channel variables.
int value
Definition: syslog.c:37
const char * args

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(), bridge_type, conf_bridge_profile_destroy(), confbridge_datastore, 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(), menu_type, ast_variable::name, NULL, bridge_profile::sounds, type, func_confbridge_data::u_profile, func_confbridge_data::u_usable, user_profile_destructor(), user_type, ast_variable::value, and value.

◆ 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 760 of file confbridge_manager.c.

761{
772
775
776 if (!bridge_state_router) {
777 return -1;
778 }
779
783 NULL)) {
785 return -1;
786 }
790 NULL)) {
792 return -1;
793 }
797 NULL)) {
799 return -1;
800 }
804 NULL)) {
806 return -1;
807 }
811 NULL)) {
813 return -1;
814 }
818 NULL)) {
820 return -1;
821 }
825 NULL)) {
827 return -1;
828 }
832 NULL)) {
834 return -1;
835 }
839 NULL)) {
841 return -1;
842 }
846 NULL)) {
848 return -1;
849 }
850
853
856 return -1;
857 }
858
862 NULL)) {
864 return -1;
865 }
869 NULL)) {
871 return -1;
872 }
876 NULL)) {
878 return -1;
879 }
883 NULL)) {
885 return -1;
886 }
890 NULL)) {
892 return -1;
893 }
897 NULL)) {
899 return -1;
900 }
904 NULL)) {
906 return -1;
907 }
911 NULL)) {
913 return -1;
914 }
918 NULL)) {
920 return -1;
921 }
922
923 /* FYI: confbridge_welcome_type is never routed */
924
925 return 0;
926}
static void confbridge_unmute_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)
static void confbridge_atxfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static struct stasis_message_router * bridge_state_router
void manager_confbridge_shutdown(void)
unregister stasis message routers to handle manager events for confbridge messages
static void confbridge_stop_record_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_end_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_leave_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_start_record_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_talking_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void confbridge_join_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static struct stasis_message_router * channel_state_router
static void confbridge_mute_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
Definition: stasis.h:1493
struct stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
struct stasis_topic * ast_bridge_topic_all(void)
A topic which publishes the events for all bridges.
#define stasis_message_router_create(topic)
Create a new message router object.
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.

References ast_attended_transfer_type(), ast_bridge_topic_all(), ast_channel_topic_all(), bridge_state_router, channel_state_router, 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().

◆ 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 737 of file confbridge_manager.c.

References bridge_state_router, channel_state_router, 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().

◆ 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 2171 of file app_confbridge.c.

2172{
2173 return play_sound_helper(conference, filename, -1);
2174}
static int play_sound_helper(struct confbridge_conference *conference, const char *filename, int say_number)

References playback_task_data::conference, playback_task_data::filename, and play_sound_helper().

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

Variable Documentation

◆ conference_bridges

struct ao2_container* conference_bridges
extern