Asterisk - The Open Source Telephony Project GIT-master-1f1c5bb
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 2371 of file app_confbridge.c.

2373{
2374 return async_play_sound_helper(conference, filename, -1, initiator);
2375}
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 2377 of file app_confbridge.c.

2378{
2379 struct ast_datastore *async_datastore;
2380 struct async_datastore_data *add;
2381
2382 ast_channel_lock(chan);
2383 async_datastore = ast_channel_datastore_find(chan, &async_datastore_info, NULL);
2384 ast_channel_unlock(chan);
2385 if (!async_datastore) {
2386 return;
2387 }
2388
2389 add = async_datastore->data;
2390
2391 ast_mutex_lock(&add->lock);
2392 add->wait = 0;
2393 ast_cond_signal(&add->cond);
2394 ast_mutex_unlock(&add->lock);
2395}
static struct ast_datastore_info async_datastore_info
Datastore used for timing of async announcement playback.
#define ast_channel_lock(chan)
Definition: channel.h:2922
#define ast_channel_unlock(chan)
Definition: channel.h:2923
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:2399
#define ast_mutex_unlock(a)
Definition: lock.h:190
#define ast_mutex_lock(a)
Definition: lock.h:189
#define ast_cond_signal(cond)
Definition: lock.h:203
#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 1532 of file app_confbridge.c.

1533{
1534 struct post_join_action *action;
1535 if (!(action = ast_calloc(1, sizeof(*action)))) {
1536 return -1;
1537 }
1538 action->func = func;
1539 AST_LIST_INSERT_TAIL(&user->post_join_list, action, list);
1540 return 0;
1541}
#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 4485 of file app_confbridge.c.

4486{
4487 AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4488 conference->activeusers++;
4489}
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 4491 of file app_confbridge.c.

4492{
4493 AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4494 conference->activeusers++;
4495 conference->markedusers++;
4496}
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 4498 of file app_confbridge.c.

4499{
4500 AST_LIST_INSERT_TAIL(&conference->waiting_list, user, list);
4501 conference->waitingusers++;
4502}
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:331
#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:1878
@ AST_BRIDGE_IMPART_CHAN_INDEPENDENT
Definition: bridge.h:590
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
Definition: bridge.c:3683
@ 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:619
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 2558 of file conf_config_parser.c.

2559{
2560 *dst = *src;
2561 if (src->sounds) {
2562 ao2_ref(src->sounds, +1);
2563 }
2564}
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 2566 of file conf_config_parser.c.

2567{
2568 if (b_profile->sounds) {
2569 ao2_ref(b_profile->sounds, -1);
2570 b_profile->sounds = NULL;
2571 }
2572}

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

2730{
2732 aco_info_destroy(&cfg_info);
2734}
#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 1560 of file app_confbridge.c.

1561{
1562 struct pbx_find_info q = { .stacklen = 0 };
1563
1564 /* Called with a reference to conference */
1565 ao2_unlink(conference_bridges, conference);
1566 send_conf_end_event(conference);
1567 if (!ast_strlen_zero(conference->b_profile.regcontext) &&
1569 conference->name, 1, NULL, "", E_MATCH)) {
1571 conference->name, 1, NULL);
1572 }
1573 ao2_lock(conference);
1574 conf_stop_record(conference);
1575 ao2_unlock(conference);
1576}
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:4948
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 875 of file app_confbridge.c.

876{
877 return ao2_find(conference_bridges, conference_name, OBJ_KEY);
878}
#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 2574 of file conf_config_parser.c.

2575{
2576 struct bridge_profile *tmp2;
2577 struct ast_datastore *datastore = NULL;
2578 struct func_confbridge_data *b_data = NULL;
2580
2581 if (chan && ast_strlen_zero(bridge_profile_name)) {
2582 ast_channel_lock(chan);
2584 ast_channel_unlock(chan);
2585 if (datastore) {
2586 b_data = datastore->data;
2587 if (b_data->b_usable) {
2589 return result;
2590 }
2591 }
2592 }
2593
2594 if (!cfg) {
2595 return NULL;
2596 }
2597 if (ast_strlen_zero(bridge_profile_name)) {
2598 bridge_profile_name = DEFAULT_BRIDGE_PROFILE;
2599 }
2600 if (!(tmp2 = ao2_find(cfg->bridge_profiles, bridge_profile_name, OBJ_KEY))) {
2601 return NULL;
2602 }
2603 ao2_lock(tmp2);
2605 ao2_unlock(tmp2);
2606 ao2_ref(tmp2, -1);
2607
2608 return result;
2609}
#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 2645 of file conf_config_parser.c.

2646{
2647 struct conf_menu_entry *menu_entry = NULL;
2648
2649 ao2_lock(menu);
2650 AST_LIST_TRAVERSE(&menu->entries, menu_entry, entry) {
2651 if (!strcasecmp(menu_entry->dtmf, dtmf_sequence)) {
2652 copy_menu_entry(result, menu_entry);
2653 ao2_unlock(menu);
2654 return 1;
2655 }
2656 }
2657 ao2_unlock(menu);
2658
2659 return 0;
2660}
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::@93 entries
Definition: search.h:40

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

2522{
2523 struct user_profile *tmp2;
2524 struct ast_datastore *datastore = NULL;
2525 struct func_confbridge_data *b_data = NULL;
2527
2528 if (chan && ast_strlen_zero(user_profile_name)) {
2529 ast_channel_lock(chan);
2531 ast_channel_unlock(chan);
2532 if (datastore) {
2533 b_data = datastore->data;
2534 if (b_data->u_usable) {
2536 return result;
2537 }
2538 }
2539 }
2540
2541 if (!cfg) {
2542 return NULL;
2543 }
2544 if (ast_strlen_zero(user_profile_name)) {
2545 user_profile_name = DEFAULT_USER_PROFILE;
2546 }
2547 if (!(tmp2 = ao2_find(cfg->user_profiles, user_profile_name, OBJ_KEY))) {
2548 return NULL;
2549 }
2550 ao2_lock(tmp2);
2552 ao2_unlock(tmp2);
2553 ao2_ref(tmp2, -1);
2554
2555 return result;
2556}
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 614 of file app_confbridge.c.

615{
616 switch (sound) {
618 return S_OR(custom_sounds->hasjoin, "conf-hasjoin");
620 return S_OR(custom_sounds->hasleft, "conf-hasleft");
622 return S_OR(custom_sounds->kicked, "conf-kicked");
623 case CONF_SOUND_MUTED:
624 return S_OR(custom_sounds->muted, "conf-muted");
626 return S_OR(custom_sounds->unmuted, "conf-unmuted");
628 return S_OR(custom_sounds->binauralon, "confbridge-binaural-on");
630 return S_OR(custom_sounds->binauraloff, "confbridge-binaural-off");
632 return S_OR(custom_sounds->onlyone, "conf-onlyone");
634 return S_OR(custom_sounds->thereare, "conf-thereare");
636 return S_OR(custom_sounds->otherinparty, "conf-otherinparty");
638 return S_OR(custom_sounds->placeintoconf, "conf-placeintoconf");
640 return S_OR(custom_sounds->waitforleader, "conf-waitforleader");
642 return S_OR(custom_sounds->leaderhasleft, "conf-leaderhasleft");
644 return S_OR(custom_sounds->getpin, "conf-getpin");
646 return S_OR(custom_sounds->invalidpin, "conf-invalidpin");
648 return S_OR(custom_sounds->onlyperson, "conf-onlyperson");
650 return S_OR(custom_sounds->locked, "conf-locked");
652 return S_OR(custom_sounds->lockednow, "conf-lockednow");
654 return S_OR(custom_sounds->unlockednow, "conf-unlockednow");
656 return S_OR(custom_sounds->errormenu, "conf-errormenu");
657 case CONF_SOUND_JOIN:
658 return S_OR(custom_sounds->join, "confbridge-join");
659 case CONF_SOUND_LEAVE:
660 return S_OR(custom_sounds->leave, "confbridge-leave");
662 return S_OR(custom_sounds->participantsmuted, "conf-now-muted");
664 return S_OR(custom_sounds->participantsunmuted, "conf-now-unmuted");
665 case CONF_SOUND_BEGIN:
666 return S_OR(custom_sounds->begin, "confbridge-conf-begin");
667 }
668
669 return "";
670}
#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 3310 of file app_confbridge.c.

3314{
3315 /* See if music on hold is playing */
3317
3318 /* execute the list of actions associated with this menu entry */
3319 execute_menu_entry(user->conference, user, bridge_channel, menu_entry, menu);
3320
3321 /* See if music on hold needs to be started back up again */
3323
3324 async_play_sound_ready(bridge_channel->chan);
3325
3326 return 0;
3327}
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 1544 of file app_confbridge.c.

1545{
1546 ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", conference->name);
1547}
@ 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:510
@ 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 1508 of file app_confbridge.c.

1509{
1510 /* If we have not been quieted play back that they are waiting for the leader */
1512 conf_get_sound(CONF_SOUND_WAIT_FOR_LEADER, user->conference->b_profile.sounds))) {
1513 /* user hungup while the sound was playing */
1514 return -1;
1515 }
1516 return 0;
1517}
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 1519 of file app_confbridge.c.

1520{
1521 /* If audio prompts have not been quieted or this prompt quieted play it on out */
1524 conf_get_sound(CONF_SOUND_ONLY_PERSON, user->conference->b_profile.sounds))) {
1525 /* user hungup while the sound was playing */
1526 return -1;
1527 }
1528 }
1529 return 0;
1530}

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

1550{
1551 /* If we are the second participant we may need to stop music on hold on the first */
1552 struct confbridge_user *first_user = AST_LIST_FIRST(&conference->active_list);
1553
1554 if (ast_test_flag(&first_user->u_profile, USER_OPT_MUSICONHOLD)) {
1555 conf_moh_stop(first_user);
1556 }
1557 conf_update_user_mute(first_user);
1558}
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 2418 of file conf_config_parser.c.

2419{
2420 if (aco_info_init(&cfg_info)) {
2421 return -1;
2422 }
2423
2424 /* User options */
2425 aco_option_register(&cfg_info, "type", ACO_EXACT, user_types, NULL, OPT_NOOP_T, 0, 0);
2426 aco_option_register(&cfg_info, "admin", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ADMIN);
2427 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);
2428 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);
2429 aco_option_register(&cfg_info, "marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MARKEDUSER);
2430 aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);
2431 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);
2432 aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);
2433 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);
2434 aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);
2435 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);
2436 /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */
2437 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);
2438 aco_option_register(&cfg_info, "wait_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_WAITMARKED);
2439 aco_option_register(&cfg_info, "end_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKED);
2440 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);
2441 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);
2442 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);
2443 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);
2444 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);
2446 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));
2447 aco_option_register(&cfg_info, "announcement", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, announcement));
2448 aco_option_register(&cfg_info, "denoise", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DENOISE);
2449 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);
2450 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));
2451 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));
2452 aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);
2453 aco_option_register(&cfg_info, "timeout", ACO_EXACT, user_types, "0", OPT_UINT_T, 0, FLDSET(struct user_profile, timeout));
2454 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);
2455 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);
2456
2457 /* This option should only be used with the CONFBRIDGE dialplan function */
2459
2460/* XXX ASTERISK-21271 need a user supplied bridge merge_priority to merge ConfBridges (default = 1, range 1-INT_MAX) */
2461 /* Bridge options */
2462 aco_option_register(&cfg_info, "type", ACO_EXACT, bridge_types, NULL, OPT_NOOP_T, 0, 0);
2463 aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), USER_OPT_JITTERBUFFER);
2464 aco_option_register_custom(&cfg_info, "internal_sample_rate", ACO_EXACT, bridge_types, "auto", sample_rate_handler, 0);
2465 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);
2466 aco_option_register_custom(&cfg_info, "maximum_sample_rate", ACO_EXACT, bridge_types, "none", sample_rate_handler, 0);
2467 aco_option_register_custom(&cfg_info, "mixing_interval", ACO_EXACT, bridge_types, "20", mix_interval_handler, 0);
2468 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);
2470 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);
2471 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);
2472 aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
2473 aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
2474 aco_option_register(&cfg_info, "record_options", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_options));
2475 aco_option_register(&cfg_info, "record_command", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_command));
2479 aco_option_register(&cfg_info, "video_update_discard", ACO_EXACT, bridge_types, "2000", OPT_UINT_T, 0, FLDSET(struct bridge_profile, video_update_discard));
2480 aco_option_register(&cfg_info, "remb_send_interval", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_send_interval));
2481 aco_option_register_custom(&cfg_info, "remb_behavior", ACO_EXACT, bridge_types, "average", remb_behavior_handler, 0);
2482 aco_option_register(&cfg_info, "remb_estimated_bitrate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_estimated_bitrate));
2483 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);
2484 /* This option should only be used with the CONFBRIDGE dialplan function */
2486
2487 /* Menu options */
2488 aco_option_register(&cfg_info, "type", ACO_EXACT, menu_types, NULL, OPT_NOOP_T, 0, 0);
2489 /* This option should only be used with the CONFBRIDGE dialplan function */
2491 aco_option_register_custom(&cfg_info, "^[0-9A-D*#]+$", ACO_REGEX, menu_types, NULL, menu_option_handler, 0);
2492
2493 if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
2494 goto error;
2495 }
2496
2498 goto error;
2499 }
2500
2501 return 0;
2502error:
2504 return -1;
2505}
#define __stringify(x)
Definition: asterisk.h:216
static char regcontext[AST_MAX_CONTEXT]
Definition: chan_iax2.c:325
static char language[MAX_LANGUAGE]
Definition: chan_iax2.c:324
#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 2637 of file conf_config_parser.c.

2638{
2639 struct conf_menu_action *menu_action = NULL;
2640 while ((menu_action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {
2641 ast_free(menu_action);
2642 }
2643}
#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 1451 of file app_confbridge.c.

1452{
1453 user->playing_moh = 1;
1454 if (!user->suspended_moh) {
1455 int in_bridge;
1456
1457 /*
1458 * Locking the ast_bridge here is the only way to hold off the
1459 * call to ast_bridge_join() in confbridge_exec() from
1460 * interfering with the bridge and MOH operations here.
1461 */
1462 ast_bridge_lock(user->conference->bridge);
1463
1464 /*
1465 * Temporarily suspend the user from the bridge so we have
1466 * control to start MOH if needed.
1467 */
1468 in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
1469 ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
1470 if (in_bridge) {
1471 ast_bridge_unsuspend(user->conference->bridge, user->chan);
1472 }
1473
1474 ast_bridge_unlock(user->conference->bridge);
1475 }
1476}
#define ast_bridge_unlock(bridge)
Unlock the bridge.
Definition: bridge.h:481
int ast_bridge_suspend(struct ast_bridge *bridge, struct ast_channel *chan)
Suspend a channel temporarily from a bridge.
Definition: bridge.c:3007
int ast_bridge_unsuspend(struct ast_bridge *bridge, struct ast_channel *chan)
Unsuspend a channel from a bridge.
Definition: bridge.c:3028
#define ast_bridge_lock(bridge)
Lock the bridge.
Definition: bridge.h:470
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:7766

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

1425{
1426 user->playing_moh = 0;
1427 if (!user->suspended_moh) {
1428 int in_bridge;
1429
1430 /*
1431 * Locking the ast_bridge here is the only way to hold off the
1432 * call to ast_bridge_join() in confbridge_exec() from
1433 * interfering with the bridge and MOH operations here.
1434 */
1435 ast_bridge_lock(user->conference->bridge);
1436
1437 /*
1438 * Temporarily suspend the user from the bridge so we have
1439 * control to stop MOH if needed.
1440 */
1441 in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
1442 ast_moh_stop(user->chan);
1443 if (in_bridge) {
1444 ast_bridge_unsuspend(user->conference->bridge, user->chan);
1445 }
1446
1447 ast_bridge_unlock(user->conference->bridge);
1448 }
1449}
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
Definition: channel.c:7776

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

4518{
4520
4521 /* Turn on MOH if the single participant is set up for it */
4522 if (ast_test_flag(&only_user->u_profile, USER_OPT_MUSICONHOLD)) {
4523 conf_moh_start(only_user);
4524 }
4525 conf_update_user_mute(only_user);
4526}
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 2507 of file conf_config_parser.c.

2508{
2509 if (aco_process_config(&cfg_info, 1) == ACO_PROCESS_ERROR) {
2510 /* On a reload, just keep the config we already have in place. */
2511 return -1;
2512 }
2513 return 0;
2514}

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

4505{
4506 AST_LIST_REMOVE(&conference->active_list, user, list);
4507 conference->activeusers--;
4508}
#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 4510 of file app_confbridge.c.

4511{
4512 AST_LIST_REMOVE(&conference->active_list, user, list);
4513 conference->activeusers--;
4514 conference->markedusers--;
4515}

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

4529{
4530 AST_LIST_REMOVE(&conference->waiting_list, user, list);
4531 conference->waitingusers--;
4532}

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

416{
417 struct ast_bridge_blob *obj = stasis_message_data(msg);
418 struct ast_json *extras = obj->blob;
419 struct user_profile u_profile = {{0}};
420 int source_send_events = 0;
421 int source_echo_events = 0;
422 struct ast_json* json_channels = NULL;
423 struct confbridge_user *user;
424 const char *msg_name = confbridge_event_type_to_string(stasis_message_type(msg));
425
426 ast_debug(3, "Distributing %s event to participants\n", msg_name);
427
428 /* This could be a channel level event or a bridge level event */
429 if (chan) {
431 ast_log(LOG_ERROR, "Unable to retrieve user profile for channel '%s'\n",
433 return;
434 }
435 source_send_events = ast_test_flag(&u_profile, USER_OPT_SEND_EVENTS);
436 source_echo_events = ast_test_flag(&u_profile, USER_OPT_ECHO_EVENTS);
437 ast_debug(3, "send_events: %d echo_events: %d for profile %s\n",
438 source_send_events, source_echo_events, u_profile.name);
439 }
440
441 /* Now send a message to the participants with the json string. */
444 struct ast_json *json_object;
445
446 /*
447 * If the msg type is join, we need to capture all targets channel info so we can
448 * send a welcome message to the source channel with all current participants.
449 */
450 if (source_send_events && stasis_message_type(msg) == confbridge_join_type()) {
451 struct ast_channel_snapshot *target_snapshot;
452 struct ast_json *target_json_channel;
453
455 if (!target_snapshot) {
456 ast_log(LOG_ERROR, "Unable to get a channel snapshot for '%s'\n",
457 ast_channel_name(user->chan));
458 continue;
459 }
460
461 target_json_channel = channel_to_json(target_snapshot, extras, NULL);
462 ao2_ref(target_snapshot, -1);
463
464 if (!json_channels) {
465 json_channels = ast_json_array_create();
466 if (!json_channels) {
467 ast_log(LOG_ERROR, "Unable to allocate json array\n");
468 ast_json_unref(target_json_channel);
469 return;
470 }
471 }
472
473 ast_json_array_append(json_channels, target_json_channel);
474 }
475
476 /* Don't send a message to the user that triggered the event. */
477 if (!source_echo_events && user->chan == chan) {
478 ast_debug(3, "Skipping queueing %s message to '%s'. Same channel.\n", msg_name,
479 ast_channel_name(user->chan));
480 continue;
481 }
482
483 /* Don't send a message to users in profiles not sending events. */
484 if (!ast_test_flag(&user->u_profile, USER_OPT_SEND_EVENTS)) {
485 ast_debug(3, "Skipping queueing %s message to '%s'. Not receiving events.\n", msg_name,
486 ast_channel_name(user->chan));
487 continue;
488 }
489
490 json_object = pack_snapshots(obj->bridge, obj->channel, extras, NULL, msg);
491
492 if (!json_object) {
493 ast_log(LOG_ERROR, "Unable to convert %s message to json\n", msg_name);
494 continue;
495 }
496
497 send_message(msg_name, conference->name, json_object, user->chan);
498 ast_json_unref(json_object);
499 }
500 ao2_unlock(conference);
501
502 /*
503 * If this is a join event, send the welcome message to just the joining user
504 * if it's not audio-only or otherwise restricted.
505 */
506 if (source_send_events && json_channels
508 struct ast_json *json_object;
509 struct ast_json *json_bridge;
510 const char *welcome_msg_name = confbridge_event_type_to_string(confbridge_welcome_type());
511
512 json_bridge = bridge_to_json(obj->bridge);
513 json_object = pack_bridge_and_channels(json_bridge, json_channels, msg);
514 if (!json_object) {
515 ast_log(LOG_ERROR, "Unable to convert ConfbridgeWelcome message to json\n");
516 return;
517 }
518 ast_json_string_set(ast_json_object_get(json_object, "type"), welcome_msg_name);
519
520 send_message(welcome_msg_name, conference->name, json_object, chan);
521 ast_json_unref(json_object);
522 }
523}
#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 2691 of file conf_config_parser.c.

2692{
2694 RAII_VAR(struct conf_menu *, menu, NULL, ao2_cleanup);
2695
2696 if (chan && ast_strlen_zero(menu_profile_name)) {
2697 struct ast_datastore *datastore;
2698 struct func_confbridge_data *b_data;
2699
2700 ast_channel_lock(chan);
2702 ast_channel_unlock(chan);
2703 if (datastore) {
2704 /* If a menu exists in the CONFBRIDGE function datastore, use it. */
2705 b_data = datastore->data;
2706 if (b_data->m_usable) {
2707 menu = ao2_bump(b_data->menu);
2708 return apply_menu_to_user(user, menu);
2709 }
2710 }
2711 }
2712
2713 /* Otherwise, we need to get whatever menu profile is specified to use (or default). */
2714 if (!cfg) {
2715 return -1;
2716 }
2717
2718 if (ast_strlen_zero(menu_profile_name)) {
2719 menu_profile_name = DEFAULT_MENU_PROFILE;
2720 }
2721
2722 if (!(menu = ao2_find(cfg->menus, menu_profile_name, OBJ_KEY))) {
2723 return -1;
2724 }
2725
2726 return apply_menu_to_user(user, menu);
2727}
#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 1366 of file app_confbridge.c.

1367{
1368 int mute_user;
1369 int mute_system;
1370 int mute_effective;
1371
1372 /* User level mute request. */
1373 mute_user = user->muted;
1374
1375 /* System level mute request. */
1376 mute_system = user->playing_moh
1377 /*
1378 * Do not allow waitmarked users to talk to anyone unless there
1379 * is a marked user present.
1380 */
1381 || (!user->conference->markedusers
1382 && ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED));
1383
1384 mute_effective = mute_user || mute_system;
1385
1386 ast_debug(1, "User %s is %s: user:%d system:%d.\n",
1387 ast_channel_name(user->chan), mute_effective ? "muted" : "unmuted",
1388 mute_user, mute_system);
1389 user->features.mute = mute_effective;
1390 ast_test_suite_event_notify("CONF_MUTE_UPDATE",
1391 "Mode: %s\r\n"
1392 "Conference: %s\r\n"
1393 "Channel: %s",
1394 mute_effective ? "muted" : "unmuted",
1395 user->conference->b_profile.name,
1396 ast_channel_name(user->chan));
1397}
#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 249 of file confbridge_manager.c.

250{
251 if (event_type == confbridge_start_type()) {
252 return "ConfbridgeStart";
253 } else if (event_type == confbridge_end_type()) {
254 return "ConfbridgeEnd";
255 } else if (event_type == confbridge_join_type()) {
256 return "ConfbridgeJoin";
257 } else if (event_type == confbridge_leave_type()) {
258 return "ConfbridgeLeave";
259 } else if (event_type == confbridge_start_record_type()) {
260 return "ConfbridgeRecord";
261 } else if (event_type == confbridge_stop_record_type()) {
262 return "ConfbridgeStopRecord";
263 } else if (event_type == confbridge_mute_type()) {
264 return "ConfbridgeMute";
265 } else if (event_type == confbridge_unmute_type()) {
266 return "ConfbridgeUnmute";
267 } else if (event_type == confbridge_talking_type()) {
268 return "ConfbridgeTalking";
269 } else if (event_type == confbridge_welcome_type()) {
270 return "ConfbridgeWelcome";
271 } else {
272 return "unknown";
273 }
274}
struct stasis_message_type * confbridge_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_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 1649 of file app_confbridge.c.

1650{
1651 struct ast_channel_snapshot *old_snapshot;
1652 struct ast_channel_snapshot *new_snapshot;
1653 char *confbr_name = NULL;
1654 char *comma;
1656 struct confbridge_user *user = NULL;
1657 int found_user = 0;
1658 struct ast_json *json_object;
1659
1661 && strcmp(msg->to_transferee.channel_snapshot->dialplan->appl, "ConfBridge") == 0
1662 && msg->target) {
1663 /* We're transferring a bridge to an extension */
1664 old_snapshot = msg->to_transferee.channel_snapshot;
1665 new_snapshot = msg->target;
1666 } else if (msg->to_transfer_target.channel_snapshot
1667 && strcmp(msg->to_transfer_target.channel_snapshot->dialplan->appl, "ConfBridge") == 0
1668 && msg->transferee) {
1669 /* We're transferring a call to a bridge */
1670 old_snapshot = msg->to_transfer_target.channel_snapshot;
1671 new_snapshot = msg->transferee;
1672 } else {
1673 ast_log(LOG_ERROR, "Could not determine proper channels\n");
1674 return;
1675 }
1676
1677 /*
1678 * old_snapshot->data should have the original parameters passed to
1679 * the ConfBridge app:
1680 * conference[,bridge_profile[,user_profile[,menu]]]
1681 * We'll use "conference" to look up the bridge.
1682 *
1683 * We _could_ use old_snapshot->bridgeid to get the bridge but
1684 * that would involve locking the conference_bridges container
1685 * and iterating over it looking for a matching bridge.
1686 */
1687 if (ast_strlen_zero(old_snapshot->dialplan->data)) {
1688 ast_log(LOG_ERROR, "Channel '%s' didn't have app data set\n", old_snapshot->base->name);
1689 return;
1690 }
1691 confbr_name = ast_strdupa(old_snapshot->dialplan->data);
1692 comma = strchr(confbr_name, ',');
1693 if (comma) {
1694 *comma = '\0';
1695 }
1696
1697 ast_debug(1, "Confbr: %s Leaving: %s Joining: %s\n", confbr_name, old_snapshot->base->name, new_snapshot->base->name);
1698
1699 conference = ao2_find(conference_bridges, confbr_name, OBJ_SEARCH_KEY);
1700 if (!conference) {
1701 ast_log(LOG_ERROR, "Conference bridge '%s' not found\n", confbr_name);
1702 return;
1703 }
1704 ao2_lock(conference);
1705
1706 /*
1707 * We need to grab the user profile for the departing user in order to
1708 * properly format the join/leave messages.
1709 */
1710 AST_LIST_TRAVERSE(&conference->active_list, user, list) {
1711 if (strcasecmp(ast_channel_name(user->chan), old_snapshot->base->name) == 0) {
1712 found_user = 1;
1713 break;
1714 }
1715 }
1716
1717 /*
1718 * If we didn't find the user in the active list, try the waiting list.
1719 */
1720 if (!found_user && conference->waitingusers) {
1721 AST_LIST_TRAVERSE(&conference->waiting_list, user, list) {
1722 if (strcasecmp(ast_channel_name(user->chan), old_snapshot->base->name) == 0) {
1723 found_user = 1;
1724 break;
1725 }
1726 }
1727 }
1728
1729 if (!found_user) {
1730 ast_log(LOG_ERROR, "Unable to find user profile for channel '%s' in bridge '%s'\n",
1731 old_snapshot->base->name, confbr_name);
1732 return;
1733 }
1734
1735 /*
1736 * We're going to use the existing user profile to create the messages.
1737 */
1738 json_object = ast_json_pack("{s: b}",
1739 "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN)
1740 );
1741 if (!json_object) {
1742 return;
1743 }
1744
1745 send_conf_stasis_snapshots(conference, old_snapshot, confbridge_leave_type(), json_object);
1746 ast_json_unref(json_object);
1747
1748 json_object = ast_json_pack("{s: b, s: b}",
1749 "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN),
1750 "muted", user->muted);
1751 if (!json_object) {
1752 return;
1753 }
1754 send_conf_stasis_snapshots(conference, new_snapshot, confbridge_join_type(), json_object);
1755 ast_json_unref(json_object);
1756}
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 1121 of file conf_config_parser.c.

1122{
1123 struct ast_datastore *datastore;
1124 struct func_confbridge_data *b_data;
1125 char *parse;
1126 struct ast_variable tmpvar = { 0, };
1127 struct ast_variable template = {
1128 .name = "template",
1129 .file = "CONFBRIDGE"
1130 };
1133 AST_APP_ARG(option);
1134 );
1135
1136 if (!chan) {
1137 ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
1138 return -1;
1139 }
1140
1141 /* parse all the required arguments and make sure they exist. */
1142 if (ast_strlen_zero(data)) {
1143 return -1;
1144 }
1145 parse = ast_strdupa(data);
1147 if (ast_strlen_zero(args.type) || ast_strlen_zero(args.option)) {
1148 return -1;
1149 }
1150
1151 ast_channel_lock(chan);
1153 if (!datastore) {
1155 if (!datastore) {
1156 ast_channel_unlock(chan);
1157 return 0;
1158 }
1159 b_data = ast_calloc(1, sizeof(*b_data));
1160 if (!b_data) {
1161 ast_channel_unlock(chan);
1162 ast_datastore_free(datastore);
1163 return 0;
1164 }
1165 datastore->data = b_data;
1167 if (!b_data->b_profile.sounds) {
1168 ast_channel_unlock(chan);
1169 ast_datastore_free(datastore);
1170 return 0;
1171 }
1172 if (!(b_data->menu = menu_alloc("dialplan"))) {
1173 ast_channel_unlock(chan);
1174 ast_datastore_free(datastore);
1175 return 0;
1176 }
1177 ast_channel_datastore_add(chan, datastore);
1178 } else {
1179 b_data = datastore->data;
1180 }
1181 ast_channel_unlock(chan);
1182
1183 /* SET(CONFBRIDGE(type,option)=value) */
1184 if (!value) {
1185 value = "";
1186 }
1187 tmpvar.name = args.option;
1188 tmpvar.value = value;
1189 tmpvar.file = "CONFBRIDGE";
1190 if (!strcasecmp(args.type, "bridge")) {
1191 if (!strcasecmp(args.option, "clear")) {
1192 b_data->b_usable = 0;
1194 memset(&b_data->b_profile, 0, sizeof(b_data->b_profile)) ;
1195 if (!(b_data->b_profile.sounds = bridge_profile_sounds_alloc())) {
1196 /* If this reallocation fails, the datastore has become unusable and must be destroyed. */
1197 ast_channel_lock(chan);
1198 ast_channel_datastore_remove(chan, datastore);
1199 ast_channel_unlock(chan);
1200 ast_datastore_free(datastore);
1201 }
1202 return 0;
1203 }
1204
1205 if (b_data && !b_data->b_usable && strcasecmp(args.option, "template")) {
1206 template.value = DEFAULT_BRIDGE_PROFILE;
1207 aco_process_var(&bridge_type, "dialplan", &template, &b_data->b_profile);
1208 }
1209
1210 if (!aco_process_var(&bridge_type, "dialplan", &tmpvar, &b_data->b_profile)) {
1211 b_data->b_usable = 1;
1212 return 0;
1213 }
1214 } else if (!strcasecmp(args.type, "user")) {
1215 if (!strcasecmp(args.option, "clear")) {
1216 b_data->u_usable = 0;
1218 memset(&b_data->u_profile, 0, sizeof(b_data->u_profile));
1219 return 0;
1220 }
1221
1222 if (b_data && !b_data->u_usable && strcasecmp(args.option, "template")) {
1223 template.value = DEFAULT_USER_PROFILE;
1224 aco_process_var(&user_type, "dialplan", &template, &b_data->u_profile);
1225 }
1226
1227 if (!aco_process_var(&user_type, "dialplan", &tmpvar, &b_data->u_profile)) {
1228 b_data->u_usable = 1;
1229 return 0;
1230 }
1231 } else if (!strcasecmp(args.type, "menu")) {
1232 if (!strcasecmp(args.option, "clear")) {
1233 b_data->m_usable = 0;
1234 ao2_cleanup(b_data->menu);
1235 if (!(b_data->menu = menu_alloc("dialplan"))) {
1236 /* If this reallocation fails, the datastore has become unusable and must be destroyed */
1237 ast_channel_lock(chan);
1238 ast_channel_datastore_remove(chan, datastore);
1239 ast_channel_unlock(chan);
1240 ast_datastore_free(datastore);
1241 }
1242 return 0;
1243 }
1244
1245 if (b_data && !b_data->m_usable && strcasecmp(args.option, "template")) {
1246 template.value = DEFAULT_MENU_PROFILE;
1247 aco_process_var(&menu_type, "dialplan", &template, &b_data->menu);
1248 }
1249
1250 if (!aco_process_var(&menu_type, "dialplan", &tmpvar, b_data->menu)) {
1251 b_data->m_usable = 1;
1252 return 0;
1253 }
1254 }
1255
1256 ast_log(LOG_WARNING, "%s(%s,%s) cannot be set to '%s'. Invalid type, option, or value.\n",
1257 cmd, args.type, args.option, value);
1258 return -1;
1259}
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:2385
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
Definition: channel.c:2394
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 721 of file confbridge_manager.c.

722{
733
736
737 if (!bridge_state_router) {
738 return -1;
739 }
740
744 NULL)) {
746 return -1;
747 }
751 NULL)) {
753 return -1;
754 }
758 NULL)) {
760 return -1;
761 }
765 NULL)) {
767 return -1;
768 }
772 NULL)) {
774 return -1;
775 }
779 NULL)) {
781 return -1;
782 }
786 NULL)) {
788 return -1;
789 }
793 NULL)) {
795 return -1;
796 }
800 NULL)) {
802 return -1;
803 }
807 NULL)) {
809 return -1;
810 }
811
814
817 return -1;
818 }
819
823 NULL)) {
825 return -1;
826 }
830 NULL)) {
832 return -1;
833 }
837 NULL)) {
839 return -1;
840 }
844 NULL)) {
846 return -1;
847 }
851 NULL)) {
853 return -1;
854 }
858 NULL)) {
860 return -1;
861 }
865 NULL)) {
867 return -1;
868 }
872 NULL)) {
874 return -1;
875 }
879 NULL)) {
881 return -1;
882 }
883
884 /* FYI: confbridge_welcome_type is never routed */
885
886 return 0;
887}
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 698 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 2124 of file app_confbridge.c.

2125{
2126 return play_sound_helper(conference, filename, -1);
2127}
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