Asterisk - The Open Source Telephony Project
21.4.1
|
Conference Bridge application. More...
#include "asterisk.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include "asterisk/cli.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/bridge.h"
#include "asterisk/musiconhold.h"
#include "asterisk/say.h"
#include "asterisk/audiohook.h"
#include "asterisk/astobj2.h"
#include "confbridge/include/confbridge.h"
#include "asterisk/paths.h"
#include "asterisk/manager.h"
#include "asterisk/test.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/json.h"
#include "asterisk/format_cache.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/stream.h"
#include "asterisk/message.h"
Go to the source code of this file.
Data Structures | |
struct | async_datastore_data |
struct | async_delete_name_rec_task_data |
struct | async_playback_task_data |
struct | confbridge_hook_data |
struct | hangup_data |
struct | playback_task_data |
Macros | |
#define | CONFERENCE_BRIDGE_BUCKETS 53 |
#define | RECORD_FILENAME_INITIAL_SPACE 128 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | action_confbridgekick (struct mansession *s, const struct message *m) |
static int | action_confbridgelist (struct mansession *s, const struct message *m) |
static int | action_confbridgelist_item (struct mansession *s, const char *id_text, struct confbridge_conference *conference, struct confbridge_user *user, int waiting) |
static int | action_confbridgelistrooms (struct mansession *s, const struct message *m) |
static int | action_confbridgelock (struct mansession *s, const struct message *m) |
static int | action_confbridgemute (struct mansession *s, const struct message *m) |
static int | action_confbridgesetsinglevideosrc (struct mansession *s, const struct message *m) |
static int | action_confbridgestartrecord (struct mansession *s, const struct message *m) |
static int | action_confbridgestoprecord (struct mansession *s, const struct message *m) |
static int | action_confbridgeunlock (struct mansession *s, const struct message *m) |
static int | action_confbridgeunmute (struct mansession *s, const struct message *m) |
static int | action_dialplan_exec (struct ast_bridge_channel *bridge_channel, struct conf_menu_action *menu_action) |
static int | action_kick_last (struct confbridge_conference *conference, struct ast_bridge_channel *bridge_channel, struct confbridge_user *user) |
static int | action_lock_unlock_helper (struct mansession *s, const struct message *m, int lock) |
static int | action_mute_unmute_helper (struct mansession *s, const struct message *m, int mute) |
static int | action_playback (struct ast_bridge_channel *bridge_channel, const char *playback_file) |
static int | action_playback_and_continue (struct confbridge_conference *conference, struct confbridge_user *user, struct ast_bridge_channel *bridge_channel, struct conf_menu *menu, const char *playback_file, const char *cur_dtmf, int *stop_prompts) |
static int | action_toggle_binaural (struct confbridge_conference *conference, struct confbridge_user *user, struct ast_bridge_channel *bridge_channel) |
static int | action_toggle_mute (struct confbridge_conference *conference, struct confbridge_user *user, struct ast_bridge_channel *bridge_channel) |
static int | action_toggle_mute_participants (struct confbridge_conference *conference, struct confbridge_user *user) |
static int | alloc_playback_chan (struct confbridge_conference *conference) |
static int | announce_user_count (struct confbridge_conference *conference, struct confbridge_user *user, struct ast_bridge_channel *bridge_channel) |
Announce number of users in the conference bridge to the caller. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static struct async_datastore_data * | async_datastore_data_alloc (void) |
static void | async_datastore_data_destroy (void *data) |
static int | async_delete_name_rec (struct confbridge_conference *conference, const char *filename) |
static int | async_delete_name_rec_task (void *data) |
Delete user's name file asynchronously. More... | |
static struct async_delete_name_rec_task_data * | async_delete_name_rec_task_data_alloc (struct confbridge_conference *conference, const char *filename) |
static void | async_delete_name_rec_task_data_destroy (struct async_delete_name_rec_task_data *atd) |
int | async_play_sound_file (struct confbridge_conference *conference, const char *filename, struct ast_channel *initiator) |
Play sound file into conference bridge asynchronously. More... | |
static int | async_play_sound_helper (struct confbridge_conference *conference, const char *filename, int say_number, struct ast_channel *initiator) |
void | async_play_sound_ready (struct ast_channel *chan) |
Indicate the initiator of an async sound file is ready for it to play. More... | |
static int | async_playback_task (void *data) |
Play an announcement into a confbridge asynchronously. More... | |
static struct async_playback_task_data * | async_playback_task_data_alloc (struct confbridge_conference *conference, const char *filename, int say_number, struct ast_channel *initiator) |
static void | async_playback_task_data_destroy (struct async_playback_task_data *aptd) |
static int | cli_mute_unmute_helper (int mute, struct ast_cli_args *a) |
static char * | complete_confbridge_name (const char *line, const char *word, int pos, int state) |
static char * | complete_confbridge_participant (const char *conference_name, const char *line, const char *word, int pos, int state) |
int | conf_add_post_join_action (struct confbridge_user *user, int(*func)(struct confbridge_user *user)) |
Queue a function to run with the given conference bridge user as an argument once the state transition is complete. More... | |
void | conf_add_user_active (struct confbridge_conference *conference, struct confbridge_user *user) |
Add a conference bridge user as an unmarked active user of the conference. More... | |
void | conf_add_user_marked (struct confbridge_conference *conference, struct confbridge_user *user) |
Add a conference bridge user as a marked active user of the conference. More... | |
void | conf_add_user_waiting (struct confbridge_conference *conference, struct confbridge_user *user) |
Add a conference bridge user as an waiting user of the conference. More... | |
void | conf_ended (struct confbridge_conference *conference) |
Callback to be called when the conference has become empty. More... | |
struct confbridge_conference * | conf_find_bridge (const char *conference_name) |
Find a confbridge by name. More... | |
static int | conf_get_pin (struct ast_channel *chan, struct confbridge_user *user) |
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. More... | |
void | conf_handle_first_join (struct confbridge_conference *conference) |
Callback to execute any time we transition from zero to one active users. More... | |
int | conf_handle_inactive_waitmarked (struct confbridge_user *user) |
Handle actions every time a waitmarked user joins w/o a marked user present. More... | |
int | conf_handle_only_person (struct confbridge_user *user) |
Handle actions whenever an user joins an empty conference. More... | |
void | conf_handle_second_active (struct confbridge_conference *conference) |
Handle when a conference moves to having more than one active participant. More... | |
static int | conf_handle_talker_cb (struct ast_bridge_channel *bridge_channel, void *hook_pvt, int talking) |
static int | conf_is_recording (struct confbridge_conference *conference) |
void | conf_moh_start (struct confbridge_user *user) |
Start MOH for the conference user. More... | |
void | conf_moh_stop (struct confbridge_user *user) |
Stop MOH for the conference user. More... | |
static void | conf_moh_suspend (struct confbridge_user *user) |
static void | conf_moh_unsuspend (struct confbridge_user *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. More... | |
static int | conf_rec_name (struct confbridge_user *user, const char *conf_name) |
void | conf_remove_user_active (struct confbridge_conference *conference, struct confbridge_user *user) |
Remove a conference bridge user from the unmarked active conference users in the conference. More... | |
void | conf_remove_user_marked (struct confbridge_conference *conference, struct confbridge_user *user) |
Remove a conference bridge user from the marked active conference users in the conference. More... | |
void | conf_remove_user_waiting (struct confbridge_conference *conference, struct confbridge_user *user) |
Remove a conference bridge user from the waiting conference users in the conference. More... | |
static int | conf_start_record (struct confbridge_conference *conference) |
static int | conf_stop_record (struct confbridge_conference *conference) |
void | conf_update_user_mute (struct confbridge_user *user) |
Update the actual mute status of the user and set it on the bridge. More... | |
static int | confbridge_exec (struct ast_channel *chan, const char *data) |
The ConfBridge application. | |
void | confbridge_handle_atxfer (struct ast_attended_transfer_message *msg) |
Create join/leave events for attended transfers. More... | |
static void | confbridge_unlock_and_unref (void *obj) |
static int | conference_bridge_cmp_cb (void *obj, void *arg, int flags) |
Comparison function used for conference bridges container. | |
static int | conference_bridge_hash_cb (const void *obj, const int flags) |
Hashing function used for conference bridges container. | |
static int | confkick_exec (struct ast_channel *chan, const char *data) |
static void | destroy_conference_bridge (void *obj) |
Destroy a conference bridge. More... | |
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) |
static int | func_confbridge_channels (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | func_confbridge_info (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | generic_lock_unlock_helper (int lock, const char *conference_name) |
static int | generic_mute_unmute_helper (int mute, const char *conference_name, const char *chan_name) |
static void | generic_mute_unmute_user (struct confbridge_conference *conference, struct confbridge_user *user, int mute) |
static char * | handle_cli_confbridge_kick (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_confbridge_list (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | handle_cli_confbridge_list_item (struct ast_cli_args *a, struct confbridge_user *user, int waiting) |
static char * | handle_cli_confbridge_lock (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_confbridge_mute (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_confbridge_start_record (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_confbridge_stop_record (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_confbridge_unlock (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_confbridge_unmute (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | handle_conf_user_join (struct confbridge_user *user) |
Call the proper join event handler for the user for the conference bridge's current state. | |
static int | handle_conf_user_leave (struct confbridge_user *user) |
Call the proper leave event handler for the user for the conference bridge's current state. | |
static void | handle_video_on_exit (struct confbridge_conference *conference, struct ast_channel *chan) |
static void | handle_video_on_join (struct confbridge_conference *conference, struct ast_channel *chan, int marked) |
static void | hangup_data_destroy (struct hangup_data *hangup) |
static void | hangup_data_init (struct hangup_data *hangup, struct confbridge_conference *conference) |
static int | hangup_playback (void *data) |
Hang up the announcer channel. More... | |
static int | is_new_rec_file (const char *rec_file, struct ast_str **orig_rec_file) |
static int | join_callback (struct ast_bridge_channel *bridge_channel, void *ignore) |
static struct confbridge_conference * | join_conference_bridge (const char *conference_name, struct confbridge_user *user) |
Join a conference bridge. More... | |
static int | kick_conference_participant (struct confbridge_conference *conference, const char *channel) |
static void | leave_conference (struct confbridge_user *user) |
Leave a conference. More... | |
static int | load_module (void) |
Load the module. More... | |
static int | play_file (struct ast_bridge_channel *bridge_channel, struct ast_channel *channel, const char *filename) |
Playback the given filename and monitor for any dtmf interrupts. More... | |
static int | play_prompt_to_user (struct confbridge_user *user, const char *filename) |
Play back an audio file to a channel. More... | |
int | play_sound_file (struct confbridge_conference *conference, const char *filename) |
Play sound file into conference bridge. More... | |
static int | play_sound_helper (struct confbridge_conference *conference, const char *filename, int say_number) |
static int | play_sound_number (struct confbridge_conference *conference, int say_number) |
Play number into the conference bridge. More... | |
static void | playback_common (struct confbridge_conference *conference, const char *filename, int say_number) |
static int | playback_task (void *data) |
Play an announcement into a confbridge. More... | |
static void | playback_task_data_destroy (struct playback_task_data *ptd) |
static void | playback_task_data_init (struct playback_task_data *ptd, struct confbridge_conference *conference, const char *filename, int say_number) |
static int | push_announcer (struct confbridge_conference *conference) |
Push the announcer channel into the bridge. More... | |
static int | register_channel_tech (struct ast_channel_tech *tech) |
static int | reload (void) |
static void | send_conf_end_event (struct confbridge_conference *conference) |
static void | send_conf_start_event (struct confbridge_conference *conference) |
static void | send_conf_stasis (struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *extras, int channel_topic) |
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 int | send_event_hook_callback (struct ast_bridge_channel *bridge_channel, void *data) |
static void | send_join_event (struct confbridge_user *user, struct confbridge_conference *conference) |
static void | send_leave_event (struct confbridge_user *user, struct confbridge_conference *conference) |
static void | send_mute_event (struct confbridge_user *user, struct confbridge_conference *conference) |
static void | send_start_record_event (struct confbridge_conference *conference) |
static void | send_stop_record_event (struct confbridge_conference *conference) |
static void | send_unmute_event (struct confbridge_user *user, struct confbridge_conference *conference) |
static void | set_rec_filename (struct confbridge_conference *conference, struct ast_str **filename, int is_new) |
static int | setup_async_playback_datastore (struct ast_channel *initiator) |
Prepare the async playback datastore. More... | |
static int | sound_file_exists (const char *filename) |
static int | unload_module (void) |
Called when module is being unloaded. | |
static void | unregister_channel_tech (struct ast_channel_tech *tech) |
static int | user_timeout (struct ast_bridge_channel *bridge_channel, void *ignore) |
static void | wait_for_initiator (struct ast_channel *initiator) |
Wait for the initiator of an async playback to be ready. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Conference Bridge Application" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "da6642af068ee5e6490c5b1d2cc1d238" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_DEVSTATE_PROVIDER, .optional_modules = "codec_speex,func_jitterbuffer", } |
static const char | app [] = "ConfBridge" |
static const char | app2 [] = "ConfKick" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_datastore_info | async_datastore_info |
Datastore used for timing of async announcement playback. More... | |
static struct ast_cli_entry | cli_confbridge [] |
static struct ast_custom_function | confbridge_channels_function |
static struct ast_custom_function | confbridge_function |
static struct ast_custom_function | confbridge_info_function |
struct ao2_container * | conference_bridges |
Container to hold all conference bridges in progress. | |
Conference Bridge application.
This is a conference bridge application utilizing the bridging core.
Definition in file app_confbridge.c.
#define CONFERENCE_BRIDGE_BUCKETS 53 |
Number of buckets our conference bridges container can have
Definition at line 551 of file app_confbridge.c.
Referenced by load_module().
#define RECORD_FILENAME_INITIAL_SPACE 128 |
Initial recording filename space.
Definition at line 554 of file app_confbridge.c.
Referenced by join_conference_bridge().
|
static |
Announce number of users in the conference bridge to the caller.
conference | Conference bridge to peek at |
user | Optional Caller |
bridge_channel | The bridged channel involved |
0 | on success. |
-1 | if the user hung up. |
Definition at line 1076 of file app_confbridge.c.
References confbridge_conference::activeusers, ast_say_number(), ast_stream_and_wait(), confbridge_conference::b_profile, confbridge_user::chan, conf_get_sound(), play_file(), play_sound_file(), and play_sound_number().
Referenced by join_conference_bridge().
|
static |
Delete user's name file asynchronously.
This runs in the playback queue taskprocessor. This ensures that sound file is removed after playback is finished and not before.
data | An async_delete_name_rec_task_data |
Definition at line 2569 of file app_confbridge.c.
References ast_filedelete(), and confbridge_conference::name.
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.
conference | The conference bridge to play sound file into |
filename | Sound file to play |
initiator | Channel that initiated playback. |
0 | success |
-1 | failure |
Definition at line 2371 of file app_confbridge.c.
Referenced by confbridge_exec().
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
chan | The channel that initiated the async announcement |
Definition at line 2377 of file app_confbridge.c.
References ast_channel_datastore_find(), and ast_datastore::data.
Referenced by conf_handle_dtmf(), and confbridge_exec().
|
static |
Play an announcement into a confbridge asynchronously.
This runs in the playback queue taskprocessor. This ensures that all playbacks are handled in sequence and do not play over top one another.
data | An async_playback_task_data |
Definition at line 2322 of file app_confbridge.c.
References wait_for_initiator().
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.
user | The conference bridge user to pass to the function |
func | The function to queue |
0 | success |
non-zero | failure |
Definition at line 1532 of file app_confbridge.c.
References ast_calloc, AST_LIST_INSERT_TAIL, and confbridge_user::post_join_list.
Referenced by conf_default_join_waitmarked().
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.
conference | The conference bridge to add the user to |
user | The conference bridge user to add to the conference |
Definition at line 4485 of file app_confbridge.c.
References confbridge_conference::active_list, confbridge_conference::activeusers, and AST_LIST_INSERT_TAIL.
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.
conference | The conference bridge to add the user to |
user | The conference bridge user to add to the conference |
Definition at line 4491 of file app_confbridge.c.
References confbridge_conference::active_list, confbridge_conference::activeusers, AST_LIST_INSERT_TAIL, and confbridge_conference::markedusers.
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.
conference | The conference bridge to add the user to |
user | The conference bridge user to add to the conference |
Definition at line 4498 of file app_confbridge.c.
References AST_LIST_INSERT_TAIL, confbridge_conference::waiting_list, and confbridge_conference::waitingusers.
Referenced by conf_default_join_waitmarked().
void conf_ended | ( | struct confbridge_conference * | conference | ) |
Callback to be called when the conference has become empty.
conference | The conference bridge |
Definition at line 1560 of file app_confbridge.c.
References ao2_unlink, ast_context_remove_extension(), confbridge_conference::b_profile, and confbridge_conference::name.
struct confbridge_conference* conf_find_bridge | ( | const char * | conference_name | ) |
Find a confbridge by name.
conference_name | The name to search for |
Definition at line 875 of file app_confbridge.c.
References OBJ_KEY.
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.
bridge_channel | Bridged channel this is involving |
user | the conference user to perform the action on. |
menu_entry | the menu entry that invoked this callback to occur. |
menu | an AO2 referenced pointer to the entire menu structure the menu_entry derived from. |
0 | success |
-1 | failure |
Definition at line 3310 of file app_confbridge.c.
References async_play_sound_ready(), ast_bridge_channel::chan, and confbridge_user::conference.
void conf_handle_first_join | ( | struct confbridge_conference * | conference | ) |
Callback to execute any time we transition from zero to one active users.
conference | The conference bridge with a single active user joined |
Definition at line 1544 of file app_confbridge.c.
References AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), and confbridge_conference::name.
int conf_handle_inactive_waitmarked | ( | struct confbridge_user * | user | ) |
Handle actions every time a waitmarked user joins w/o a marked user present.
user | The waitmarked user |
0 | success |
-1 | failure |
Definition at line 1508 of file app_confbridge.c.
References confbridge_conference::b_profile, conf_get_sound(), confbridge_user::conference, play_prompt_to_user(), and confbridge_user::u_profile.
Referenced by conf_default_join_waitmarked().
int conf_handle_only_person | ( | struct confbridge_user * | user | ) |
Handle actions whenever an user joins an empty conference.
user | The user |
Definition at line 1519 of file app_confbridge.c.
References confbridge_conference::b_profile, conf_get_sound(), confbridge_user::conference, play_prompt_to_user(), and confbridge_user::u_profile.
void conf_handle_second_active | ( | struct confbridge_conference * | conference | ) |
Handle when a conference moves to having more than one active participant.
conference | The conference bridge with more than one active participant |
Definition at line 1549 of file app_confbridge.c.
References confbridge_conference::active_list, AST_LIST_FIRST, conf_moh_stop(), conf_update_user_mute(), and confbridge_user::u_profile.
void conf_moh_start | ( | struct confbridge_user * | user | ) |
Start MOH for the conference user.
user | Conference user to start MOH on. |
Definition at line 1451 of file app_confbridge.c.
References ast_bridge_lock, ast_bridge_suspend(), ast_bridge_unlock, ast_bridge_unsuspend(), ast_moh_start(), confbridge_conference::bridge, confbridge_user::chan, confbridge_user::conference, confbridge_user::playing_moh, confbridge_user::suspended_moh, and confbridge_user::u_profile.
Referenced by conf_mute_only_active().
void conf_moh_stop | ( | struct confbridge_user * | user | ) |
Stop MOH for the conference user.
user | Conference user to stop MOH on. |
Definition at line 1424 of file app_confbridge.c.
References ast_bridge_lock, ast_bridge_suspend(), ast_bridge_unlock, ast_bridge_unsuspend(), ast_moh_stop(), confbridge_conference::bridge, confbridge_user::chan, confbridge_user::conference, confbridge_user::playing_moh, and confbridge_user::suspended_moh.
Referenced by conf_default_leave_waitmarked(), and conf_handle_second_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.
conference | A conference bridge containing a single user |
Definition at line 4517 of file app_confbridge.c.
References confbridge_conference::active_list, AST_LIST_FIRST, conf_moh_start(), conf_update_user_mute(), and confbridge_user::u_profile.
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.
conference | The conference bridge to remove the user from |
user | The conference bridge user to remove from the conference |
Definition at line 4504 of file app_confbridge.c.
References confbridge_conference::active_list, confbridge_conference::activeusers, and AST_LIST_REMOVE.
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.
conference | The conference bridge to remove the user from |
user | The conference bridge user to remove from the conference |
Definition at line 4510 of file app_confbridge.c.
References confbridge_conference::active_list, confbridge_conference::activeusers, AST_LIST_REMOVE, and confbridge_conference::markedusers.
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.
conference | The conference bridge to remove the user from |
user | The conference bridge user to remove from the conference |
Definition at line 4528 of file app_confbridge.c.
References AST_LIST_REMOVE, confbridge_user::list, confbridge_conference::waiting_list, and confbridge_conference::waitingusers.
Referenced by conf_default_leave_waitmarked().
void conf_update_user_mute | ( | struct confbridge_user * | user | ) |
Update the actual mute status of the user and set it on the bridge.
user | User to update the mute status. |
Definition at line 1366 of file app_confbridge.c.
References ast_debug, ast_test_suite_event_notify, confbridge_conference::b_profile, confbridge_user::chan, confbridge_user::conference, confbridge_user::features, confbridge_conference::markedusers, ast_bridge_features::mute, confbridge_user::muted, confbridge_user::playing_moh, and confbridge_user::u_profile.
Referenced by conf_handle_second_active(), and conf_mute_only_active().
void confbridge_handle_atxfer | ( | struct ast_attended_transfer_message * | msg | ) |
Create join/leave events for attended transfers.
msg | The attended transfer stasis message |
Definition at line 1649 of file app_confbridge.c.
References confbridge_conference::active_list, ast_channel_snapshot_dialplan::appl, ast_debug, ast_json_pack(), ast_json_unref(), AST_LIST_TRAVERSE, ast_strdupa, ast_channel_snapshot::base, confbridge_user::chan, ast_channel_snapshot_dialplan::data, ast_channel_snapshot::dialplan, confbridge_user::muted, ast_channel_snapshot_base::name, OBJ_SEARCH_KEY, RAII_VAR, ast_attended_transfer_message::target, ast_attended_transfer_message::to_transfer_target, ast_attended_transfer_message::to_transferee, ast_attended_transfer_message::transferee, confbridge_user::u_profile, confbridge_conference::waiting_list, and confbridge_conference::waitingusers.
|
static |
Destroy a conference bridge.
obj | The conference bridge object |
Definition at line 1264 of file app_confbridge.c.
References ast_bridge_destroy(), ast_channel_cleanup, ast_debug, ast_hangup(), ast_taskprocessor_push(), ast_taskprocessor_unreference(), confbridge_conference::b_profile, confbridge_conference::bridge, conf_bridge_profile_destroy(), hangup_playback(), confbridge_conference::name, confbridge_conference::orig_rec_file, confbridge_conference::playback_chan, confbridge_conference::playback_queue, confbridge_conference::record_chan, and confbridge_conference::record_filename.
Referenced by join_conference_bridge().
|
static |
Hang up the announcer channel.
This hangs up the announcer channel in the conference. This runs in the playback queue taskprocessor since we do not want to hang up the channel while it's trying to play an announcement.
This task is performed synchronously, so there is no need to perform any cleanup on the passed-in data.
data | A hangup_data structure |
Definition at line 1227 of file app_confbridge.c.
References ast_autoservice_stop(), ast_hangup(), and confbridge_conference::playback_chan.
Referenced by destroy_conference_bridge().
|
static |
Join a conference bridge.
conference_name | The conference name |
user | Conference bridge user structure |
Definition at line 1766 of file app_confbridge.c.
References confbridge_conference::activeusers, announce_user_count(), ao2_link, ao2_ref, ao2_unlink, app, ast_add_extension(), ast_autoservice_start(), ast_autoservice_stop(), ast_bridge_base_new(), AST_BRIDGE_CAPABILITY_MULTIMIX, AST_BRIDGE_FLAG_MASQUERADE_ONLY, AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY, ast_bridge_set_binaural_active(), ast_bridge_set_internal_sample_rate(), ast_bridge_set_maximum_sample_rate(), ast_bridge_set_mixing_interval(), ast_bridge_set_remb_estimated_bitrate(), ast_bridge_set_remb_send_interval(), ast_bridge_set_send_sdp_label(), ast_bridge_set_sfu_video_mode(), ast_bridge_set_talker_src_video_mode(), ast_bridge_set_video_update_discard(), AST_BRIDGE_VIDEO_SFU_REMB_AVERAGE, AST_BRIDGE_VIDEO_SFU_REMB_AVERAGE_ALL, AST_BRIDGE_VIDEO_SFU_REMB_FORCE, AST_BRIDGE_VIDEO_SFU_REMB_HIGHEST, AST_BRIDGE_VIDEO_SFU_REMB_HIGHEST_ALL, AST_BRIDGE_VIDEO_SFU_REMB_LOWEST, AST_BRIDGE_VIDEO_SFU_REMB_LOWEST_ALL, ast_brige_set_remb_behavior(), ast_check_hangup(), ast_copy_string(), ast_debug, ast_exists_extension(), AST_LIST_REMOVE_HEAD, ast_str_create, ast_stream_and_wait(), confbridge_conference::b_profile, confbridge_user::b_profile, confbridge_conference::bridge, confbridge_user::chan, conf_bridge_profile_copy(), conf_get_sound(), CONF_STATE_EMPTY, confbridge_user::conference, destroy_conference_bridge(), handle_conf_user_join(), bridge_profile::internal_sample_rate, leave_conference(), confbridge_conference::locked, bridge_profile::max_members, bridge_profile::maximum_sample_rate, bridge_profile::mix_interval, confbridge_conference::muted, confbridge_user::muted, confbridge_conference::name, OBJ_KEY, play_prompt_to_user(), confbridge_user::post_join_list, push_announcer(), confbridge_conference::record_filename, RECORD_FILENAME_INITIAL_SPACE, bridge_profile::remb_estimated_bitrate, bridge_profile::remb_send_interval, confbridge_conference::state, confbridge_user::suspended_moh, confbridge_user::u_profile, and bridge_profile::video_update_discard.
Referenced by confbridge_exec().
|
static |
Leave a conference.
user | The conference user |
Definition at line 1994 of file app_confbridge.c.
References ao2_ref, AST_LIST_REMOVE_HEAD, confbridge_user::conference, handle_conf_user_leave(), and confbridge_user::post_join_list.
Referenced by confbridge_exec(), and join_conference_bridge().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 4620 of file app_confbridge.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, app, ast_cli_register_multiple, ast_custom_function_register, ast_custom_function_register_escalating, ast_manager_register_xml, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_application_xml, conf_announce_get_tech(), conf_load_config(), conf_record_get_tech(), confbridge_exec(), CONFERENCE_BRIDGE_BUCKETS, conference_bridge_cmp_cb(), conference_bridge_hash_cb(), manager_confbridge_init(), and unload_module().
|
static |
Playback the given filename and monitor for any dtmf interrupts.
This function is used to playback sound files on a given channel and optionally allow dtmf interrupts to occur.
If the optional bridge_channel parameter is given then sound file playback is played on that channel and dtmf interruptions are allowed. However, if bridge_channel is not set then the channel parameter is expected to be set instead and non interruptible playback is played on that channel.
bridge_channel | Bridge channel to play file on |
channel | Optional channel to play file on if bridge_channel not given |
filename | The file name to playback |
-1 | failure during playback. |
0 | on file was fully played. |
1 | on dtmf interrupt. |
Definition at line 1018 of file app_confbridge.c.
References ast_bridge_channel_feature_digit_add(), AST_DIGIT_NONE, ast_stopstream(), ast_stream_and_wait(), and ast_bridge_channel::chan.
Referenced by announce_user_count(), and say_periodic_announcement().
|
static |
Play back an audio file to a channel.
user | User to play audio prompt to |
filename | Prompt to play |
0 | on success. |
-1 | if the user hung up. |
Definition at line 1131 of file app_confbridge.c.
References ast_stream_and_wait(), and confbridge_user::chan.
Referenced by conf_handle_inactive_waitmarked(), conf_handle_only_person(), and join_conference_bridge().
int play_sound_file | ( | struct confbridge_conference * | conference, |
const char * | filename | ||
) |
Play sound file into conference bridge.
conference | The conference bridge to play sound file into |
filename | Sound file to play |
0 | success |
-1 | failure |
Definition at line 2124 of file app_confbridge.c.
Referenced by announce_user_count(), and confbridge_exec().
|
static |
Play number into the conference bridge.
conference | The conference bridge to say the number into |
say_number | number to say |
0 | success |
-1 | failure |
Definition at line 2406 of file app_confbridge.c.
Referenced by announce_user_count().
|
static |
Play an announcement into a confbridge.
This runs in the playback queue taskprocessor. This ensures that all playbacks are handled in sequence and do not play over top one another.
This task runs synchronously so there is no need for performing any sort of cleanup on the input parameter.
data | A playback_task_data |
Definition at line 2054 of file app_confbridge.c.
|
static |
Push the announcer channel into the bridge.
conference | Conference bridge to push the announcer to |
0 | Success |
-1 | Failed to push the channel to the bridge |
Definition at line 1626 of file app_confbridge.c.
References ast_autoservice_start(), ast_hangup(), conf_announce_channel_push(), and confbridge_conference::playback_chan.
Referenced by join_conference_bridge().
|
static |
Prepare the async playback datastore.
This is done prior to queuing an async announcement. If the datastore has not yet been created, it is allocated and initialized. If it already exists, we set it to be in "waiting" mode.
initiator | The channel that is queuing the async playback |
0 | Success |
-1 | Failure :( |
Definition at line 2201 of file app_confbridge.c.
References ast_channel_datastore_add(), ast_channel_datastore_find(), ast_datastore_free(), and ast_datastore::data.
|
static |
Wait for the initiator of an async playback to be ready.
See the description on the async_datastore_info structure for more information about what this is about.
initiator | The channel that queued the async announcement |
Definition at line 2290 of file app_confbridge.c.
References ast_channel_datastore_find(), and ast_datastore::data.
Referenced by async_playback_task().
|
static |
Definition at line 547 of file app_confbridge.c.
Referenced by confbridge_exec(), join_conference_bridge(), load_module(), and unload_module().
|
static |
Datastore used for timing of async announcement playback.
Announcements that are played to the entire conference can be played asynchronously (i.e. The channel that queues the playback does not wait for the playback to complete before continuing)
The thing about async announcements is that the channel that queues the announcement is either not in the bridge or is in some other way "occupied" at the time the announcement is queued. Because of that, the initiator of the announcement may enter after the announcement has already started, resulting in the sound being "clipped".
This datastore makes it so that the channel that queues the async announcement can say "I'm ready now". This way the announcement does not start until the initiator of the announcement is ready to hear the sound.
Definition at line 2169 of file app_confbridge.c.
|
static |
Definition at line 3996 of file app_confbridge.c.
|
static |
Definition at line 3906 of file app_confbridge.c.
|
static |
Definition at line 3912 of file app_confbridge.c.