]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_confbridge: Fix crash caused when waitmarked/marked users leave together
authorMatthew Jordan <mjordan@digium.com>
Thu, 9 Jan 2014 16:34:05 +0000 (16:34 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 9 Jan 2014 16:34:05 +0000 (16:34 +0000)
commitf3965b227632f3b8c609b5123430bb00c20095e5
tree6c08c36593dc7f3190c64bb1389e881be0b669d1
parentac0f7d1d6f55bef625b60da1856edc4b7e53e1dc
app_confbridge: Fix crash caused when waitmarked/marked users leave together

When waitmarked users join a ConfBridge, the conference state is transitioned
from EMPTY -> INACTIVE. In this state, the users are maintined in a waiting
users list. When a marked user joins, the ConfBridge conference transitions
from INACTIVE -> MULTI_MARKED, and all users are put onto the active list of
users. This process works correctly.

When the marked user leaves, if they are the last marked user, the MULTI_MARKED
state does the following:
(1) It plays back a message to the bridge stating that the leader has left the
    conference. This requires an unlocking of the bridge.
(2) It moves waitmarked users back to the waiting list
(3) It transitions to the appropriate state: in this case, INACTIVE

However, because it plays the prompt back to the bridge before moving the users
and before finishing the state transition, this creates a race condition: with
the bridge unlocked, waitmarked users who leave the conference (or are kicked
from it) can cause a state transition of the bridge to another state before
the conference is transitioned to the INACTIVE state. This causes the state
machine to get a bit wonky, often leading to a crash when the MULTI_MARKED state
attempts to conclude its processing.

This patch fixes this problem:
(1) It prevents kicked users from being kicked again. That's just a nicety.
(2) More importantly, it fixes the race condition by only playing the prompt
    once the state has transitioned correctly to INACTIVE. If waitmarked users
    sneak out during the prompt being played, no harm no foul.

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

(closes issue AST-1258)
Reported by: Steve Pitts
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.6@405233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_confbridge.c
apps/confbridge/conf_state_multi_marked.c