app_page and app_confbridge: Fix custom announcement on entering conference.

The Page and ConfBridge custom announcement did not play when users
entered the conference.

* Fix the CONFBRIDGE(user,announcement) file not getting played.  The code
to do this got removed accidentally when the ConfBridge code was
restructured to be more state machine like.

* Fixed play_prompt_to_user() doxygen comments.

* Fixed the Page A(x) and n options for the caller.  The caller never
played the announcement file and totally ignored the n option.  The code
to do this was lost when the application was converted to use ConfBridge.

* Factored out setup_profile_bridge(), setup_profile_paged(), and
setup_profile_caller() routines to setup ConfBridge profiles.  Made each
profile setup routine use the default template if one has not already been
setup by dialplan.

(closes issue ASTERISK-20990)
Reported by: Jeremy Kister
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@380894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-02-05 19:09:40 +00:00
parent ef0433e6bc
commit 3e5f384eb9
2 changed files with 79 additions and 29 deletions

View File

@@ -739,9 +739,8 @@ static int announce_user_count(struct conference_bridge *conference_bridge, stru
/*!
* \brief Play back an audio file to a channel
*
* \param conference_bridge Conference bridge they are in
* \param chan Channel to play audio prompt to
* \param file Prompt to play
* \param cbu User to play audio prompt to
* \param filename Prompt to play
*
* \return Returns 0 on success, -1 if the user hung up
* \note Generally this should be called when the conference is unlocked to avoid blocking
@@ -1207,6 +1206,15 @@ static struct conference_bridge *join_conference_bridge(const char *name, struct
ao2_unlock(conference_bridge);
/* If an announcement is to be played play it */
if (!ast_strlen_zero(conference_bridge_user->u_profile.announcement)) {
if (play_prompt_to_user(conference_bridge_user,
conference_bridge_user->u_profile.announcement)) {
leave_conference(conference_bridge_user);
return NULL;
}
}
/* Announce number of users if need be */
if (ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_ANNOUNCEUSERCOUNT)) {
if (announce_user_count(conference_bridge, conference_bridge_user)) {
@@ -1526,7 +1534,6 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
if (args.argc > 2 && !ast_strlen_zero(args.u_profile_name)) {
u_profile_name = args.u_profile_name;
}
if (!conf_find_user_profile(chan, u_profile_name, &conference_bridge_user.u_profile)) {
ast_log(LOG_WARNING, "Conference user profile %s does not exist\n", u_profile_name);
res = -1;