]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_confbridge: Play "leader has left" sound even when musiconhold is enabled.
authorJoshua Colp <jcolp@digium.com>
Fri, 14 Nov 2014 14:54:50 +0000 (14:54 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 14 Nov 2014 14:54:50 +0000 (14:54 +0000)
Currently if the leader of a conference bridge leaves any participant
that has musiconhold enabled will not hear the "leader has left" sound.
This is because musiconhold is started and THEN the sound is played.

This change makes it so that the sound is played and THEN musiconhold
is started. This provides a better experience for users as they may not
have known previously why they went back to musiconhold.

Review: https://reviewboard.asterisk.org/r/4177/

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

apps/confbridge/conf_state_multi_marked.c

index 6ba258570a59d254f7ec6197ff3a9d6e2453d190..999996144cea84501a1c00f40b757f5c94f12de8 100644 (file)
@@ -105,12 +105,6 @@ static void leave_marked(struct conference_bridge_user *cbu)
                                cbu_iter->conference_bridge->activeusers--;
                                AST_LIST_INSERT_TAIL(&cbu_iter->conference_bridge->waiting_list, cbu_iter, list);
                                cbu_iter->conference_bridge->waitingusers++;
-
-                               /* Handle moh of cbu_iter if necessary */
-                               if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_MUSICONHOLD)) {
-                                       conf_moh_start(cbu_iter);
-                               }
-                               conf_update_user_mute(cbu_iter);
                        }
                }
                AST_LIST_TRAVERSE_SAFE_END;
@@ -166,6 +160,18 @@ static void leave_marked(struct conference_bridge_user *cbu)
                        ast_autoservice_stop(cbu->chan);
                        ao2_lock(cbu->conference_bridge);
                }
+
+               AST_LIST_TRAVERSE(&cbu->conference_bridge->waiting_list, cbu_iter, list) {
+                       if (cbu_iter->kicked) {
+                               continue;
+                       }
+
+                       if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_MUSICONHOLD)) {
+                               conf_moh_start(cbu_iter);
+                       }
+
+                       conf_update_user_mute(cbu_iter);
+               }
        }
 }