]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
ConfBridge: Correct prompt playback target
authorKinsey Moore <kmoore@digium.com>
Mon, 10 Feb 2014 15:28:16 +0000 (15:28 +0000)
committerKinsey Moore <kmoore@digium.com>
Mon, 10 Feb 2014 15:28:16 +0000 (15:28 +0000)
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@407857 65c4cc65-6c06-0410-ace0-fbb531ad65f3

UPGRADE.txt
apps/app_confbridge.c
apps/confbridge/conf_config_parser.c
apps/confbridge/conf_state_empty.c
apps/confbridge/conf_state_multi_marked.c
apps/confbridge/include/confbridge.h
configs/confbridge.conf.sample

index 9410d501ff9c43c948dbabdd60cec485b5919975..5250793484708f2f9f3fb5a393cd62ac3766aff4 100644 (file)
@@ -24,6 +24,11 @@ from 11.8 to 11.9
   Because of this the default settings would not load, so the minrate (minimum
   transmission rate) option was changed to default to 4800 since that is the
   minimum rate for v.27 which is included in the default modem options.
+* 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 11.7 to 11.8:
 * The per console verbose level feature as previously implemented caused a
index 59ad9fd903be4cf25a8c3fa167e1a8f98f0e6e27..a292874b7d729d9b3a35a89546735dbd132acddd 100644 (file)
@@ -371,6 +371,8 @@ const char *conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds
                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 "";
@@ -1080,14 +1082,6 @@ static void conf_moh_suspend(struct conference_bridge_user *user)
        ao2_unlock(user->conference_bridge);
 }
 
-int conf_handle_first_marked_common(struct conference_bridge_user *cbu)
-{
-       if (!ast_test_flag(&cbu->u_profile, USER_OPT_QUIET) && play_prompt_to_user(cbu, conf_get_sound(CONF_SOUND_PLACE_IN_CONF, cbu->b_profile.sounds))) {
-               return -1;
-       }
-       return 0;
-}
-
 int conf_handle_inactive_waitmarked(struct conference_bridge_user *cbu)
 {
        /* If we have not been quieted play back that they are waiting for the leader */
index e6ccddd4abf4ef1c868f5c06c4110f4823c827ae..cddf2732f6b1674b365cf6c87580edf7d4fbd351 100644 (file)
@@ -286,6 +286,12 @@ static int set_sound(const char *sound_name, const char *sound_file, struct brid
        } 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);
@@ -311,6 +317,8 @@ static int set_sound(const char *sound_name, const char *sound_file, struct brid
                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;
        }
@@ -924,6 +932,7 @@ static char *handle_cli_confbridge_show_bridge_profile(struct ast_cli_entry *e,
        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);
@@ -1266,6 +1275,7 @@ static int bridge_template_handler(const struct aco_option *opt, struct ast_vari
        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 */
index afc736d4a2156143c5035ad6b564b0634d71f621..c811986c9e2947b4f0870f8986e90da8a4af8e7e 100644 (file)
@@ -73,7 +73,6 @@ static void join_marked(struct conference_bridge_user *cbu)
 {
        conf_add_user_marked(cbu->conference_bridge, cbu);
        conf_handle_first_join(cbu->conference_bridge);
-       conf_add_post_join_action(cbu, conf_handle_first_marked_common);
 
        conf_change_state(cbu, CONF_STATE_SINGLE_MARKED);
 }
index 6089ac6f02575ff6f7ac67e0624bcdd7b434c0ee..6ba258570a59d254f7ec6197ff3a9d6e2453d190 100644 (file)
@@ -169,14 +169,21 @@ static void leave_marked(struct conference_bridge_user *cbu)
        }
 }
 
+static int post_join_play_begin(struct conference_bridge_user *cbu)
+{
+       int res;
+
+       ast_autoservice_start(cbu->chan);
+       res = play_sound_file(cbu->conference_bridge,
+               conf_get_sound(CONF_SOUND_BEGIN, cbu->b_profile.sounds));
+       ast_autoservice_stop(cbu->chan);
+       return res;
+}
+
 static void transition_to_marked(struct conference_bridge_user *cbu)
 {
        struct conference_bridge_user *cbu_iter;
-
-       /* Play the audio file stating they are going to be placed into the conference */
-       if (cbu->conference_bridge->markedusers == 1 && ast_test_flag(&cbu->u_profile, USER_OPT_MARKEDUSER)) {
-               conf_handle_first_marked_common(cbu);
-       }
+       int waitmarked_moved = 0;
 
        /* Move all waiting users to active, stopping MOH and unmuting if necessary */
        AST_LIST_TRAVERSE_SAFE_BEGIN(&cbu->conference_bridge->waiting_list, cbu_iter, list) {
@@ -188,6 +195,15 @@ static void transition_to_marked(struct conference_bridge_user *cbu)
                        conf_moh_stop(cbu_iter);
                }
                conf_update_user_mute(cbu_iter);
+               waitmarked_moved++;
        }
        AST_LIST_TRAVERSE_SAFE_END;
+
+       /* Play the audio file stating that the conference is beginning */
+       if (cbu->conference_bridge->markedusers == 1
+               && ast_test_flag(&cbu->u_profile, USER_OPT_MARKEDUSER)
+               && !ast_test_flag(&cbu->u_profile, USER_OPT_QUIET)
+               && waitmarked_moved) {
+               conf_add_post_join_action(cbu, post_join_play_begin);
+       }
 }
index 50e223e2dec5199fb3e580985aea4fdf577c1712..6d11c0526164988c9253aa311175f1fe6d0083be 100644 (file)
@@ -160,6 +160,7 @@ enum conf_sounds {
        CONF_SOUND_LEAVE,
        CONF_SOUND_PARTICIPANTS_MUTED,
        CONF_SOUND_PARTICIPANTS_UNMUTED,
+       CONF_SOUND_BEGIN,
 };
 
 struct bridge_profile_sounds {
@@ -186,6 +187,7 @@ struct bridge_profile_sounds {
                AST_STRING_FIELD(join);
                AST_STRING_FIELD(participantsmuted);
                AST_STRING_FIELD(participantsunmuted);
+               AST_STRING_FIELD(begin);
        );
 };
 
@@ -396,13 +398,6 @@ void conf_moh_start(struct conference_bridge_user *user);
  */
 void conf_mute_only_active(struct conference_bridge *conference_bridge);
 
-/*! \brief Callback to execute any time we transition from zero to one marked users
- * \param cbu The first marked user joining the conference
- * \retval 0 success
- * \retval -1 failure
- */
-int conf_handle_first_marked_common(struct conference_bridge_user *cbu);
-
 /*! \brief Callback to execute any time we transition from zero to one active users
  * \param conference_bridge The conference bridge with a single active user joined
  * \retval 0 success
index 94739a6fe5e220030129e3447fbca8f2d67a8753..9e90e61168c90dd741d747c3999322dbffc1e357 100644 (file)
@@ -227,7 +227,9 @@ type=bridge
                        ; 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.
@@ -237,6 +239,7 @@ type=bridge
 ;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