[svn-commits] kmoore: trunk r407859 - in /trunk: ./ apps/ apps/confbridge/ apps/confbridge/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Feb 10 10:01:40 CST 2014


Author: kmoore
Date: Mon Feb 10 10:01:37 2014
New Revision: 407859

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407859
Log:
ConfBridge: Correct prompt playback target

Currently, when the first marked user enters the conference that
contains waitmarked users, a prompt is played indicating that the user
is being placed into the conference. Unfortunately, this prompt is
played to the marked user and not the waitmarked users which is not
very helpful.

This patch changes that behavior to play a prompt stating
"The conference will now begin" to the entire conference after adding
and unmuting the waitmarked users since the design of confbridge is not
conducive to playing a prompt to a subset of users in a conference in
an asynchronous manner.

(closes issue PQ-1396)
Review: https://reviewboard.asterisk.org/r/3155/
Reported by: Steve Pitts
........

Merged revisions 407857 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407858 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/UPGRADE.txt
    trunk/apps/app_confbridge.c
    trunk/apps/confbridge/conf_config_parser.c
    trunk/apps/confbridge/conf_state_empty.c
    trunk/apps/confbridge/conf_state_multi_marked.c
    trunk/apps/confbridge/include/confbridge.h
    trunk/configs/confbridge.conf.sample

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/trunk/UPGRADE.txt?view=diff&rev=407859&r1=407858&r2=407859
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Mon Feb 10 10:01:37 2014
@@ -20,6 +20,11 @@
 === UPGRADE-11.txt  -- Upgrade info for 10 to 11
 === UPGRADE-12.txt  -- Upgrade info for 11 to 12
 ===========================================================
+* The sound_place_into_conference sound used in Confbridge is now deprecated
+  and is no longer functional since it has been broken since its inception
+  and the fix involved using a different method to achieve the same goal. The
+  new method to achieve this functionality is by using sound_begin to play
+  a sound to the conference when waitmarked users are moved into the conference.
 
 From 12 to 13:
 

Modified: trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=407859&r1=407858&r2=407859
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Mon Feb 10 10:01:37 2014
@@ -430,6 +430,8 @@
 		return S_OR(custom_sounds->participantsmuted, "conf-now-muted");
 	case CONF_SOUND_PARTICIPANTS_UNMUTED:
 		return S_OR(custom_sounds->participantsunmuted, "conf-now-unmuted");
+	case CONF_SOUND_BEGIN:
+		return S_OR(custom_sounds->begin, "confbridge-conf-begin");
 	}
 
 	return "";
@@ -1095,14 +1097,6 @@
 		ast_moh_stop(user->chan);
 	}
 	ao2_unlock(user->conference);
-}
-
-int conf_handle_first_marked_common(struct confbridge_user *user)
-{
-	if (!ast_test_flag(&user->u_profile, USER_OPT_QUIET) && play_prompt_to_user(user, conf_get_sound(CONF_SOUND_PLACE_IN_CONF, user->b_profile.sounds))) {
-		return -1;
-	}
-	return 0;
 }
 
 int conf_handle_inactive_waitmarked(struct confbridge_user *user)

Modified: trunk/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/confbridge/conf_config_parser.c?view=diff&rev=407859&r1=407858&r2=407859
==============================================================================
--- trunk/apps/confbridge/conf_config_parser.c (original)
+++ trunk/apps/confbridge/conf_config_parser.c Mon Feb 10 10:01:37 2014
@@ -874,6 +874,12 @@
 	} else if (!strcasecmp(sound_name, "sound_other_in_party")) {
 		ast_string_field_set(sounds, otherinparty, sound_file);
 	} else if (!strcasecmp(sound_name, "sound_place_into_conference")) {
+		static int deprecation_warning = 1;
+		if (deprecation_warning) {
+			ast_log(LOG_WARNING, "sound_place_into_conference is deprecated"
+				" and unused. Use sound_begin for similar functionality.");
+			deprecation_warning = 0;
+		}
 		ast_string_field_set(sounds, placeintoconf, sound_file);
 	} else if (!strcasecmp(sound_name, "sound_wait_for_leader")) {
 		ast_string_field_set(sounds, waitforleader, sound_file);
@@ -899,6 +905,8 @@
 		ast_string_field_set(sounds, participantsmuted, sound_file);
 	} else if (!strcasecmp(sound_name, "sound_participants_unmuted")) {
 		ast_string_field_set(sounds, participantsunmuted, sound_file);
+	} else if (!strcasecmp(sound_name, "sound_begin")) {
+		ast_string_field_set(sounds, begin, sound_file);
 	} else {
 		return -1;
 	}
@@ -1564,6 +1572,7 @@
 	ast_cli(a->fd,"sound_leave:          %s\n", conf_get_sound(CONF_SOUND_LEAVE, b_profile.sounds));
 	ast_cli(a->fd,"sound_participants_muted:     %s\n", conf_get_sound(CONF_SOUND_PARTICIPANTS_MUTED, b_profile.sounds));
 	ast_cli(a->fd,"sound_participants_unmuted:     %s\n", conf_get_sound(CONF_SOUND_PARTICIPANTS_UNMUTED, b_profile.sounds));
+	ast_cli(a->fd,"sound_begin:          %s\n", conf_get_sound(CONF_SOUND_BEGIN, b_profile.sounds));
 	ast_cli(a->fd,"\n");
 
 	conf_bridge_profile_destroy(&b_profile);
@@ -1906,6 +1915,7 @@
 	ast_string_field_set(sounds, leave, b_profile->sounds->leave);
 	ast_string_field_set(sounds, participantsmuted, b_profile->sounds->participantsmuted);
 	ast_string_field_set(sounds, participantsunmuted, b_profile->sounds->participantsunmuted);
+	ast_string_field_set(sounds, begin, b_profile->sounds->begin);
 
 	ao2_ref(b_profile->sounds, -1); /* sounds struct copied over to it from the template by reference only. */
 	ao2_ref(oldsounds, -1);    /* original sounds struct we don't need anymore */

Modified: trunk/apps/confbridge/conf_state_empty.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/confbridge/conf_state_empty.c?view=diff&rev=407859&r1=407858&r2=407859
==============================================================================
--- trunk/apps/confbridge/conf_state_empty.c (original)
+++ trunk/apps/confbridge/conf_state_empty.c Mon Feb 10 10:01:37 2014
@@ -73,7 +73,6 @@
 {
 	conf_add_user_marked(user->conference, user);
 	conf_handle_first_join(user->conference);
-	conf_add_post_join_action(user, conf_handle_first_marked_common);
 
 	conf_change_state(user, CONF_STATE_SINGLE_MARKED);
 }

Modified: trunk/apps/confbridge/conf_state_multi_marked.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/confbridge/conf_state_multi_marked.c?view=diff&rev=407859&r1=407858&r2=407859
==============================================================================
--- trunk/apps/confbridge/conf_state_multi_marked.c (original)
+++ trunk/apps/confbridge/conf_state_multi_marked.c Mon Feb 10 10:01:37 2014
@@ -171,14 +171,21 @@
 	}
 }
 
+static int post_join_play_begin(struct confbridge_user *cbu)
+{
+	int res;
+
+	ast_autoservice_start(cbu->chan);
+	res = play_sound_file(cbu->conference,
+		conf_get_sound(CONF_SOUND_BEGIN, cbu->b_profile.sounds));
+	ast_autoservice_stop(cbu->chan);
+	return res;
+}
+
 static void transition_to_marked(struct confbridge_user *user)
 {
 	struct confbridge_user *user_iter;
-
-	/* Play the audio file stating they are going to be placed into the conference */
-	if (user->conference->markedusers == 1 && ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER)) {
-		conf_handle_first_marked_common(user);
-	}
+	int waitmarked_moved = 0;
 
 	/* Move all waiting users to active, stopping MOH and unmuting if necessary */
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&user->conference->waiting_list, user_iter, list) {
@@ -190,6 +197,15 @@
 			conf_moh_stop(user_iter);
 		}
 		conf_update_user_mute(user_iter);
+		waitmarked_moved++;
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
-}
+
+	/* Play the audio file stating that the conference is beginning */
+	if (user->conference->markedusers == 1
+		&& ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER)
+		&& !ast_test_flag(&user->u_profile, USER_OPT_QUIET)
+		&& waitmarked_moved) {
+		conf_add_post_join_action(user, post_join_play_begin);
+	}
+}

Modified: trunk/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/confbridge/include/confbridge.h?view=diff&rev=407859&r1=407858&r2=407859
==============================================================================
--- trunk/apps/confbridge/include/confbridge.h (original)
+++ trunk/apps/confbridge/include/confbridge.h Mon Feb 10 10:01:37 2014
@@ -163,6 +163,7 @@
 	CONF_SOUND_LEAVE,
 	CONF_SOUND_PARTICIPANTS_MUTED,
 	CONF_SOUND_PARTICIPANTS_UNMUTED,
+	CONF_SOUND_BEGIN,
 };
 
 struct bridge_profile_sounds {
@@ -189,6 +190,7 @@
 		AST_STRING_FIELD(join);
 		AST_STRING_FIELD(participantsmuted);
 		AST_STRING_FIELD(participantsunmuted);
+		AST_STRING_FIELD(begin);
 	);
 };
 
@@ -418,13 +420,6 @@
  */
 void conf_mute_only_active(struct confbridge_conference *conference);
 
-/*! \brief Callback to execute any time we transition from zero to one marked users
- * \param user The first marked user joining the conference
- * \retval 0 success
- * \retval -1 failure
- */
-int conf_handle_first_marked_common(struct confbridge_user *user);
-
 /*! \brief Callback to execute any time we transition from zero to one active users
  * \param conference The conference bridge with a single active user joined
  * \retval 0 success

Modified: trunk/configs/confbridge.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/confbridge.conf.sample?view=diff&rev=407859&r1=407858&r2=407859
==============================================================================
--- trunk/configs/confbridge.conf.sample (original)
+++ trunk/configs/confbridge.conf.sample Mon Feb 10 10:01:37 2014
@@ -232,7 +232,9 @@
                        ; The sounds are stringed together like this.
                        ; "sound_there_are" <number of participants> "sound_other_in_party"
 ;sound_place_into_conference ; The sound played when someone is placed into the conference
-                             ; after waiting for a marked user.
+                             ; after waiting for a marked user. This sound is now deprecated
+                             ; since it was only ever used improperly and correcting that bug
+                             ; made it completely unused.
 ;sound_wait_for_leader  ; The sound played when a user is placed into a conference that
                         ; can not start until a marked user enters.
 ;sound_leader_has_left  ; The sound played when the last marked user leaves the conference.
@@ -242,6 +244,7 @@
 ;sound_locked_now ; The sound played to an admin after toggling the conference to locked mode.
 ;sound_unlocked_now; The sound played to an admin after toggling the conference to unlocked mode.
 ;sound_error_menu ; The sound played when an invalid menu option is entered.
+;sound_begin ; The sound played to the conference when the first marked user enters the conference.
 
 ; --- ConfBridge Menu Options ---
 ; The ConfBridge application also has the ability to




More information about the svn-commits mailing list