31 #include "asterisk/stasis_bridges.h"
35 #define MAX_CONF_NAME AST_MAX_EXTENSION
39 #define MAX_PROFILE_NAME 128
41 #define DEFAULT_USER_PROFILE "default_user"
42 #define DEFAULT_BRIDGE_PROFILE "default_bridge"
43 #define DEFAULT_MENU_PROFILE "default_menu"
46 #define DEFAULT_TALKING_THRESHOLD 160
49 #define DEFAULT_SILENCE_THRESHOLD 2500
51 enum user_profile_flags {
52 USER_OPT_ADMIN = (1 << 0),
53 USER_OPT_NOONLYPERSON = (1 << 1),
54 USER_OPT_MARKEDUSER = (1 << 2),
55 USER_OPT_STARTMUTED = (1 << 3),
56 USER_OPT_MUSICONHOLD = (1 << 4),
57 USER_OPT_QUIET = (1 << 5),
58 USER_OPT_ANNOUNCEUSERCOUNT = (1 << 6),
59 USER_OPT_WAITMARKED = (1 << 7),
60 USER_OPT_ENDMARKED = (1 << 8),
61 USER_OPT_DENOISE = (1 << 9),
62 USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 10),
63 USER_OPT_TALKER_DETECT = (1 << 11),
64 USER_OPT_DROP_SILENCE = (1 << 12),
65 USER_OPT_DTMF_PASS = (1 << 13),
66 USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14),
67 USER_OPT_JITTERBUFFER = (1 << 15),
68 USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16),
69 USER_OPT_SEND_EVENTS = (1 << 17),
70 USER_OPT_ECHO_EVENTS = (1 << 18),
71 USER_OPT_TEXT_MESSAGING = (1 << 19),
72 USER_OPT_ANSWER_CHANNEL = (1 << 20),
73 USER_OPT_HEAR_OWN_JOIN_SOUND = (1 << 21),
74 USER_OPT_ENDMARKEDANY = (1 << 22),
77 enum bridge_profile_flags {
78 BRIDGE_OPT_RECORD_CONFERENCE = (1 << 0),
79 BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1),
80 BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2),
81 BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3),
82 BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4),
83 BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5),
84 BRIDGE_OPT_BINAURAL_ACTIVE = (1 << 6),
85 BRIDGE_OPT_VIDEO_SRC_SFU = (1 << 7),
86 BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE = (1 << 8),
87 BRIDGE_OPT_REMB_BEHAVIOR_LOWEST = (1 << 9),
88 BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST = (1 << 10),
89 BRIDGE_OPT_ENABLE_EVENTS = (1 << 11),
90 BRIDGE_OPT_REMB_BEHAVIOR_AVERAGE_ALL = (1 << 12),
91 BRIDGE_OPT_REMB_BEHAVIOR_LOWEST_ALL = (1 << 13),
92 BRIDGE_OPT_REMB_BEHAVIOR_HIGHEST_ALL = (1 << 14),
93 BRIDGE_OPT_REMB_BEHAVIOR_FORCE = (1 << 15),
96 enum conf_menu_action_id {
97 MENU_ACTION_TOGGLE_MUTE = 1,
99 MENU_ACTION_PLAYBACK_AND_CONTINUE,
100 MENU_ACTION_INCREASE_LISTENING,
101 MENU_ACTION_DECREASE_LISTENING,
102 MENU_ACTION_RESET_LISTENING,
103 MENU_ACTION_RESET_TALKING,
104 MENU_ACTION_INCREASE_TALKING,
105 MENU_ACTION_DECREASE_TALKING,
106 MENU_ACTION_DIALPLAN_EXEC,
107 MENU_ACTION_ADMIN_TOGGLE_LOCK,
108 MENU_ACTION_ADMIN_KICK_LAST,
111 MENU_ACTION_SET_SINGLE_VIDEO_SRC,
112 MENU_ACTION_RELEASE_SINGLE_VIDEO_SRC,
113 MENU_ACTION_PARTICIPANT_COUNT,
114 MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS,
115 MENU_ACTION_TOGGLE_BINAURAL,
123 enum conf_menu_action_id id;
125 char playback_file[PATH_MAX];
150 char name[MAX_PROFILE_NAME];
155 char name[MAX_PROFILE_NAME];
158 char announcement[PATH_MAX];
160 unsigned int announce_user_count_all_after;
170 CONF_SOUND_HAS_JOINED,
176 CONF_SOUND_THERE_ARE,
177 CONF_SOUND_OTHER_IN_PARTY,
178 CONF_SOUND_PLACE_IN_CONF,
179 CONF_SOUND_WAIT_FOR_LEADER,
180 CONF_SOUND_LEADER_HAS_LEFT,
182 CONF_SOUND_INVALID_PIN,
183 CONF_SOUND_ONLY_PERSON,
185 CONF_SOUND_LOCKED_NOW,
186 CONF_SOUND_UNLOCKED_NOW,
187 CONF_SOUND_ERROR_MENU,
190 CONF_SOUND_PARTICIPANTS_MUTED,
191 CONF_SOUND_PARTICIPANTS_UNMUTED,
193 CONF_SOUND_BINAURAL_ON,
194 CONF_SOUND_BINAURAL_OFF,
228 char name[MAX_PROFILE_NAME];
230 char rec_file[PATH_MAX];
231 char rec_options[128];
232 char rec_command[128];
247 char name[MAX_CONF_NAME];
254 unsigned int locked:1;
255 unsigned int muted:1;
277 char menu_name[MAX_PROFILE_NAME];
278 char name_rec_location[PATH_MAX];
283 unsigned int muted:1;
284 unsigned int kicked:1;
285 unsigned int playing_moh:1;
286 unsigned int talking:1;
409 int func_confbridge_helper(struct
ast_channel *chan, const
char *cmd,
char *data, const
char *value);
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_add_user_active(struct confbridge_conference *conference, struct confbridge_user *user)
Add a conference bridge user as an unmarked active user of the conference.
Main Channel structure associated with a channel.
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 transitio...
Asterisk main include file. File version handling, generic pbx functions.
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.
int manager_confbridge_init(void)
register stasis message routers to handle manager events for confbridge messages
struct ast_channel * chan
Message representing attended transfer.
Structure that contains features information.
struct confbridge_conference * conference
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...
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.
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.
unsigned int suspended_moh
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_mute_only_active(struct confbridge_conference *conference)
Attempt to mute/play MOH to the only user in the conference if they require it.
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_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
unsigned int silence_threshold
struct confbridge_user::@94 list
void confbridge_handle_atxfer(struct ast_attended_transfer_message *msg)
Create join/leave events for attended transfers.
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.
struct ast_channel * record_chan
struct ast_str * orig_rec_file
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_tech * conf_record_get_tech(void)
Get ConfBridge record channel technology struct.
void conf_handle_second_active(struct confbridge_conference *conference)
Handle when a conference moves to having more than one active participant.
unsigned int waitingusers
void conf_bridge_profile_copy(struct bridge_profile *dst, struct bridge_profile *src)
copies a bridge profile
int conf_announce_channel_push(struct ast_channel *ast)
Push the announcer channel into the conference.
int async_play_sound_file(struct confbridge_conference *conference, const char *filename, struct ast_channel *initiator)
Play sound file into conference bridge asynchronously.
General Asterisk PBX channel definitions.
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 per...
#define AST_MAX_EXTENSION
void conf_bridge_profile_destroy(struct bridge_profile *b_profile)
Destroy a bridge profile found by 'conf_find_bridge_profile'.
void conf_handle_first_join(struct confbridge_conference *conference)
Callback to execute any time we transition from zero to one active users.
#define AST_STRING_FIELD(name)
Declare a string field.
int conf_reload_config(void)
reload confbridge.conf file
struct ast_channel_tech * conf_announce_get_tech(void)
Get ConfBridge announce channel technology struct.
A set of macros to manage forward-linked lists.
#define MAXIMUM_DTMF_FEATURE_STRING
Maximum length of a DTMF feature string.
struct ao2_container * conference_bridges
Container to hold all conference bridges in progress.
unsigned int maximum_sample_rate
Structure to describe a channel "technology", ie a channel driver See for examples: ...
unsigned int internal_sample_rate
list of actions registered
static struct stasis_rest_handlers sounds
REST handler for /api-docs/sounds.json.
struct confbridge_state * state
#define AST_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
void conf_moh_start(struct confbridge_user *user)
Start MOH for the conference user.
Structure that contains information about a bridge.
unsigned int video_update_discard
Support for dynamic strings.
void conf_destroy_config(void)
destroy the information loaded from the confbridge.conf file
int conf_handle_only_person(struct confbridge_user *user)
Handle actions whenever an user joins an empty conference.
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
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.
unsigned int talking_threshold
void manager_confbridge_shutdown(void)
unregister stasis message routers to handle manager events for confbridge messages ...
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. ...
Support for logging to various files, console and syslog Configuration in file logger.conf.
The structure that represents a conference bridge.
const char * confbridge_event_type_to_string(struct stasis_message_type *event_type)
Get the string representation of a confbridge stasis message type.
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_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.
void conf_send_event_to_participants(struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message *msg)
Send events to bridge participants.
structure to hold users read from users.conf
Confbridge state handling.
A conference state object to hold the various state callback functions.
Structure that contains information regarding a channel in a bridge.
A ast_taskprocessor structure is a singleton by name.
unsigned int remb_estimated_bitrate
struct confbridge_conference * conf_find_bridge(const char *conference_name)
Find a confbridge by name.
struct ast_channel * playback_chan
The structure that represents a conference bridge user.
void conf_ended(struct confbridge_conference *conference)
Callback to be called when the conference has become empty.
struct ast_str * record_filename
int conf_load_config(void)
load confbridge.conf file
int play_sound_file(struct confbridge_conference *conference, const char *filename)
Play sound file into conference bridge.
unsigned int remb_send_interval
unsigned int mix_interval
Structure specific to bridge technologies capable of performing talking optimizations.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
struct ast_bridge * bridge
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...