summaryrefslogtreecommitdiff
path: root/apps/confbridge/conf_state_multi_marked.c
AgeCommit message (Collapse)Author
2016-09-07ConfBridge: Make some announcements asynchronous.Mark Michelson
Confbridge announcements tend to block a channel while they are being played. In some circumstances, this is warranted since you want that particular channel not to hear the announcement (Example: "John Doe has entered the conference"). For others it makes less sense. This change first introduces methods for playing sounds asynchronously into the conference. This is very similar to how synchronous sounds are played, except the channel initiating the playback does not wait for the sound to complete before moving on. Asynchronous announcements are used for two circumstances: * Sounds played for a user after they have left the bridge * Sounds that play first to a single user and then the rest of the conference (if the channel and conference use the same language) ASTERISK-26289 #close Reported by Mark Michelson Change-Id: Ie486bb3de1646d50894489030326a423e594ab0a
2016-02-05app_confbridge: Only use b_profile options from the conference.Richard Mudgett
A user cannot set new bridge options after the conference is created by the first user. Attempting to do so is documented as undefined behavior. This patch ensures that the bridge profile options used are from the conference and not what a subsequent user may have tried to set. Change-Id: I1b6383eba654679e5739d5a8de98199cf074a266
2014-11-17apps/app_confbridge: Ensure 'normal' users hear message when last marked leavesMatthew Jordan
When r428077 was made for ASTERISK-24522, it failed to take into account users who are neither wait_marked nor end_marked. These users are *also* supposed to hear the 'leader has left the conference' message. Granted, this behaviour is a bit odd; however, that is how it used to work... and behaviour changes are not good. This patch ensures that if there are any 'normal' users present when the last marked user leaves the conference, the message will still be played to them. Note that this regression was caught by the Asterisk Test Suite's confbridge_nominal test, which has a quirky combination of users. ........ Merged revisions 428113 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428114 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428115 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-17app_confbridge: Don't play leader leaving prompt if no one will hear itMatthew Jordan
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 ........ Merged revisions 428077 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428078 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428079 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-14app_confbridge: Play "leader has left" sound even when musiconhold is enabled.Joshua Colp
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/ ........ Merged revisions 427844 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 427845 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427846 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-10ConfBridge: Correct prompt playback targetKinsey Moore
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 ........ Merged revisions 407857 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 407858 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-09app_confbridge: Fix crash caused when waitmarked/marked users leave togetherMatthew Jordan
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/ Note that the patch committed here is essentially the same as uploaded by Simon Moxon on ASTERISK-22740, with the addition of the double kick prevention. (closes issue AST-1258) Reported by: Steve Pitts (closes issue ASTERISK-22740) Reported by: Simon Moxon patches: ASTERISK-22740.diff uploaded by Simon Moxon (license 6546) ........ Merged revisions 405215 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 405216 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-09Add a CONFBRIDGE_RESULT channel variable to discern why a channel left a ↵Mark Michelson
ConfBridge. Review: https://reviewboard.asterisk.org/r/3009 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-02confbridge: Separate user muting from system muting overrides.Richard Mudgett
The system overrides the user muting requests when MOH is playing or a waitmarked user is waiting for a marked user to join. System muting overrides interfere with what the user may wish the muting to be when the system override ends. * User muting requests are now independent of the system muting overrides. The effective muting is now the logical or of the user request and system override. * Added a Muted flag to the CLI "confbridge list <conference>" command. * Added a Muted header to the AMI ConfbridgeList action ConfbridgeList event. (closes issue AST-1102) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2960/ ........ Merged revisions 402425 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 402427 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17Confbridge: empty conference not being torn downKevin Harwell
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/ ........ Merged revisions 399222 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399225 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-09confbridge: Rename items for clarity and consistency.Richard Mudgett
struct conference_bridge_user -> struct confbridge_user struct conference_bridge -> struct confbridge_conference struct conference_state -> struct confbridge_state struct conference_bridge_user *conference_bridge_user -> struct confbridge_user *user struct conference_bridge_user *cbu -> struct confbridge_user *user struct conference_bridge *conference_bridge -> struct confbridge_conference *conference The names are now generally shorter, consistently used, and don't conflict with the struct names. This patch handles the renaming part of the issue. (issue ASTERISK-20776) Reported by: rmudgett git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-05app_confbridge: Fix error messages on exiting conference.Richard Mudgett
A marked user ending a conference with only end_marked users generates error messages: ERROR[0000][C-00000000]: confbridge/conf_state.c:47 conf_invalid_event_fn: Invalid event for confbridge user '' * The MULTI_MARKED state was doing too much when it was kicking out the end_marked users from the conference. The kicked out users will clean up after themselves when they exit the conference. (closes issue ASTERISK-20991) Reported by: Jeremy Kister Tested by: rmudgett ........ Merged revisions 380892 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13confbridge: Fix MOH on simultaneous user entry to a new conference.Richard Mudgett
When two users entered a new conference simultaneously, one of the callers hears MOH. This happened if two unmarked users entered simultaneously and also if a waitmarked and a marked user entered simultaneously. * Created a confbridge internal MOH API to eliminate the inlined MOH handling code. Note that the conference mixing bridge needs to be locked when actually starting/stopping MOH because there is a small window between the conference join unsuspend MOH and actually joining the mixing bridge. * Created the concept of suspended MOH so it can be interrupted while conference join announcements to the user and DTMF features can operate. * Suspend any MOH until the user is about to actually join the mixing bridge of the conference. This way any pre-join file playback does not need to worry about MOH. * Made post-join actions only play deferred entry announcement files. Changing the user/conference state during that time is not protected or controlled by the state machine. (closes issue ASTERISK-20606) Reported by: Eugenia Belova Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2232/ ........ Merged revisions 377992 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377993 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-08Resolve issues in ConfBridge regarding marked, waitmarked, and unmarked usersMatthew Jordan
Thank's to Neil Tallim (flan)'s tireless testing, issue reporting, and patches it became clear that app_confbridge had some complex logic in how it handled interactions between marked, waitmarked, and unmarked users. In particular, there were some areas in which the interactions between the users resulted in inconsistent behavior, and app_confbridge was missing logic in how to handle some corner cases. Some areas included: * Poor handling of mixing unmarked and waitmarked users * Inconsistencies in how MOH and muting was applied to various users * Handling of various announcements for different user profile options flan's patches seem to fix the various issues, but highlighted how hard the code could be to maintain. In an attempt to make things easier to maintain and to more fully enumerate the various cases that exist, this patch breaks up the logic into a state machine-like setup. Please note that the various state transitioned are documented on the Asterisk wiki: https://wiki.asterisk.org/wiki/display/AST/Confbridge+state+changes Review: //https://reviewboard.asterisk.org/r/2072/ Note that for the following issues, mjordan uploaded the patch, although it was written by twilson. Any contributor license discrepency is due to that. (closes issue ASTERISK-19562) Reported by: flan Tested by: flan, mjordan, jrose patches: bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283) (closes issue ASTERISK-19726) Reported by: flan Tested by: flan patches: bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283) (closes issue ASTERISK-20181) Reported by: Jonathan White Tested by: Jonathan White patches: bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283) ........ Merged revisions 374652 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374657 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374658 65c4cc65-6c06-0410-ace0-fbb531ad65f3