From: Matthew Jordan Date: Mon, 17 Nov 2014 03:05:44 +0000 (+0000) Subject: app_confbridge: Don't play leader leaving prompt if no one will hear it X-Git-Tag: 11.15.0-rc1~3^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10d242b728d7496029fbd59e7bc3784935a1d4af;p=thirdparty%2Fasterisk.git app_confbridge: Don't play leader leaving prompt if no one will hear it Consider the following: - A marked user in a conference - One or more end_marked only users in the conference When the marked users leaves, we will be in the conf_state_multi_marked state. This currently will traverse the users, kicking out any who have the end_marked flags. When they are kicked, a full ast_bridge_remove is immediately called on the channels. At this time, we also unilaterally set the need_prompt flag. When the need_prompt flag is set, we then playback a sound to the bridge informing everyone that the leader has left; however, no one is left in the bridge. This causes some odd behaviour for the end_marked users - they are stuck waiting for the bridge to be unlocked. This results in them waiting for 5 or 6 seconds of dead air before hearing that they've been kicked. Unfortunately, we do have to keep the bridge locked while we're playing back the 'leader-has-left' prompt. If there are any wait_marked users in the conference, this behaviour can't be easily changed - but we do make the case of the end_marked users better with this patch. Review: https://reviewboard.asterisk.org/r/4184/ ASTERISK-24522 #close Reported by: Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@428077 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/confbridge/conf_state_multi_marked.c b/apps/confbridge/conf_state_multi_marked.c index 999996144c..6e3ba3e29a 100644 --- a/apps/confbridge/conf_state_multi_marked.c +++ b/apps/confbridge/conf_state_multi_marked.c @@ -85,8 +85,6 @@ static void leave_marked(struct conference_bridge_user *cbu) conf_remove_user_marked(cbu->conference_bridge, cbu); if (cbu->conference_bridge->markedusers == 0) { - need_prompt = 1; - AST_LIST_TRAVERSE_SAFE_BEGIN(&cbu->conference_bridge->active_list, cbu_iter, list) { /* Kick ENDMARKED cbu_iters */ if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_ENDMARKED) && !cbu_iter->kicked) { @@ -101,6 +99,8 @@ static void leave_marked(struct conference_bridge_user *cbu) ast_bridge_remove(cbu_iter->conference_bridge->bridge, cbu_iter->chan); } else if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_WAITMARKED) && !ast_test_flag(&cbu_iter->u_profile, USER_OPT_MARKEDUSER)) { + need_prompt = 1; + AST_LIST_REMOVE_CURRENT(list); cbu_iter->conference_bridge->activeusers--; AST_LIST_INSERT_TAIL(&cbu_iter->conference_bridge->waiting_list, cbu_iter, list);