Asterisk - The Open Source Telephony Project GIT-master-545c459
Loading...
Searching...
No Matches
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) ,
  BRIDGE_OPT_ANNOUNCEMENTS = (1 << 16)
}
 
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.
 
void async_play_sound_ready (struct ast_channel *chan)
 Indicate the initiator of an async sound file is ready for it to play.
 
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.
 
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.
 
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.
 
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.
 
int conf_announce_channel_push (struct ast_channel *ast)
 Push the announcer channel into the conference.
 
struct ast_channel_techconf_announce_get_tech (void)
 Get ConfBridge announce channel technology struct.
 
void conf_bridge_profile_copy (struct bridge_profile *dst, struct bridge_profile *src)
 copies a bridge profile
 
void conf_bridge_profile_destroy (struct bridge_profile *b_profile)
 Destroy a bridge profile found by 'conf_find_bridge_profile'.
 
void conf_destroy_config (void)
 destroy the information loaded from the confbridge.conf file
 
void conf_ended (struct confbridge_conference *conference)
 Callback to be called when the conference has become empty.
 
struct confbridge_conferenceconf_find_bridge (const char *conference_name)
 Find a confbridge by name.
 
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.
 
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.
 
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.
 
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.
 
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.
 
void conf_handle_first_join (struct confbridge_conference *conference)
 Callback to execute any time we transition from zero to one active users.
 
int conf_handle_inactive_waitmarked (struct confbridge_user *user)
 Handle actions every time a waitmarked user joins w/o a marked user present.
 
int conf_handle_only_person (struct confbridge_user *user)
 Handle actions whenever an user joins an empty conference.
 
void conf_handle_second_active (struct confbridge_conference *conference)
 Handle when a conference moves to having more than one active participant.
 
int conf_load_config (void)
 load confbridge.conf file
 
void conf_menu_entry_destroy (struct conf_menu_entry *menu_entry)
 Destroys and frees all the actions stored in a menu_entry structure.
 
void conf_moh_start (struct confbridge_user *user)
 Start MOH for the conference user.
 
void conf_moh_stop (struct confbridge_user *user)
 Stop MOH for the conference user.
 
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.
 
struct ast_channel_techconf_record_get_tech (void)
 Get ConfBridge record channel technology struct.
 
int conf_reload_config (void)
 reload confbridge.conf file
 
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.
 
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.
 
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.
 
void conf_send_event_to_participants (struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message *msg)
 Send events to bridge participants.
 
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.
 
void conf_update_user_mute (struct confbridge_user *user)
 Update the actual mute status of the user and set it on the bridge.
 
struct stasis_message_typeconfbridge_end_type (void)
 get the confbridge end 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.
 
void confbridge_handle_atxfer (struct ast_attended_transfer_message *msg)
 Create join/leave events for attended transfers.
 
struct stasis_message_typeconfbridge_join_type (void)
 get the confbridge join stasis message type
 
struct stasis_message_typeconfbridge_leave_type (void)
 get the confbridge leave stasis message type
 
struct stasis_message_typeconfbridge_mute_type (void)
 get the confbridge mute stasis message type
 
struct stasis_message_typeconfbridge_start_record_type (void)
 get the confbridge start_record stasis message type
 
struct stasis_message_typeconfbridge_start_type (void)
 get the confbridge start stasis message type
 
struct stasis_message_typeconfbridge_stop_record_type (void)
 get the confbridge stop_record stasis message type
 
struct stasis_message_typeconfbridge_talking_type (void)
 get the confbridge talking stasis message type
 
struct stasis_message_typeconfbridge_unmute_type (void)
 get the confbridge unmute stasis message type
 
struct stasis_message_typeconfbridge_welcome_type (void)
 get the confbridge welcome stasis message type
 
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
 
void manager_confbridge_shutdown (void)
 unregister stasis message routers to handle manager events for confbridge messages
 
int play_sound_file (struct confbridge_conference *conference, const char *filename)
 Play sound file into conference bridge.
 

Variables

struct ao2_containerconference_bridges
 Container to hold all conference bridges in progress.
 

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 specified in remb_estimated_bitrate

BRIDGE_OPT_ANNOUNCEMENTS 

Set if the conference should have an announcer channel to play announcements to the conference as a whole

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 specified in remb_estimated_bitrate */
94 BRIDGE_OPT_ANNOUNCEMENTS = (1 << 16), /*!< Set if the conference should have an announcer channel to play announcements to the conference as a whole */
95};
@ BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE
Definition confbridge.h:86
@ BRIDGE_OPT_ANNOUNCEMENTS
Definition confbridge.h:94
@ 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 97 of file confbridge.h.

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

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

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

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

2445{
2446 return async_play_sound_helper(conference, filename, -1, initiator);
2447}
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 2449 of file app_confbridge.c.

2450{
2451 struct ast_datastore *async_datastore;
2452 struct async_datastore_data *add;
2453
2454 ast_channel_lock(chan);
2455 async_datastore = ast_channel_datastore_find(chan, &async_datastore_info, NULL);
2456 ast_channel_unlock(chan);
2457 if (!async_datastore) {
2458 return;
2459 }
2460
2461 add = async_datastore->data;
2462
2463 ast_mutex_lock(&add->lock);
2464 add->wait = 0;
2465 ast_cond_signal(&add->cond);
2466 ast_mutex_unlock(&add->lock);
2467}
static struct ast_datastore_info async_datastore_info
Datastore used for timing of async announcement playback.
#define ast_channel_lock(chan)
Definition channel.h:2983
#define ast_channel_unlock(chan)
Definition channel.h:2984
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition channel.c:2390
#define ast_mutex_unlock(a)
Definition lock.h:197
#define ast_mutex_lock(a)
Definition lock.h:196
#define ast_cond_signal(cond)
Definition lock.h:210
#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 1585 of file app_confbridge.c.

1586{
1587 struct post_join_action *action;
1588 if (!(action = ast_calloc(1, sizeof(*action)))) {
1589 return -1;
1590 }
1591 action->func = func;
1592 AST_LIST_INSERT_TAIL(&user->post_join_list, action, list);
1593 return 0;
1594}
#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.
int(* func)(struct confbridge_user *user)
Definition confbridge.h:269
struct post_join_action::@96 list
structure to hold users read from phoneprov_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(), 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 4567 of file app_confbridge.c.

4568{
4569 AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4570 conference->activeusers++;
4571}
unsigned int activeusers
Definition confbridge.h:252
struct confbridge_conference::@94 active_list

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

Referenced by join_active(), join_active(), join_unmarked(), join_unmarked(), join_unmarked(), 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 4573 of file app_confbridge.c.

4574{
4575 AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
4576 conference->activeusers++;
4577 conference->markedusers++;
4578}
unsigned int markedusers
Definition confbridge.h:253

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

Referenced by join_marked(), join_marked(), join_marked(), join_marked(), join_marked(), and 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 4580 of file app_confbridge.c.

4581{
4582 AST_LIST_INSERT_TAIL(&conference->waiting_list, user, list);
4583 conference->waitingusers++;
4584}
unsigned int waitingusers
Definition confbridge.h:254
struct confbridge_conference::@95 waiting_list

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

Referenced by conf_default_join_waitmarked().

◆ conf_announce_channel_push()

int conf_announce_channel_push ( struct ast_channel ast)

Push the announcer channel into the conference.

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

Definition at line 144 of file conf_chan_announce.c.

145{
146 struct ast_bridge_features *features;
147 struct ast_channel *chan;
148 RAII_VAR(struct announce_pvt *, p, NULL, ao2_cleanup);
149
150 {
152
153 p = ast_channel_tech_pvt(ast);
154 if (!p) {
155 return -1;
156 }
157 ao2_ref(p, +1);
158 chan = p->base.chan;
159 if (!chan) {
160 return -1;
161 }
162 }
163
164 features = ast_bridge_features_new();
165 if (!features) {
166 return -1;
167 }
169
170 /* Impart the output channel into the bridge */
171 if (ast_bridge_impart(p->bridge, chan, NULL, features,
173 return -1;
174 }
175 ao2_lock(p);
177 ao2_unlock(p);
178 return 0;
179}
ast_mutex_t lock
Definition app_sla.c:337
#define ao2_cleanup(obj)
Definition astobj2.h:1934
#define ao2_unlock(a)
Definition astobj2.h:729
#define ao2_lock(a)
Definition astobj2.h:717
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition astobj2.h:459
int ast_bridge_impart(struct ast_bridge *bridge, struct ast_channel *chan, struct ast_channel *swap, struct ast_bridge_features *features, enum ast_bridge_impart_flags flags) attribute_warn_unused_result
Impart a channel to a bridge (non-blocking)
Definition bridge.c:2077
@ AST_BRIDGE_IMPART_CHAN_INDEPENDENT
Definition bridge.h:600
struct ast_bridge_features * ast_bridge_features_new(void)
Allocate a new bridge features struct.
Definition bridge.c:3892
@ AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define AST_UNREAL_CARETAKER_THREAD
#define SCOPED_CHANNELLOCK(varname, chan)
scoped lock specialization for channels.
Definition lock.h:626
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:981
#define ast_set_flag(p, flag)
Definition utils.h:71

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

2787{
2788 *dst = *src;
2789 if (src->sounds) {
2790 ao2_ref(src->sounds, +1);
2791 }
2792}
struct bridge_profile_sounds * sounds
Definition confbridge.h:239

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

2795{
2796 if (b_profile->sounds) {
2797 ao2_ref(b_profile->sounds, -1);
2798 b_profile->sounds = NULL;
2799 }
2800}

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

2958{
2960 aco_info_destroy(&cfg_info);
2962}
void ast_cli_unregister_multiple(void)
Definition ael_main.c:408
#define ao2_global_obj_release(holder)
Release the ao2 object held in the global holder.
Definition astobj2.h:859
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
#define ARRAY_LEN(a)
Definition utils.h:706

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

1614{
1615 struct pbx_find_info q = { .stacklen = 0 };
1616
1617 /* Called with a reference to conference */
1618 ao2_unlink(conference_bridges, conference);
1619 send_conf_end_event(conference);
1620 if (!ast_strlen_zero(conference->b_profile.regcontext) &&
1622 conference->name, 1, NULL, "", E_MATCH)) {
1624 conference->name, 1, NULL);
1625 }
1626 ao2_lock(conference);
1627 conf_stop_record(conference);
1628 ao2_unlock(conference);
1629}
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:3508
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:240
char name[MAX_CONF_NAME]
Definition confbridge.h:248
struct bridge_profile b_profile
Definition confbridge.h:251

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

Referenced by transition_to_empty().

◆ conf_find_bridge()

struct confbridge_conference * conf_find_bridge ( const char *  conference_name)

Find a confbridge by name.

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

Definition at line 922 of file app_confbridge.c.

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

References ao2_find, conference_bridges, and OBJ_KEY.

Referenced by confbridge_publish_manager_event().

◆ conf_find_bridge_profile()

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

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

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

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

Return values
bridgeprofile on success
NULLon failure

Definition at line 2802 of file conf_config_parser.c.

2803{
2804 struct bridge_profile *tmp2;
2805 struct ast_datastore *datastore = NULL;
2806 struct func_confbridge_data *b_data = NULL;
2808
2809 if (chan && ast_strlen_zero(bridge_profile_name)) {
2810 ast_channel_lock(chan);
2812 ast_channel_unlock(chan);
2813 if (datastore) {
2814 b_data = datastore->data;
2815 if (b_data->b_usable) {
2817 return result;
2818 }
2819 }
2820 }
2821
2822 if (!cfg) {
2823 return NULL;
2824 }
2825 if (ast_strlen_zero(bridge_profile_name)) {
2826 bridge_profile_name = DEFAULT_BRIDGE_PROFILE;
2827 }
2828 if (!(tmp2 = ao2_find(cfg->bridge_profiles, bridge_profile_name, OBJ_KEY))) {
2829 return NULL;
2830 }
2831 ao2_lock(tmp2);
2833 ao2_unlock(tmp2);
2834 ao2_ref(tmp2, -1);
2835
2836 return result;
2837}
#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 2873 of file conf_config_parser.c.

2874{
2875 struct conf_menu_entry *menu_entry = NULL;
2876
2877 ao2_lock(menu);
2878 AST_LIST_TRAVERSE(&menu->entries, menu_entry, entry) {
2879 if (!strcasecmp(menu_entry->dtmf, dtmf_sequence)) {
2880 copy_menu_entry(result, menu_entry);
2881 ao2_unlock(menu);
2882 return 1;
2883 }
2884 }
2885 ao2_unlock(menu);
2886
2887 return 0;
2888}
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 confbridge.h:139
char dtmf[MAXIMUM_DTMF_FEATURE_STRING]
Definition confbridge.h:141
struct conf_menu_entry::@92 entry
struct conf_menu::@93 entries

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

Referenced by action_playback_and_continue().

◆ conf_find_user_profile()

const struct user_profile * conf_find_user_profile ( struct ast_channel chan,
const char *  user_profile_name,
struct user_profile result 
)

find a user profile given a user profile's name and store that profile in result structure.

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

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

Return values
userprofile on success
NULLon failure

Definition at line 2749 of file conf_config_parser.c.

2750{
2751 struct user_profile *tmp2;
2752 struct ast_datastore *datastore = NULL;
2753 struct func_confbridge_data *b_data = NULL;
2755
2756 if (chan && ast_strlen_zero(user_profile_name)) {
2757 ast_channel_lock(chan);
2759 ast_channel_unlock(chan);
2760 if (datastore) {
2761 b_data = datastore->data;
2762 if (b_data->u_usable) {
2764 return result;
2765 }
2766 }
2767 }
2768
2769 if (!cfg) {
2770 return NULL;
2771 }
2772 if (ast_strlen_zero(user_profile_name)) {
2773 user_profile_name = DEFAULT_USER_PROFILE;
2774 }
2775 if (!(tmp2 = ao2_find(cfg->user_profiles, user_profile_name, OBJ_KEY))) {
2776 return NULL;
2777 }
2778 ao2_lock(tmp2);
2780 ao2_unlock(tmp2);
2781 ao2_ref(tmp2, -1);
2782
2783 return result;
2784}
static void conf_user_profile_copy(struct user_profile *dst, struct user_profile *src)
#define DEFAULT_USER_PROFILE
Definition confbridge.h:41
struct user_profile u_profile

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

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

◆ conf_get_sound()

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

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

Definition at line 661 of file app_confbridge.c.

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

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

3396{
3397 /* See if music on hold is playing */
3399
3400 /* execute the list of actions associated with this menu entry */
3401 execute_menu_entry(user->conference, user, bridge_channel, menu_entry, menu);
3402
3403 /* See if music on hold needs to be started back up again */
3405
3406 async_play_sound_ready(bridge_channel->chan);
3407
3408 return 0;
3409}
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 1597 of file app_confbridge.c.

1598{
1599 ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", conference->name);
1600}
@ 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.
@ 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 1561 of file app_confbridge.c.

1562{
1563 /* If we have not been quieted play back that they are waiting for the leader */
1565 conf_get_sound(CONF_SOUND_WAIT_FOR_LEADER, user->conference->b_profile.sounds))) {
1566 /* user hungup while the sound was playing */
1567 return -1;
1568 }
1569 return 0;
1570}
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:64

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

1573{
1574 /* If audio prompts have not been quieted or this prompt quieted play it on out */
1577 conf_get_sound(CONF_SOUND_ONLY_PERSON, user->conference->b_profile.sounds))) {
1578 /* user hungup while the sound was playing */
1579 return -1;
1580 }
1581 }
1582 return 0;
1583}

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(), join_unmarked(), 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 1602 of file app_confbridge.c.

1603{
1604 /* If we are the second participant we may need to stop music on hold on the first */
1605 struct confbridge_user *first_user = AST_LIST_FIRST(&conference->active_list);
1606
1607 if (ast_test_flag(&first_user->u_profile, USER_OPT_MUSICONHOLD)) {
1608 conf_moh_stop(first_user);
1609 }
1610 conf_update_user_mute(first_user);
1611}
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.
The structure that represents a conference bridge user.
Definition confbridge.h:274
struct confbridge_conference * conference
Definition confbridge.h:275
struct user_profile u_profile
Definition confbridge.h:277

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(), join_marked(), and join_unmarked().

◆ conf_load_config()

int conf_load_config ( void  )

load confbridge.conf file

Definition at line 2645 of file conf_config_parser.c.

2646{
2647 if (aco_info_init(&cfg_info)) {
2648 return -1;
2649 }
2650
2651 /* User options */
2652 aco_option_register(&cfg_info, "type", ACO_EXACT, user_types, NULL, OPT_NOOP_T, 0, 0);
2653 aco_option_register(&cfg_info, "admin", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ADMIN);
2654 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);
2655 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);
2656 aco_option_register(&cfg_info, "marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MARKEDUSER);
2657 aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);
2658 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);
2659 aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);
2660 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);
2661 aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);
2662 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);
2663 /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */
2664 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);
2665 aco_option_register(&cfg_info, "wait_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_WAITMARKED);
2666 aco_option_register(&cfg_info, "end_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKED);
2667 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);
2668 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);
2669 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);
2670 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);
2671 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);
2673 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));
2674 aco_option_register(&cfg_info, "announcement", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, announcement));
2675 aco_option_register(&cfg_info, "denoise", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DENOISE);
2676 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);
2677 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));
2678 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));
2679 aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);
2680 aco_option_register(&cfg_info, "timeout", ACO_EXACT, user_types, "0", OPT_UINT_T, 0, FLDSET(struct user_profile, timeout));
2681 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);
2682 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);
2683
2684 /* This option should only be used with the CONFBRIDGE dialplan function */
2686
2687/* XXX ASTERISK-21271 need a user supplied bridge merge_priority to merge ConfBridges (default = 1, range 1-INT_MAX) */
2688 /* Bridge options */
2689 aco_option_register(&cfg_info, "type", ACO_EXACT, bridge_types, NULL, OPT_NOOP_T, 0, 0);
2690 aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), USER_OPT_JITTERBUFFER);
2691 aco_option_register_custom(&cfg_info, "internal_sample_rate", ACO_EXACT, bridge_types, "auto", sample_rate_handler, 0);
2692 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);
2693 aco_option_register_custom(&cfg_info, "maximum_sample_rate", ACO_EXACT, bridge_types, "none", sample_rate_handler, 0);
2694 aco_option_register_custom(&cfg_info, "mixing_interval", ACO_EXACT, bridge_types, "20", mix_interval_handler, 0);
2695 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);
2697 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);
2698 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);
2699 aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
2700 aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
2701 aco_option_register(&cfg_info, "record_options", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_options));
2702 aco_option_register(&cfg_info, "record_command", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_command));
2706 aco_option_register(&cfg_info, "video_update_discard", ACO_EXACT, bridge_types, "2000", OPT_UINT_T, 0, FLDSET(struct bridge_profile, video_update_discard));
2707 aco_option_register(&cfg_info, "remb_send_interval", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_send_interval));
2708 aco_option_register_custom(&cfg_info, "remb_behavior", ACO_EXACT, bridge_types, "average", remb_behavior_handler, 0);
2709 aco_option_register(&cfg_info, "remb_estimated_bitrate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, remb_estimated_bitrate));
2710 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);
2711 aco_option_register(&cfg_info, "announcements", ACO_EXACT, bridge_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_ANNOUNCEMENTS);
2712 /* This option should only be used with the CONFBRIDGE dialplan function */
2714
2715 /* Menu options */
2716 aco_option_register(&cfg_info, "type", ACO_EXACT, menu_types, NULL, OPT_NOOP_T, 0, 0);
2717 /* This option should only be used with the CONFBRIDGE dialplan function */
2719 aco_option_register_custom(&cfg_info, "^[0-9A-D*#]+$", ACO_REGEX, menu_types, NULL, menu_option_handler, 0);
2720
2721 if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
2722 goto error;
2723 }
2724
2726 goto error;
2727 }
2728
2729 return 0;
2730error:
2732 return -1;
2733}
#define __stringify(x)
Definition asterisk.h:216
static char regcontext[AST_MAX_CONTEXT]
Definition chan_iax2.c:362
static char language[MAX_LANGUAGE]
Definition chan_iax2.c:361
#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,...)

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_ANNOUNCEMENTS, 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 2865 of file conf_config_parser.c.

2866{
2867 struct conf_menu_action *menu_action = NULL;
2868 while ((menu_action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {
2869 ast_free(menu_action);
2870 }
2871}
#define ast_free(a)
Definition astmm.h:180
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
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 1504 of file app_confbridge.c.

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

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

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

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

4600{
4602
4603 /* Turn on MOH if the single participant is set up for it */
4604 if (ast_test_flag(&only_user->u_profile, USER_OPT_MUSICONHOLD)) {
4605 conf_moh_start(only_user);
4606 }
4607 conf_update_user_mute(only_user);
4608}
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 2735 of file conf_config_parser.c.

2736{
2737 if (aco_process_config(&cfg_info, 1) == ACO_PROCESS_ERROR) {
2738 /* On a reload, just keep the config we already have in place. */
2739 return -1;
2740 }
2741 return 0;
2742}

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

4587{
4588 AST_LIST_REMOVE(&conference->active_list, user, list);
4589 conference->activeusers--;
4590}
#define AST_LIST_REMOVE(head, elm, field)
Removes a specific entry from a list.

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

Referenced by leave_active(), leave_unmarked(), 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 4592 of file app_confbridge.c.

4593{
4594 AST_LIST_REMOVE(&conference->active_list, user, list);
4595 conference->activeusers--;
4596 conference->markedusers--;
4597}

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

Referenced by leave_marked(), and 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 4610 of file app_confbridge.c.

4611{
4612 AST_LIST_REMOVE(&conference->waiting_list, user, list);
4613 conference->waitingusers--;
4614}

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

Referenced by conf_default_leave_waitmarked().

◆ conf_send_event_to_participants()

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

Send events to bridge participants.

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

Definition at line 453 of file confbridge_manager.c.

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

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(), confbridge_user::u_profile, 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 2919 of file conf_config_parser.c.

2920{
2922 RAII_VAR(struct conf_menu *, menu, NULL, ao2_cleanup);
2923
2924 if (chan && ast_strlen_zero(menu_profile_name)) {
2925 struct ast_datastore *datastore;
2926 struct func_confbridge_data *b_data;
2927
2928 ast_channel_lock(chan);
2930 ast_channel_unlock(chan);
2931 if (datastore) {
2932 /* If a menu exists in the CONFBRIDGE function datastore, use it. */
2933 b_data = datastore->data;
2934 if (b_data->m_usable) {
2935 menu = ao2_bump(b_data->menu);
2936 return apply_menu_to_user(user, menu);
2937 }
2938 }
2939 }
2940
2941 /* Otherwise, we need to get whatever menu profile is specified to use (or default). */
2942 if (!cfg) {
2943 return -1;
2944 }
2945
2946 if (ast_strlen_zero(menu_profile_name)) {
2947 menu_profile_name = DEFAULT_MENU_PROFILE;
2948 }
2949
2950 if (!(menu = ao2_find(cfg->menus, menu_profile_name, OBJ_KEY))) {
2951 return -1;
2952 }
2953
2954 return apply_menu_to_user(user, menu);
2955}
#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 1419 of file app_confbridge.c.

1420{
1421 int mute_user;
1422 int mute_system;
1423 int mute_effective;
1424
1425 /* User level mute request. */
1426 mute_user = user->muted;
1427
1428 /* System level mute request. */
1429 mute_system = user->playing_moh
1430 /*
1431 * Do not allow waitmarked users to talk to anyone unless there
1432 * is a marked user present.
1433 */
1434 || (!user->conference->markedusers
1435 && ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED));
1436
1437 mute_effective = mute_user || mute_system;
1438
1439 ast_debug(1, "User %s is %s: user:%d system:%d.\n",
1440 ast_channel_name(user->chan), mute_effective ? "muted" : "unmuted",
1441 mute_user, mute_system);
1442 user->features.mute = mute_effective;
1443 ast_test_suite_event_notify("CONF_MUTE_UPDATE",
1444 "Mode: %s\r\n"
1445 "Conference: %s\r\n"
1446 "Channel: %s",
1447 mute_effective ? "muted" : "unmuted",
1448 user->conference->b_profile.name,
1449 ast_channel_name(user->chan));
1450}
static const char name[]
Definition format_mp3.c:68
#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_active(), join_marked(), join_marked(), join_marked(), join_marked(), join_marked(), join_unmarked(), join_unmarked(), leave_marked(), and transition_to_marked().

◆ confbridge_end_type()

struct stasis_message_type * confbridge_end_type ( void  )

get the confbridge end stasis message type

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

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

◆ confbridge_event_type_to_string()

const char * confbridge_event_type_to_string ( struct stasis_message_type event_type)

Get the string representation of a confbridge stasis message type.

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

Definition at line 276 of file confbridge_manager.c.

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

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

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

◆ confbridge_handle_atxfer()

void confbridge_handle_atxfer ( struct ast_attended_transfer_message msg)

Create join/leave events for attended transfers.

Since
13.28
16.5
Parameters
msgThe attended transfer stasis message

Definition at line 1702 of file app_confbridge.c.

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

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

1345{
1346 struct ast_datastore *datastore;
1347 struct func_confbridge_data *b_data;
1348 char *parse;
1349 struct ast_variable tmpvar = { 0, };
1350 struct ast_variable template = {
1351 .name = "template",
1352 .file = "CONFBRIDGE"
1353 };
1356 AST_APP_ARG(option);
1357 );
1358
1359 if (!chan) {
1360 ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
1361 return -1;
1362 }
1363
1364 /* parse all the required arguments and make sure they exist. */
1365 if (ast_strlen_zero(data)) {
1366 return -1;
1367 }
1368 parse = ast_strdupa(data);
1370 if (ast_strlen_zero(args.type) || ast_strlen_zero(args.option)) {
1371 return -1;
1372 }
1373
1374 ast_channel_lock(chan);
1376 if (!datastore) {
1378 if (!datastore) {
1379 ast_channel_unlock(chan);
1380 return 0;
1381 }
1382 b_data = ast_calloc(1, sizeof(*b_data));
1383 if (!b_data) {
1384 ast_channel_unlock(chan);
1385 ast_datastore_free(datastore);
1386 return 0;
1387 }
1388 datastore->data = b_data;
1390 if (!b_data->b_profile.sounds) {
1391 ast_channel_unlock(chan);
1392 ast_datastore_free(datastore);
1393 return 0;
1394 }
1395 if (!(b_data->menu = menu_alloc("dialplan"))) {
1396 ast_channel_unlock(chan);
1397 ast_datastore_free(datastore);
1398 return 0;
1399 }
1400 ast_channel_datastore_add(chan, datastore);
1401 } else {
1402 b_data = datastore->data;
1403 }
1404 ast_channel_unlock(chan);
1405
1406 /* SET(CONFBRIDGE(type,option)=value) */
1407 if (!value) {
1408 value = "";
1409 }
1410 tmpvar.name = args.option;
1411 tmpvar.value = value;
1412 tmpvar.file = "CONFBRIDGE";
1413 if (!strcasecmp(args.type, "bridge")) {
1414 if (!strcasecmp(args.option, "clear")) {
1415 b_data->b_usable = 0;
1417 memset(&b_data->b_profile, 0, sizeof(b_data->b_profile)) ;
1418 if (!(b_data->b_profile.sounds = bridge_profile_sounds_alloc())) {
1419 /* If this reallocation fails, the datastore has become unusable and must be destroyed. */
1420 ast_channel_lock(chan);
1421 ast_channel_datastore_remove(chan, datastore);
1422 ast_channel_unlock(chan);
1423 ast_datastore_free(datastore);
1424 }
1425 return 0;
1426 }
1427
1428 if (b_data && !b_data->b_usable && strcasecmp(args.option, "template")) {
1429 template.value = DEFAULT_BRIDGE_PROFILE;
1430 aco_process_var(&bridge_type, "dialplan", &template, &b_data->b_profile);
1431 }
1432
1433 if (!aco_process_var(&bridge_type, "dialplan", &tmpvar, &b_data->b_profile)) {
1434 b_data->b_usable = 1;
1435 return 0;
1436 }
1437 } else if (!strcasecmp(args.type, "user")) {
1438 if (!strcasecmp(args.option, "clear")) {
1439 b_data->u_usable = 0;
1441 memset(&b_data->u_profile, 0, sizeof(b_data->u_profile));
1442 return 0;
1443 }
1444
1445 if (b_data && !b_data->u_usable && strcasecmp(args.option, "template")) {
1446 template.value = DEFAULT_USER_PROFILE;
1447 aco_process_var(&user_type, "dialplan", &template, &b_data->u_profile);
1448 }
1449
1450 if (!aco_process_var(&user_type, "dialplan", &tmpvar, &b_data->u_profile)) {
1451 b_data->u_usable = 1;
1452 return 0;
1453 }
1454 } else if (!strcasecmp(args.type, "menu")) {
1455 if (!strcasecmp(args.option, "clear")) {
1456 b_data->m_usable = 0;
1457 ao2_cleanup(b_data->menu);
1458 if (!(b_data->menu = menu_alloc("dialplan"))) {
1459 /* If this reallocation fails, the datastore has become unusable and must be destroyed */
1460 ast_channel_lock(chan);
1461 ast_channel_datastore_remove(chan, datastore);
1462 ast_channel_unlock(chan);
1463 ast_datastore_free(datastore);
1464 }
1465 return 0;
1466 }
1467
1468 if (b_data && !b_data->m_usable && strcasecmp(args.option, "template")) {
1469 template.value = DEFAULT_MENU_PROFILE;
1470 aco_process_var(&menu_type, "dialplan", &template, &b_data->menu);
1471 }
1472
1473 if (!aco_process_var(&menu_type, "dialplan", &tmpvar, b_data->menu)) {
1474 b_data->m_usable = 1;
1475 return 0;
1476 }
1477 }
1478
1479 ast_log(LOG_WARNING, "%s(%s,%s) cannot be set to '%s'. Invalid type, option, or value.\n",
1480 cmd, args.type, args.option, value);
1481 return -1;
1482}
static const char type[]
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
Definition channel.c:2376
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
Definition channel.c:2385
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
static struct @523 args
Structure for variables, used for configurations and for channel variables.
int value
Definition syslog.c:37

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

◆ manager_confbridge_init()

int manager_confbridge_init ( void  )

register stasis message routers to handle manager events for confbridge messages

Since
12.0
Return values
0success
non-zerofailure

Definition at line 760 of file confbridge_manager.c.

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

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

Referenced by load_module().

◆ manager_confbridge_shutdown()

void manager_confbridge_shutdown ( void  )

unregister stasis message routers to handle manager events for confbridge messages

Since
12.0

Definition at line 737 of file confbridge_manager.c.

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

Referenced by manager_confbridge_init(), and unload_module().

◆ play_sound_file()

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

Play sound file into conference bridge.

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

Definition at line 2191 of file app_confbridge.c.

2192{
2193 return play_sound_helper(conference, filename, -1);
2194}
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