From: Kevin Harwell Date: Tue, 17 Sep 2013 14:24:02 +0000 (+0000) Subject: Confbridge: empty conference not being torn down X-Git-Tag: 11.6.0-rc1~3^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c33267453b9bc98ca08f683b1f55b8b549bc631;p=thirdparty%2Fasterisk.git Confbridge: empty conference not being torn down Confbridge would not properly tear down an empty conference bridge when all users were kicked via end_marked=yes and at least one user was also set to wait_marked. This occurred because while end_marked users were being kicked and at least one was also set to wait_marked then the leave wait_marked handler would be called on that user, but there would be no waiting user (still considered active). The waiting users would decrement and now be negative. The conference would remain, but be put into an inactive state. The solution was to move from the active list to the wait list, those users with wait_marked set right before kicking. This allows both the active and wait users to decrement correctly and the confbridge to tear down properly. A crashed also occurred when trying to list the specific conference from the CLI. This happened because the conference specified was invalid. Since the conference properly tears down now there is no way to reference it thus alleviating the crash as well. (closes issue ASTERISK-21859) Reported by: Chris Gentle Review: https://reviewboard.asterisk.org/r/2848/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@399222 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/confbridge/conf_state_multi_marked.c b/apps/confbridge/conf_state_multi_marked.c index 21c5672075..d25f65d0d4 100644 --- a/apps/confbridge/conf_state_multi_marked.c +++ b/apps/confbridge/conf_state_multi_marked.c @@ -95,6 +95,13 @@ static void leave_marked(struct conference_bridge_user *cbu) 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)) { + if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_WAITMARKED) && + !ast_test_flag(&cbu_iter->u_profile, USER_OPT_MARKEDUSER)) { + AST_LIST_REMOVE_CURRENT(list); + cbu_iter->conference_bridge->activeusers--; + AST_LIST_INSERT_TAIL(&cbu_iter->conference_bridge->waiting_list, cbu_iter, list); + cbu_iter->conference_bridge->waitingusers++; + } cbu_iter->kicked = 1; ast_bridge_remove(cbu_iter->conference_bridge->bridge, cbu_iter->chan); } else if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_WAITMARKED) &&