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 "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

Defines

#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)
}
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
}
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
}
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)
}

Functions

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.
void conf_announce_channel_depart (struct ast_channel *chan)
 Remove the announcer channel from 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 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.
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_unmarked (struct confbridge_user *user)
 Handle actions whenever an unmarked user joins an inactive 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.
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
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
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.


Define Documentation

#define DEFAULT_BRIDGE_PROFILE   "default_bridge"

Definition at line 41 of file confbridge.h.

Referenced by conf_find_bridge_profile(), confbridge_exec(), and verify_default_profiles().

#define DEFAULT_MENU_PROFILE   "default_menu"

Definition at line 42 of file confbridge.h.

Referenced by conf_set_menu_to_user(), confbridge_exec(), and verify_default_profiles().

#define DEFAULT_SILENCE_THRESHOLD   2500

Definition at line 45 of file confbridge.h.

Referenced by conf_load_config(), confbridge_exec(), and talk_detect_fn_write().

#define DEFAULT_TALKING_THRESHOLD   160

Definition at line 44 of file confbridge.h.

Referenced by conf_load_config(), and confbridge_exec().

#define DEFAULT_USER_PROFILE   "default_user"

Definition at line 40 of file confbridge.h.

Referenced by conf_find_user_profile(), confbridge_exec(), and verify_default_profiles().

#define MAX_CONF_NAME   AST_MAX_EXTENSION

Definition at line 34 of file confbridge.h.

Referenced by confbridge_exec().

#define MAX_PIN   80

Definition at line 36 of file confbridge.h.

#define MAX_PROFILE_NAME   128

Definition at line 38 of file confbridge.h.


Enumeration Type Documentation

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 

Definition at line 67 of file confbridge.h.

00067                           {
00068    BRIDGE_OPT_RECORD_CONFERENCE = (1 << 0), /*!< Set if the conference should be recorded */
00069    BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1), /*!< Set if conference should feed video of last marked user to all participants. */
00070    BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), /*!< Set if conference should feed video of first marked user to all participants. */
00071    BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3), /*!< Set if conference set the video feed to follow the loudest talker.  */
00072    BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), /*!< Set if the record file should be appended to between start/stops.  */
00073    BRIDGE_OPT_RECORD_FILE_TIMESTAMP = (1 << 5), /*< Set if the record file should have a timestamp appended */
00074 };

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 

Definition at line 76 of file confbridge.h.

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 

Definition at line 146 of file confbridge.h.

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

Definition at line 47 of file confbridge.h.

00047                         {
00048    USER_OPT_ADMIN =        (1 << 0), /*!< Set if the caller is an administrator */
00049    USER_OPT_NOONLYPERSON = (1 << 1), /*!< Set if the "you are currently the only person in this conference" sound file should not be played */
00050    USER_OPT_MARKEDUSER =   (1 << 2), /*!< Set if the caller is a marked user */
00051    USER_OPT_STARTMUTED =   (1 << 3), /*!< Set if the caller should be initially set muted */
00052    USER_OPT_MUSICONHOLD =  (1 << 4), /*!< Set if music on hold should be played if nobody else is in the conference bridge */
00053    USER_OPT_QUIET =        (1 << 5), /*!< Set if no audio prompts should be played */
00054    USER_OPT_ANNOUNCEUSERCOUNT = (1 << 6), /*!< Set if the number of users should be announced to the caller */
00055    USER_OPT_WAITMARKED =   (1 << 7), /*!< Set if the user must wait for a marked user before starting */
00056    USER_OPT_ENDMARKED =    (1 << 8), /*!< Set if the user should be kicked after the last Marked user exits */
00057    USER_OPT_DENOISE =      (1 << 9), /*!< Sets if denoise filter should be used on audio before mixing. */
00058    USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 10), /*!< Sets if the user's name should be recorded and announced on join and leave. */
00059    USER_OPT_TALKER_DETECT = (1 << 11), /*!< Sets if start and stop talking events should generated for this user over AMI. */
00060    USER_OPT_DROP_SILENCE =  (1 << 12), /*!< Sets if silence should be dropped from the mix or not. */
00061    USER_OPT_DTMF_PASS    =  (1 << 13), /*!< Sets if dtmf should be passed into the conference or not */
00062    USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), /*!< Sets if the number of users should be announced to everyone. */
00063    USER_OPT_JITTERBUFFER =  (1 << 15), /*!< Places a jitterbuffer on the user. */
00064    USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW = (1 << 16), /*!< modifies ANNOUNCE_JOIN_LEAVE - user reviews the recording before continuing */
00065 };


Function Documentation

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:
user The conference bridge user to pass to the function
func The function to queue
Return values:
0 success
non-zero failure

Definition at line 1166 of file app_confbridge.c.

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

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

01167 {
01168    struct post_join_action *action;
01169    if (!(action = ast_calloc(1, sizeof(*action)))) {
01170       return -1;
01171    }
01172    action->func = func;
01173    AST_LIST_INSERT_TAIL(&user->post_join_list, action, list);
01174    return 0;
01175 }

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:
conference The conference bridge to add the user to
user The conference bridge user to add to the conference

Definition at line 3237 of file app_confbridge.c.

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

Referenced by join_active(), and join_unmarked().

03238 {
03239    AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
03240    conference->activeusers++;
03241 }

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:
conference The conference bridge to add the user to
user The conference bridge user to add to the conference

Definition at line 3243 of file app_confbridge.c.

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

Referenced by join_marked().

03244 {
03245    AST_LIST_INSERT_TAIL(&conference->active_list, user, list);
03246    conference->activeusers++;
03247    conference->markedusers++;
03248 }

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:
conference The conference bridge to add the user to
user The conference bridge user to add to the conference

Definition at line 3250 of file app_confbridge.c.

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

Referenced by conf_default_join_waitmarked().

03251 {
03252    AST_LIST_INSERT_TAIL(&conference->waiting_list, user, list);
03253    conference->waitingusers++;
03254 }

void conf_announce_channel_depart ( struct ast_channel chan  ) 

Remove the announcer channel from the conference.

Since:
12.0.0
Parameters:
chan Either channel in the announcer channel pair.
Returns:
Nothing

Definition at line 146 of file conf_chan_announce.c.

References ao2_lock, ao2_ref, ao2_unlock, ast_bridge_depart(), ast_channel_tech_pvt(), ast_channel_unref, ast_clear_flag, ast_test_flag, AST_UNREAL_CARETAKER_THREAD, announce_pvt::base, and ast_unreal_pvt::chan.

Referenced by destroy_conference_bridge(), and play_sound_helper().

00147 {
00148    struct announce_pvt *p = ast_channel_tech_pvt(chan);
00149 
00150    if (!p) {
00151       return;
00152    }
00153 
00154    ao2_ref(p, +1);
00155    ao2_lock(p);
00156    if (!ast_test_flag(&p->base, AST_UNREAL_CARETAKER_THREAD)) {
00157       ao2_unlock(p);
00158       ao2_ref(p, -1);
00159       return;
00160    }
00161    ast_clear_flag(&p->base, AST_UNREAL_CARETAKER_THREAD);
00162    chan = p->base.chan;
00163    ao2_unlock(p);
00164    ao2_ref(p, -1);
00165    if (chan) {
00166       ast_bridge_depart(chan);
00167       ast_channel_unref(chan);
00168    }
00169 }

int conf_announce_channel_push ( struct ast_channel ast  ) 

Push the announcer channel into the conference.

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

Definition at line 171 of file conf_chan_announce.c.

References ao2_cleanup, ao2_lock, ao2_ref, ao2_unlock, AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE, ast_bridge_features_destroy(), ast_bridge_features_new(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_DEPARTABLE, ast_channel_ref, ast_channel_tech_pvt(), ast_channel_unref, ast_set_flag, AST_UNREAL_CARETAKER_THREAD, ast_bridge_features::feature_flags, lock, NULL, RAII_VAR, and SCOPED_CHANNELLOCK.

Referenced by play_sound_helper().

00172 {
00173    struct ast_bridge_features *features;
00174    struct ast_channel *chan;
00175    RAII_VAR(struct announce_pvt *, p, NULL, ao2_cleanup);
00176 
00177    {
00178       SCOPED_CHANNELLOCK(lock, ast);
00179 
00180       p = ast_channel_tech_pvt(ast);
00181       if (!p) {
00182          return -1;
00183       }
00184       ao2_ref(p, +1);
00185       chan = p->base.chan;
00186       if (!chan) {
00187          return -1;
00188       }
00189       ast_channel_ref(chan);
00190    }
00191 
00192    features = ast_bridge_features_new();
00193    if (!features) {
00194       ast_channel_unref(chan);
00195       return -1;
00196    }
00197    ast_set_flag(&features->feature_flags, AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE);
00198 
00199    /* Impart the output channel into the bridge */
00200    if (ast_bridge_impart(p->bridge, chan, NULL, features,
00201       AST_BRIDGE_IMPART_CHAN_DEPARTABLE)) {
00202       ast_bridge_features_destroy(features);
00203       ast_channel_unref(chan);
00204       return -1;
00205    }
00206    ao2_lock(p);
00207    ast_set_flag(&p->base, AST_UNREAL_CARETAKER_THREAD);
00208    ao2_unlock(p);
00209    return 0;
00210 }

struct ast_channel_tech* conf_announce_get_tech ( void   )  [read]

Get ConfBridge announce channel technology struct.

Since:
12.0.0
Returns:
ConfBridge announce channel technology.

Definition at line 141 of file conf_chan_announce.c.

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

00142 {
00143    return &announce_tech;
00144 }

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

References ao2_ref, and bridge_profile::sounds.

Referenced by conf_find_bridge_profile(), and join_conference_bridge().

02212 {
02213    *dst = *src;
02214    if (src->sounds) {
02215       ao2_ref(src->sounds, +1);
02216    }
02217 }

void conf_bridge_profile_destroy ( struct bridge_profile b_profile  ) 

Destroy a bridge profile found by 'conf_find_bridge_profile'.

Definition at line 2219 of file conf_config_parser.c.

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

02220 {
02221    if (b_profile->sounds) {
02222       ao2_ref(b_profile->sounds, -1);
02223       b_profile->sounds = NULL;
02224    }
02225 }

void conf_destroy_config ( void   ) 

destroy the information loaded from the confbridge.conf file

Definition at line 2382 of file conf_config_parser.c.

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

Referenced by conf_load_config(), and unload_module().

void conf_ended ( struct confbridge_conference conference  ) 

Callback to be called when the conference has become empty.

Parameters:
conference The conference bridge

Definition at line 1194 of file app_confbridge.c.

References ao2_lock, ao2_unlink, ao2_unlock, conf_stop_record(), and send_conf_end_event().

Referenced by transition_to_empty().

01195 {
01196    /* Called with a reference to conference */
01197    ao2_unlink(conference_bridges, conference);
01198    send_conf_end_event(conference);
01199    ao2_lock(conference);
01200    conf_stop_record(conference);
01201    ao2_unlock(conference);
01202 }

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

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

Parameters:
chan channel the bridge profile is requested for
bridge_profile_name name of the profile requested (optional)
result data 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:
bridge profile on success
NULL on failure

Definition at line 2227 of file conf_config_parser.c.

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(), ast_datastore::data, DEFAULT_BRIDGE_PROFILE, NULL, OBJ_KEY, and RAII_VAR.

Referenced by bridge_template_handler(), confbridge_exec(), and handle_cli_confbridge_show_bridge_profile().

02228 {
02229    struct bridge_profile *tmp2;
02230    struct ast_datastore *datastore = NULL;
02231    struct func_confbridge_data *b_data = NULL;
02232    RAII_VAR(struct confbridge_cfg *, cfg, ao2_global_obj_ref(cfg_handle), ao2_cleanup);
02233 
02234    if (chan && ast_strlen_zero(bridge_profile_name)) {
02235       ast_channel_lock(chan);
02236       datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL);
02237       ast_channel_unlock(chan);
02238       if (datastore) {
02239          b_data = datastore->data;
02240          if (b_data->b_usable) {
02241             conf_bridge_profile_copy(result, &b_data->b_profile);
02242             return result;
02243          }
02244       }
02245    }
02246 
02247    if (!cfg) {
02248       return NULL;
02249    }
02250    if (ast_strlen_zero(bridge_profile_name)) {
02251       bridge_profile_name = DEFAULT_BRIDGE_PROFILE;
02252    }
02253    if (!(tmp2 = ao2_find(cfg->bridge_profiles, bridge_profile_name, OBJ_KEY))) {
02254       return NULL;
02255    }
02256    ao2_lock(tmp2);
02257    conf_bridge_profile_copy(result, tmp2);
02258    ao2_unlock(tmp2);
02259    ao2_ref(tmp2, -1);
02260 
02261    return result;
02262 }

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:
1 success, entry is found and stored in result
0 failure, no entry found for given DTMF sequence

Definition at line 2298 of file conf_config_parser.c.

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

Referenced by action_playback_and_continue().

02299 {
02300    struct conf_menu_entry *menu_entry = NULL;
02301 
02302    ao2_lock(menu);
02303    AST_LIST_TRAVERSE(&menu->entries, menu_entry, entry) {
02304       if (!strcasecmp(menu_entry->dtmf, dtmf_sequence)) {
02305          copy_menu_entry(result, menu_entry);
02306          ao2_unlock(menu);
02307          return 1;
02308       }
02309    }
02310    ao2_unlock(menu);
02311 
02312    return 0;
02313 }

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

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

Parameters:
chan channel the user profile is requested for
user_profile_name name of the profile requested (optional)
result data 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:
user profile on success
NULL on failure

Definition at line 2174 of file conf_config_parser.c.

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(), ast_datastore::data, DEFAULT_USER_PROFILE, NULL, OBJ_KEY, RAII_VAR, func_confbridge_data::u_profile, and func_confbridge_data::u_usable.

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

02175 {
02176    struct user_profile *tmp2;
02177    struct ast_datastore *datastore = NULL;
02178    struct func_confbridge_data *b_data = NULL;
02179    RAII_VAR(struct confbridge_cfg *, cfg, ao2_global_obj_ref(cfg_handle), ao2_cleanup);
02180 
02181    if (chan && ast_strlen_zero(user_profile_name)) {
02182       ast_channel_lock(chan);
02183       datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL);
02184       ast_channel_unlock(chan);
02185       if (datastore) {
02186          b_data = datastore->data;
02187          if (b_data->u_usable) {
02188             conf_user_profile_copy(result, &b_data->u_profile);
02189             return result;
02190          }
02191       }
02192    }
02193 
02194    if (!cfg) {
02195       return NULL;
02196    }
02197    if (ast_strlen_zero(user_profile_name)) {
02198       user_profile_name = DEFAULT_USER_PROFILE;
02199    }
02200    if (!(tmp2 = ao2_find(cfg->user_profiles, user_profile_name, OBJ_KEY))) {
02201       return NULL;
02202    }
02203    ao2_lock(tmp2);
02204    conf_user_profile_copy(result, tmp2);
02205    ao2_unlock(tmp2);
02206    ao2_ref(tmp2, -1);
02207 
02208    return result;
02209 }

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

References bridge_profile_sounds::begin, CONF_SOUND_BEGIN, 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_mute(), action_toggle_mute_participants(), announce_user_count(), conf_get_pin(), conf_handle_inactive_waitmarked(), conf_handle_only_unmarked(), confbridge_exec(), execute_menu_entry(), handle_cli_confbridge_show_bridge_profile(), join_conference_bridge(), leave_marked(), and post_join_play_begin().

00392 {
00393    switch (sound) {
00394    case CONF_SOUND_HAS_JOINED:
00395       return S_OR(custom_sounds->hasjoin, "conf-hasjoin");
00396    case CONF_SOUND_HAS_LEFT:
00397       return S_OR(custom_sounds->hasleft, "conf-hasleft");
00398    case CONF_SOUND_KICKED:
00399       return S_OR(custom_sounds->kicked, "conf-kicked");
00400    case CONF_SOUND_MUTED:
00401       return S_OR(custom_sounds->muted, "conf-muted");
00402    case CONF_SOUND_UNMUTED:
00403       return S_OR(custom_sounds->unmuted, "conf-unmuted");
00404    case CONF_SOUND_ONLY_ONE:
00405       return S_OR(custom_sounds->onlyone, "conf-onlyone");
00406    case CONF_SOUND_THERE_ARE:
00407       return S_OR(custom_sounds->thereare, "conf-thereare");
00408    case CONF_SOUND_OTHER_IN_PARTY:
00409       return S_OR(custom_sounds->otherinparty, "conf-otherinparty");
00410    case CONF_SOUND_PLACE_IN_CONF:
00411       return S_OR(custom_sounds->placeintoconf, "conf-placeintoconf");
00412    case CONF_SOUND_WAIT_FOR_LEADER:
00413       return S_OR(custom_sounds->waitforleader, "conf-waitforleader");
00414    case CONF_SOUND_LEADER_HAS_LEFT:
00415       return S_OR(custom_sounds->leaderhasleft, "conf-leaderhasleft");
00416    case CONF_SOUND_GET_PIN:
00417       return S_OR(custom_sounds->getpin, "conf-getpin");
00418    case CONF_SOUND_INVALID_PIN:
00419       return S_OR(custom_sounds->invalidpin, "conf-invalidpin");
00420    case CONF_SOUND_ONLY_PERSON:
00421       return S_OR(custom_sounds->onlyperson, "conf-onlyperson");
00422    case CONF_SOUND_LOCKED:
00423       return S_OR(custom_sounds->locked, "conf-locked");
00424    case CONF_SOUND_LOCKED_NOW:
00425       return S_OR(custom_sounds->lockednow, "conf-lockednow");
00426    case CONF_SOUND_UNLOCKED_NOW:
00427       return S_OR(custom_sounds->unlockednow, "conf-unlockednow");
00428    case CONF_SOUND_ERROR_MENU:
00429       return S_OR(custom_sounds->errormenu, "conf-errormenu");
00430    case CONF_SOUND_JOIN:
00431       return S_OR(custom_sounds->join, "confbridge-join");
00432    case CONF_SOUND_LEAVE:
00433       return S_OR(custom_sounds->leave, "confbridge-leave");
00434    case CONF_SOUND_PARTICIPANTS_MUTED:
00435       return S_OR(custom_sounds->participantsmuted, "conf-now-muted");
00436    case CONF_SOUND_PARTICIPANTS_UNMUTED:
00437       return S_OR(custom_sounds->participantsunmuted, "conf-now-unmuted");
00438    case CONF_SOUND_BEGIN:
00439       return S_OR(custom_sounds->begin, "confbridge-conf-begin");
00440    }
00441 
00442    return "";
00443 }

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_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.
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:
0 success
-1 failure

Definition at line 2196 of file app_confbridge.c.

References conf_moh_suspend(), conf_moh_unsuspend(), confbridge_user::conference, and execute_menu_entry().

Referenced by menu_hook_callback().

02200 {
02201    /* See if music on hold is playing */
02202    conf_moh_suspend(user);
02203 
02204    /* execute the list of actions associated with this menu entry */
02205    execute_menu_entry(user->conference, user, bridge_channel, menu_entry, menu);
02206 
02207    /* See if music on hold needs to be started back up again */
02208    conf_moh_unsuspend(user);
02209 
02210    return 0;
02211 }

void conf_handle_first_join ( struct confbridge_conference conference  ) 

Callback to execute any time we transition from zero to one active users.

Parameters:
conference The conference bridge with a single active user joined
Return values:
0 success
-1 failure

Definition at line 1178 of file app_confbridge.c.

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

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

01179 {
01180    ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", conference->name);
01181 }

int conf_handle_inactive_waitmarked ( struct confbridge_user user  ) 

Handle actions every time a waitmarked user joins w/o a marked user present.

Parameters:
user The waitmarked user
Return values:
0 success
-1 failure

Definition at line 1142 of file app_confbridge.c.

References ast_test_flag, confbridge_user::b_profile, conf_get_sound(), CONF_SOUND_WAIT_FOR_LEADER, play_prompt_to_user(), bridge_profile::sounds, confbridge_user::u_profile, and USER_OPT_QUIET.

Referenced by conf_default_join_waitmarked().

01143 {
01144    /* If we have not been quieted play back that they are waiting for the leader */
01145    if (!ast_test_flag(&user->u_profile, USER_OPT_QUIET) && play_prompt_to_user(user,
01146          conf_get_sound(CONF_SOUND_WAIT_FOR_LEADER, user->b_profile.sounds))) {
01147       /* user hungup while the sound was playing */
01148       return -1;
01149    }
01150    return 0;
01151 }

int conf_handle_only_unmarked ( struct confbridge_user user  ) 

Handle actions whenever an unmarked user joins an inactive conference.

Note:
These actions seem like they could apply just as well to a marked user and possibly be made to happen any time transitioning to a single state.
Parameters:
user The unmarked user

Definition at line 1153 of file app_confbridge.c.

References ast_test_flag, confbridge_user::b_profile, conf_get_sound(), CONF_SOUND_ONLY_PERSON, play_prompt_to_user(), bridge_profile::sounds, confbridge_user::u_profile, USER_OPT_NOONLYPERSON, and USER_OPT_QUIET.

Referenced by join_unmarked().

01154 {
01155    /* If audio prompts have not been quieted or this prompt quieted play it on out */
01156    if (!ast_test_flag(&user->u_profile, USER_OPT_QUIET | USER_OPT_NOONLYPERSON)) {
01157       if (play_prompt_to_user(user,
01158          conf_get_sound(CONF_SOUND_ONLY_PERSON, user->b_profile.sounds))) {
01159          /* user hungup while the sound was playing */
01160          return -1;
01161       }
01162    }
01163    return 0;
01164 }

void conf_handle_second_active ( struct confbridge_conference conference  ) 

Handle when a conference moves to having more than one active participant.

Parameters:
conference The conference bridge with more than one active participant

Definition at line 1183 of file app_confbridge.c.

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

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

01184 {
01185    /* If we are the second participant we may need to stop music on hold on the first */
01186    struct confbridge_user *first_user = AST_LIST_FIRST(&conference->active_list);
01187 
01188    if (ast_test_flag(&first_user->u_profile, USER_OPT_MUSICONHOLD)) {
01189       conf_moh_stop(first_user);
01190    }
01191    conf_update_user_mute(first_user);
01192 }

int conf_load_config ( void   ) 

load confbridge.conf file

Definition at line 2087 of file conf_config_parser.c.

References __stringify, ACO_EXACT, aco_info_init(), aco_option_register, aco_option_register_custom, aco_process_config(), ACO_PROCESS_ERROR, ACO_REGEX, announce_user_count_all_handler(), ARRAY_LEN, ast_cli_register_multiple(), BRIDGE_OPT_RECORD_CONFERENCE, BRIDGE_OPT_RECORD_FILE_APPEND, BRIDGE_OPT_RECORD_FILE_TIMESTAMP, bridge_template_handler(), CHARFLDSET, conf_destroy_config(), DEFAULT_SILENCE_THRESHOLD, DEFAULT_TALKING_THRESHOLD, error(), FLDSET, language, menu_option_handler(), menu_template_handler(), mix_interval_handler(), NULL, OPT_BOOLFLAG_T, OPT_CHAR_ARRAY_T, OPT_NOOP_T, OPT_UINT_T, PARSE_DEFAULT, sound_option_handler(), USER_OPT_ADMIN, USER_OPT_ANNOUNCE_JOIN_LEAVE, USER_OPT_ANNOUNCE_JOIN_LEAVE_REVIEW, USER_OPT_ANNOUNCEUSERCOUNT, USER_OPT_DENOISE, USER_OPT_DROP_SILENCE, USER_OPT_DTMF_PASS, USER_OPT_ENDMARKED, USER_OPT_JITTERBUFFER, USER_OPT_MARKEDUSER, USER_OPT_MUSICONHOLD, USER_OPT_NOONLYPERSON, USER_OPT_QUIET, USER_OPT_STARTMUTED, USER_OPT_TALKER_DETECT, USER_OPT_WAITMARKED, user_template_handler(), and video_mode_handler().

Referenced by load_module().

02088 {
02089    if (aco_info_init(&cfg_info)) {
02090       return -1;
02091    }
02092 
02093    /* User options */
02094    aco_option_register(&cfg_info, "type", ACO_EXACT, user_types, NULL, OPT_NOOP_T, 0, 0);
02095    aco_option_register(&cfg_info, "admin", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ADMIN);
02096    aco_option_register(&cfg_info, "marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MARKEDUSER);
02097    aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);
02098    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);
02099    aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);
02100    aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);
02101    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);
02102    /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */
02103    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);
02104    aco_option_register(&cfg_info, "wait_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_WAITMARKED);
02105    aco_option_register(&cfg_info, "end_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKED);
02106    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);
02107    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);
02108    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);
02109    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);
02110    aco_option_register(&cfg_info, "pin", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, pin));
02111    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));
02112    aco_option_register(&cfg_info, "announcement", ACO_EXACT, user_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct user_profile, announcement));
02113    aco_option_register(&cfg_info, "denoise", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DENOISE);
02114    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);
02115    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));
02116    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));
02117    aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_JITTERBUFFER);
02118    /* This option should only be used with the CONFBRIDGE dialplan function */
02119    aco_option_register_custom(&cfg_info, "template", ACO_EXACT, user_types, NULL, user_template_handler, 0);
02120 
02121 /* XXX ASTERISK-21271 need a user supplied bridge merge_priority to merge ConfBridges (default = 1, range 1-INT_MAX) */
02122    /* Bridge options */
02123    aco_option_register(&cfg_info, "type", ACO_EXACT, bridge_types, NULL, OPT_NOOP_T, 0, 0);
02124    aco_option_register(&cfg_info, "jitterbuffer", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), USER_OPT_JITTERBUFFER);
02125    /* "auto" will fail to parse as a uint, but we use PARSE_DEFAULT to set the value to 0 in that case, which is the value that auto resolves to */
02126    aco_option_register(&cfg_info, "internal_sample_rate", ACO_EXACT, bridge_types, "0", OPT_UINT_T, PARSE_DEFAULT, FLDSET(struct bridge_profile, internal_sample_rate), 0);
02127    aco_option_register_custom(&cfg_info, "mixing_interval", ACO_EXACT, bridge_types, "20", mix_interval_handler, 0);
02128    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);
02129    aco_option_register_custom(&cfg_info, "video_mode", ACO_EXACT, bridge_types, NULL, video_mode_handler, 0);
02130    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);
02131    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);
02132    aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
02133    aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
02134    aco_option_register(&cfg_info, "record_options", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_options));
02135    aco_option_register(&cfg_info, "record_command", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_command));
02136    aco_option_register(&cfg_info, "language", ACO_EXACT, bridge_types, "en", OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, language));
02137    aco_option_register_custom(&cfg_info, "^sound_", ACO_REGEX, bridge_types, NULL, sound_option_handler, 0);
02138    /* This option should only be used with the CONFBRIDGE dialplan function */
02139    aco_option_register_custom(&cfg_info, "template", ACO_EXACT, bridge_types, NULL, bridge_template_handler, 0);
02140 
02141    /* Menu options */
02142    aco_option_register(&cfg_info, "type", ACO_EXACT, menu_types, NULL, OPT_NOOP_T, 0, 0);
02143    aco_option_register_custom(&cfg_info, "template", ACO_EXACT, menu_types, NULL, menu_template_handler, 0);
02144    aco_option_register_custom(&cfg_info, "^[0-9A-D*#]+$", ACO_REGEX, menu_types, NULL, menu_option_handler, 0);
02145 
02146    if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
02147       goto error;
02148    }
02149 
02150    if (ast_cli_register_multiple(cli_confbridge_parser, ARRAY_LEN(cli_confbridge_parser))) {
02151       goto error;
02152    }
02153 
02154    return 0;
02155 error:
02156    conf_destroy_config();
02157    return -1;
02158 }

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

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

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

02291 {
02292    struct conf_menu_action *menu_action = NULL;
02293    while ((menu_action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {
02294       ast_free(menu_action);
02295    }
02296 }

void conf_moh_start ( struct confbridge_user user  ) 

Start MOH for the conference user.

Parameters:
user Conference user to start MOH on.
Returns:
Nothing

Definition at line 1081 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, user_profile::moh_class, NULL, confbridge_user::playing_moh, confbridge_user::suspended_moh, and confbridge_user::u_profile.

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

01082 {
01083    user->playing_moh = 1;
01084    if (!user->suspended_moh) {
01085       int in_bridge;
01086 
01087       /*
01088        * Locking the ast_bridge here is the only way to hold off the
01089        * call to ast_bridge_join() in confbridge_exec() from
01090        * interfering with the bridge and MOH operations here.
01091        */
01092       ast_bridge_lock(user->conference->bridge);
01093 
01094       /*
01095        * Temporarily suspend the user from the bridge so we have
01096        * control to start MOH if needed.
01097        */
01098       in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
01099       ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
01100       if (in_bridge) {
01101          ast_bridge_unsuspend(user->conference->bridge, user->chan);
01102       }
01103 
01104       ast_bridge_unlock(user->conference->bridge);
01105    }
01106 }

void conf_moh_stop ( struct confbridge_user user  ) 

Stop MOH for the conference user.

Parameters:
user Conference user to stop MOH on.
Returns:
Nothing

Definition at line 1054 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(), conf_handle_second_active(), leave_marked(), leave_unmarked(), and transition_to_marked().

01055 {
01056    user->playing_moh = 0;
01057    if (!user->suspended_moh) {
01058       int in_bridge;
01059 
01060       /*
01061        * Locking the ast_bridge here is the only way to hold off the
01062        * call to ast_bridge_join() in confbridge_exec() from
01063        * interfering with the bridge and MOH operations here.
01064        */
01065       ast_bridge_lock(user->conference->bridge);
01066 
01067       /*
01068        * Temporarily suspend the user from the bridge so we have
01069        * control to stop MOH if needed.
01070        */
01071       in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
01072       ast_moh_stop(user->chan);
01073       if (in_bridge) {
01074          ast_bridge_unsuspend(user->conference->bridge, user->chan);
01075       }
01076 
01077       ast_bridge_unlock(user->conference->bridge);
01078    }
01079 }

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:
conference A conference bridge containing a single user

Definition at line 3269 of file app_confbridge.c.

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

Referenced by transition_to_single(), and transition_to_single_marked().

03270 {
03271    struct confbridge_user *only_user = AST_LIST_FIRST(&conference->active_list);
03272 
03273    /* Turn on MOH if the single participant is set up for it */
03274    if (ast_test_flag(&only_user->u_profile, USER_OPT_MUSICONHOLD)) {
03275       conf_moh_start(only_user);
03276    }
03277    conf_update_user_mute(only_user);
03278 }

struct ast_channel_tech* conf_record_get_tech ( void   )  [read]

Get ConfBridge record channel technology struct.

Since:
12.0.0
Returns:
ConfBridge record channel technology.

Definition at line 104 of file conf_chan_record.c.

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

00105 {
00106    return &record_tech;
00107 }

int conf_reload_config ( void   ) 

reload confbridge.conf file

Definition at line 2160 of file conf_config_parser.c.

References aco_process_config(), and ACO_PROCESS_ERROR.

Referenced by reload().

02161 {
02162    if (aco_process_config(&cfg_info, 1) == ACO_PROCESS_ERROR) {
02163       /* On a reload, just keep the config we already have in place. */
02164       return -1;
02165    }
02166    return 0;
02167 }

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:
conference The conference bridge to remove the user from
user The conference bridge user to remove from the conference

Definition at line 3256 of file app_confbridge.c.

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

Referenced by leave_active(), and leave_unmarked().

03257 {
03258    AST_LIST_REMOVE(&conference->active_list, user, list);
03259    conference->activeusers--;
03260 }

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:
conference The conference bridge to remove the user from
user The conference bridge user to remove from the conference

Definition at line 3262 of file app_confbridge.c.

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

Referenced by leave_marked().

03263 {
03264    AST_LIST_REMOVE(&conference->active_list, user, list);
03265    conference->activeusers--;
03266    conference->markedusers--;
03267 }

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:
conference The conference bridge to remove the user from
user The conference bridge user to remove from the conference

Definition at line 3280 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().

03281 {
03282    AST_LIST_REMOVE(&conference->waiting_list, user, list);
03283    conference->waitingusers--;
03284 }

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:
chan channel the menu profile is requested for
user user profile the menu is being applied to
menu_profile_name name 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:
0 on success
-1 on failure

Definition at line 2344 of file conf_config_parser.c.

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, ast_datastore::data, DEFAULT_MENU_PROFILE, func_confbridge_data::m_usable, func_confbridge_data::menu, dtmf_menu_hook_pvt::menu, NULL, OBJ_KEY, and RAII_VAR.

Referenced by confbridge_exec().

02345 {
02346    RAII_VAR(struct confbridge_cfg *, cfg, ao2_global_obj_ref(cfg_handle), ao2_cleanup);
02347    RAII_VAR(struct conf_menu *, menu, NULL, ao2_cleanup);
02348 
02349    if (chan && ast_strlen_zero(menu_profile_name)) {
02350       struct ast_datastore *datastore;
02351       struct func_confbridge_data *b_data;
02352 
02353       ast_channel_lock(chan);
02354       datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL);
02355       ast_channel_unlock(chan);
02356       if (datastore) {
02357          /* If a menu exists in the CONFBRIDGE function datastore, use it. */
02358          b_data = datastore->data;
02359          if (b_data->m_usable) {
02360             menu = ao2_bump(b_data->menu);
02361             return apply_menu_to_user(user, menu);
02362          }
02363       }
02364    }
02365 
02366    /* Otherwise, we need to get whatever menu profile is specified to use (or default). */
02367    if (!cfg) {
02368       return -1;
02369    }
02370 
02371    if (ast_strlen_zero(menu_profile_name)) {
02372       menu_profile_name = DEFAULT_MENU_PROFILE;
02373    }
02374 
02375    if (!(menu = ao2_find(cfg->menus, menu_profile_name, OBJ_KEY))) {
02376       return -1;
02377    }
02378 
02379    return apply_menu_to_user(user, menu);
02380 }

void conf_update_user_mute ( struct confbridge_user user  ) 

Update the actual mute status of the user and set it on the bridge.

Parameters:
user User to update the mute status.
Returns:
Nothing

Definition at line 1021 of file app_confbridge.c.

References ast_channel_name(), ast_debug, ast_test_flag, ast_test_suite_event_notify, confbridge_user::b_profile, confbridge_user::chan, confbridge_user::conference, confbridge_user::features, confbridge_conference::markedusers, ast_bridge_features::mute, confbridge_user::muted, bridge_profile::name, confbridge_user::playing_moh, confbridge_user::u_profile, and USER_OPT_WAITMARKED.

Referenced by action_toggle_mute(), action_toggle_mute_participants(), conf_handle_second_active(), conf_mute_moh_inactive_waitmarked(), conf_mute_only_active(), generic_mute_unmute_user(), join_active(), join_marked(), join_unmarked(), leave_marked(), and transition_to_marked().

01022 {
01023    int mute_user;
01024    int mute_system;
01025    int mute_effective;
01026 
01027    /* User level mute request. */
01028    mute_user = user->muted;
01029 
01030    /* System level mute request. */
01031    mute_system = user->playing_moh
01032       /*
01033        * Do not allow waitmarked users to talk to anyone unless there
01034        * is a marked user present.
01035        */
01036       || (!user->conference->markedusers
01037          && ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED));
01038 
01039    mute_effective = mute_user || mute_system;
01040 
01041    ast_debug(1, "User %s is %s: user:%d system:%d.\n",
01042       ast_channel_name(user->chan), mute_effective ? "muted" : "unmuted",
01043       mute_user, mute_system);
01044    user->features.mute = mute_effective;
01045    ast_test_suite_event_notify("CONF_MUTE_UPDATE",
01046       "Mode: %s\r\n"
01047       "Conference: %s\r\n"
01048       "Channel: %s",
01049       mute_effective ? "muted" : "unmuted",
01050       user->b_profile.name,
01051       ast_channel_name(user->chan));
01052 }

struct stasis_message_type* confbridge_end_type ( void   )  [read]

get the confbridge end stasis message type

Since:
12.0
Return values:
stasis message type for confbridge end messages if it's available
NULL if it isn't

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

struct stasis_message_type* confbridge_join_type ( void   )  [read]

get the confbridge join stasis message type

Since:
12.0
Return values:
stasis message type for confbridge join messages if it's available
NULL if it isn't

Referenced by manager_confbridge_init(), manager_confbridge_shutdown(), and send_join_event().

struct stasis_message_type* confbridge_leave_type ( void   )  [read]

get the confbridge leave stasis message type

Since:
12.0
Return values:
stasis message type for confbridge leave messages if it's available
NULL if it isn't

Referenced by manager_confbridge_init(), manager_confbridge_shutdown(), and send_leave_event().

struct stasis_message_type* confbridge_mute_type ( void   )  [read]

get the confbridge mute stasis message type

Since:
12.0
Return values:
stasis message type for confbridge mute messages if it's available
NULL if it isn't

Referenced by manager_confbridge_init(), manager_confbridge_shutdown(), and send_mute_event().

struct stasis_message_type* confbridge_start_record_type ( void   )  [read]

get the confbridge start_record stasis message type

Since:
12.0
Return values:
stasis message type for confbridge start_record messages if it's available
NULL if it isn't

Referenced by manager_confbridge_init(), manager_confbridge_shutdown(), and send_start_record_event().

struct stasis_message_type* confbridge_start_type ( void   )  [read]

get the confbridge start stasis message type

Since:
12.0
Return values:
stasis message type for confbridge start messages if it's available
NULL if it isn't

Referenced by manager_confbridge_init(), manager_confbridge_shutdown(), and send_conf_start_event().

struct stasis_message_type* confbridge_stop_record_type ( void   )  [read]

get the confbridge stop_record stasis message type

Since:
12.0
Return values:
stasis message type for confbridge stop_record messages if it's available
NULL if it isn't

Referenced by manager_confbridge_init(), manager_confbridge_shutdown(), and send_stop_record_event().

struct stasis_message_type* confbridge_talking_type ( void   )  [read]

get the confbridge talking stasis message type

Since:
12.0
Return values:
stasis message type for confbridge talking messages if it's available
NULL if it isn't

Referenced by conf_handle_talker_cb(), manager_confbridge_init(), and manager_confbridge_shutdown().

struct stasis_message_type* confbridge_unmute_type ( void   )  [read]

get the confbridge unmute stasis message type

Since:
12.0
Return values:
stasis message type for confbridge unmute messages if it's available
NULL if it isn't

Referenced by manager_confbridge_init(), manager_confbridge_shutdown(), and send_unmute_event().

int func_confbridge_helper ( struct ast_channel chan,
const char *  cmd,
char *  data,
const char *  value 
)

Definition at line 966 of file conf_config_parser.c.

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(), conf_bridge_profile_destroy(), ast_datastore::data, ast_variable::file, LOG_WARNING, func_confbridge_data::m_usable, func_confbridge_data::menu, menu_alloc(), ast_variable::name, NULL, parse(), bridge_profile::sounds, type, func_confbridge_data::u_profile, func_confbridge_data::u_usable, user_profile_destructor(), and ast_variable::value.

00967 {
00968    struct ast_datastore *datastore;
00969    struct func_confbridge_data *b_data;
00970    char *parse;
00971    struct ast_variable tmpvar = { 0, };
00972    AST_DECLARE_APP_ARGS(args,
00973       AST_APP_ARG(type);
00974       AST_APP_ARG(option);
00975    );
00976 
00977    if (!chan) {
00978       ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
00979       return -1;
00980    }
00981 
00982    /* parse all the required arguments and make sure they exist. */
00983    if (ast_strlen_zero(data)) {
00984       return -1;
00985    }
00986    parse = ast_strdupa(data);
00987    AST_STANDARD_APP_ARGS(args, parse);
00988    if (ast_strlen_zero(args.type) || ast_strlen_zero(args.option)) {
00989       return -1;
00990    }
00991 
00992    ast_channel_lock(chan);
00993    datastore = ast_channel_datastore_find(chan, &confbridge_datastore, NULL);
00994    if (!datastore) {
00995       datastore = ast_datastore_alloc(&confbridge_datastore, NULL);
00996       if (!datastore) {
00997          ast_channel_unlock(chan);
00998          return 0;
00999       }
01000       b_data = ast_calloc(1, sizeof(*b_data));
01001       if (!b_data) {
01002          ast_channel_unlock(chan);
01003          ast_datastore_free(datastore);
01004          return 0;
01005       }
01006       datastore->data = b_data;
01007       b_data->b_profile.sounds = bridge_profile_sounds_alloc();
01008       if (!b_data->b_profile.sounds) {
01009          ast_channel_unlock(chan);
01010          ast_datastore_free(datastore);
01011          return 0;
01012       }
01013       if (!(b_data->menu = menu_alloc("dialplan"))) {
01014          ast_channel_unlock(chan);
01015          ast_datastore_free(datastore);
01016          return 0;
01017       }
01018       ast_channel_datastore_add(chan, datastore);
01019    } else {
01020       b_data = datastore->data;
01021    }
01022    ast_channel_unlock(chan);
01023 
01024    /* SET(CONFBRIDGE(type,option)=value) */
01025    if (!value) {
01026       value = "";
01027    }
01028    tmpvar.name = args.option;
01029    tmpvar.value = value;
01030    tmpvar.file = "CONFBRIDGE";
01031    if (!strcasecmp(args.type, "bridge")) {
01032       if (!strcasecmp(args.option, "clear")) {
01033          b_data->b_usable = 0;
01034          conf_bridge_profile_destroy(&b_data->b_profile);
01035          memset(&b_data->b_profile, 0, sizeof(b_data->b_profile)) ;
01036          if (!(b_data->b_profile.sounds = bridge_profile_sounds_alloc())) {
01037             /* If this reallocation fails, the datastore has become unusable and must be destroyed. */
01038             ast_channel_lock(chan);
01039             ast_channel_datastore_remove(chan, datastore);
01040             ast_channel_unlock(chan);
01041             ast_datastore_free(datastore);
01042          }
01043          return 0;
01044       } else if (!aco_process_var(&bridge_type, "dialplan", &tmpvar, &b_data->b_profile)) {
01045          b_data->b_usable = 1;
01046          return 0;
01047       }
01048    } else if (!strcasecmp(args.type, "user")) {
01049       if (!strcasecmp(args.option, "clear")) {
01050          b_data->u_usable = 0;
01051          user_profile_destructor(&b_data->u_profile);
01052          memset(&b_data->u_profile, 0, sizeof(b_data->u_profile));
01053          return 0;
01054       } else if (!aco_process_var(&user_type, "dialplan", &tmpvar, &b_data->u_profile)) {
01055          b_data->u_usable = 1;
01056          return 0;
01057       }
01058    } else if (!strcasecmp(args.type, "menu")) {
01059       if (!strcasecmp(args.option, "clear")) {
01060          b_data->m_usable = 0;
01061          ao2_cleanup(b_data->menu);
01062          if (!(b_data->menu = menu_alloc("dialplan"))) {
01063             /* If this reallocation fails, the datastore has become unusable and must be destroyed */
01064             ast_channel_lock(chan);
01065             ast_channel_datastore_remove(chan, datastore);
01066             ast_channel_unlock(chan);
01067             ast_datastore_free(datastore);
01068          }
01069          return 0;
01070       } else if (!aco_process_var(&menu_type, "dialplan", &tmpvar, b_data->menu)) {
01071          b_data->m_usable = 1;
01072          return 0;
01073       }
01074    }
01075 
01076    ast_log(LOG_WARNING, "%s(%s,%s) cannot be set to '%s'. Invalid type, option, or value.\n",
01077       cmd, args.type, args.option, value);
01078    return -1;
01079 }

int manager_confbridge_init ( void   ) 

register stasis message routers to handle manager events for confbridge messages

Since:
12.0
Return values:
0 success
non-zero failure

Definition at line 393 of file confbridge_manager.c.

References ast_bridge_topic_all_cached(), ast_channel_topic_all_cached(), 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(), manager_confbridge_shutdown(), NULL, stasis_message_router_add(), stasis_message_router_create(), and STASIS_MESSAGE_TYPE_INIT.

Referenced by load_module().

00394 {
00395    STASIS_MESSAGE_TYPE_INIT(confbridge_start_type);
00396    STASIS_MESSAGE_TYPE_INIT(confbridge_end_type);
00397    STASIS_MESSAGE_TYPE_INIT(confbridge_join_type);
00398    STASIS_MESSAGE_TYPE_INIT(confbridge_leave_type);
00399    STASIS_MESSAGE_TYPE_INIT(confbridge_start_record_type);
00400    STASIS_MESSAGE_TYPE_INIT(confbridge_stop_record_type);
00401    STASIS_MESSAGE_TYPE_INIT(confbridge_mute_type);
00402    STASIS_MESSAGE_TYPE_INIT(confbridge_unmute_type);
00403    STASIS_MESSAGE_TYPE_INIT(confbridge_talking_type);
00404 
00405    bridge_state_router = stasis_message_router_create(
00406       ast_bridge_topic_all_cached());
00407 
00408    if (!bridge_state_router) {
00409       return -1;
00410    }
00411 
00412    if (stasis_message_router_add(bridge_state_router,
00413          confbridge_start_type(),
00414          confbridge_start_cb,
00415          NULL)) {
00416       manager_confbridge_shutdown();
00417       return -1;
00418    }
00419    if (stasis_message_router_add(bridge_state_router,
00420          confbridge_end_type(),
00421          confbridge_end_cb,
00422          NULL)) {
00423       manager_confbridge_shutdown();
00424       return -1;
00425    }
00426    if (stasis_message_router_add(bridge_state_router,
00427          confbridge_join_type(),
00428          confbridge_join_cb,
00429          NULL)) {
00430       manager_confbridge_shutdown();
00431       return -1;
00432    }
00433    if (stasis_message_router_add(bridge_state_router,
00434          confbridge_leave_type(),
00435          confbridge_leave_cb,
00436          NULL)) {
00437       manager_confbridge_shutdown();
00438       return -1;
00439    }
00440    if (stasis_message_router_add(bridge_state_router,
00441          confbridge_start_record_type(),
00442          confbridge_start_record_cb,
00443          NULL)) {
00444       manager_confbridge_shutdown();
00445       return -1;
00446    }
00447    if (stasis_message_router_add(bridge_state_router,
00448          confbridge_stop_record_type(),
00449          confbridge_stop_record_cb,
00450          NULL)) {
00451       manager_confbridge_shutdown();
00452       return -1;
00453    }
00454    if (stasis_message_router_add(bridge_state_router,
00455          confbridge_mute_type(),
00456          confbridge_mute_cb,
00457          NULL)) {
00458       manager_confbridge_shutdown();
00459       return -1;
00460    }
00461    if (stasis_message_router_add(bridge_state_router,
00462          confbridge_unmute_type(),
00463          confbridge_unmute_cb,
00464          NULL)) {
00465       manager_confbridge_shutdown();
00466       return -1;
00467    }
00468    if (stasis_message_router_add(bridge_state_router,
00469          confbridge_talking_type(),
00470          confbridge_talking_cb,
00471          NULL)) {
00472       manager_confbridge_shutdown();
00473       return -1;
00474    }
00475 
00476    channel_state_router = stasis_message_router_create(
00477       ast_channel_topic_all_cached());
00478 
00479    if (!channel_state_router) {
00480       manager_confbridge_shutdown();
00481       return -1;
00482    }
00483 
00484    if (stasis_message_router_add(channel_state_router,
00485          confbridge_start_type(),
00486          confbridge_start_cb,
00487          NULL)) {
00488       manager_confbridge_shutdown();
00489       return -1;
00490    }
00491    if (stasis_message_router_add(channel_state_router,
00492          confbridge_end_type(),
00493          confbridge_end_cb,
00494          NULL)) {
00495       manager_confbridge_shutdown();
00496       return -1;
00497    }
00498    if (stasis_message_router_add(channel_state_router,
00499          confbridge_join_type(),
00500          confbridge_join_cb,
00501          NULL)) {
00502       manager_confbridge_shutdown();
00503       return -1;
00504    }
00505    if (stasis_message_router_add(channel_state_router,
00506          confbridge_leave_type(),
00507          confbridge_leave_cb,
00508          NULL)) {
00509       manager_confbridge_shutdown();
00510       return -1;
00511    }
00512    if (stasis_message_router_add(channel_state_router,
00513          confbridge_start_record_type(),
00514          confbridge_start_record_cb,
00515          NULL)) {
00516       manager_confbridge_shutdown();
00517       return -1;
00518    }
00519    if (stasis_message_router_add(channel_state_router,
00520          confbridge_stop_record_type(),
00521          confbridge_stop_record_cb,
00522          NULL)) {
00523       manager_confbridge_shutdown();
00524       return -1;
00525    }
00526    if (stasis_message_router_add(channel_state_router,
00527          confbridge_mute_type(),
00528          confbridge_mute_cb,
00529          NULL)) {
00530       manager_confbridge_shutdown();
00531       return -1;
00532    }
00533    if (stasis_message_router_add(channel_state_router,
00534          confbridge_unmute_type(),
00535          confbridge_unmute_cb,
00536          NULL)) {
00537       manager_confbridge_shutdown();
00538       return -1;
00539    }
00540    if (stasis_message_router_add(channel_state_router,
00541          confbridge_talking_type(),
00542          confbridge_talking_cb,
00543          NULL)) {
00544       manager_confbridge_shutdown();
00545       return -1;
00546    }
00547 
00548    return 0;
00549 }

void manager_confbridge_shutdown ( void   ) 

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

Play sound file into conference bridge.

Parameters:
conference The conference bridge to play sound file into
filename Sound file to play
Return values:
0 success
-1 failure

Definition at line 1468 of file app_confbridge.c.

References play_sound_helper().

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

01469 {
01470    return play_sound_helper(conference, filename, -1);
01471 }


Variable Documentation

Container to hold all conference bridges in progress.

Definition at line 334 of file app_confbridge.c.

Referenced by announce_request().


Generated on Thu Apr 16 06:30:22 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6