"MarkedUser: %s\r\n"
"WaitMarked: %s\r\n"
"EndMarked: %s\r\n"
+ "EndMarkedAny: %s\r\n"
"Waiting: %s\r\n"
"Muted: %s\r\n"
"Talking: %s\r\n"
AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER)),
AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED)),
AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_ENDMARKED)),
+ AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_ENDMARKEDANY)),
AST_YESNO(waiting),
AST_YESNO(user->muted),
AST_YESNO(user->talking),
<configOption name="end_marked">
<synopsis>Kick the user from the conference when the last marked user leaves</synopsis>
</configOption>
+ <configOption name="end_marked_any">
+ <synopsis>Kick the user from the conference when any marked user leaves</synopsis>
+ </configOption>
<configOption name="talk_detection_events">
<synopsis>Set whether or not notifications of when a user begins and ends talking should be sent out as events over AMI</synopsis>
</configOption>
ast_cli(a->fd,"Wait Marked: %s\n",
u_profile.flags & USER_OPT_WAITMARKED ?
"enabled" : "disabled");
- ast_cli(a->fd,"END Marked: %s\n",
+ ast_cli(a->fd,"END Marked (All): %s\n",
u_profile.flags & USER_OPT_ENDMARKED ?
"enabled" : "disabled");
+ ast_cli(a->fd,"END Marked (Any): %s\n",
+ u_profile.flags & USER_OPT_ENDMARKEDANY ?
+ "enabled" : "disabled");
ast_cli(a->fd,"Drop_silence: %s\n",
u_profile.flags & USER_OPT_DROP_SILENCE ?
"enabled" : "disabled");
aco_option_register(&cfg_info, "announce_only_user", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 0, FLDSET(struct user_profile, flags), USER_OPT_NOONLYPERSON);
aco_option_register(&cfg_info, "wait_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_WAITMARKED);
aco_option_register(&cfg_info, "end_marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKED);
+ aco_option_register(&cfg_info, "end_marked_any", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ENDMARKEDANY);
aco_option_register(&cfg_info, "talk_detection_events", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_TALKER_DETECT);
aco_option_register(&cfg_info, "dtmf_passthrough", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_DTMF_PASS);
aco_option_register(&cfg_info, "announce_join_leave", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANNOUNCE_JOIN_LEAVE);
conf_remove_user_marked(user->conference, user);
- if (user->conference->markedusers == 0) {
- AST_LIST_TRAVERSE_SAFE_BEGIN(&user->conference->active_list, user_iter, list) {
- /* Kick ENDMARKED cbu_iters */
- if (ast_test_flag(&user_iter->u_profile, USER_OPT_ENDMARKED) && !user_iter->kicked) {
- if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED)
- && !ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
- AST_LIST_REMOVE_CURRENT(list);
- user_iter->conference->activeusers--;
- AST_LIST_INSERT_TAIL(&user_iter->conference->waiting_list, user_iter, list);
- user_iter->conference->waitingusers++;
- }
- user_iter->kicked = 1;
- pbx_builtin_setvar_helper(user_iter->chan, "CONFBRIDGE_RESULT", "ENDMARKED");
- ast_bridge_remove(user_iter->conference->bridge, user_iter->chan);
- } else if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED)
- && !ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
- need_prompt = 1;
-
+ /* If all marked users have left, or we're set to kick if any marked user leaves, then boot everyone */
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&user->conference->active_list, user_iter, list) {
+ if (user->conference->markedusers > 0 && !ast_test_flag(&user_iter->u_profile, USER_OPT_ENDMARKEDANY)) {
+ continue;
+ }
+ /* Kick ENDMARKED cbu_iters */
+ if ((ast_test_flag(&user_iter->u_profile, USER_OPT_ENDMARKED) || ast_test_flag(&user_iter->u_profile, USER_OPT_ENDMARKEDANY)) && !user_iter->kicked) {
+ if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED)
+ && (!ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER) || ast_test_flag(&user_iter->u_profile, USER_OPT_ENDMARKEDANY))) {
AST_LIST_REMOVE_CURRENT(list);
user_iter->conference->activeusers--;
AST_LIST_INSERT_TAIL(&user_iter->conference->waiting_list, user_iter, list);
user_iter->conference->waitingusers++;
- } else {
- /* User is neither wait_marked nor end_marked; however, they
- * should still hear the prompt.
- */
- need_prompt = 1;
}
+ user_iter->kicked = 1;
+ pbx_builtin_setvar_helper(user_iter->chan, "CONFBRIDGE_RESULT", "ENDMARKED");
+ ast_bridge_remove(user_iter->conference->bridge, user_iter->chan);
+ } else if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED)
+ && !ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
+ need_prompt = 1;
+
+ AST_LIST_REMOVE_CURRENT(list);
+ user_iter->conference->activeusers--;
+ AST_LIST_INSERT_TAIL(&user_iter->conference->waiting_list, user_iter, list);
+ user_iter->conference->waitingusers++;
+ } else {
+ /* User is neither wait_marked nor end_marked nor end_marked_any; however, they
+ * should still hear the prompt.
+ */
+ need_prompt = 1;
}
- AST_LIST_TRAVERSE_SAFE_END;
}
+ AST_LIST_TRAVERSE_SAFE_END;
switch (user->conference->activeusers) {
case 0:
USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */
USER_OPT_ANSWER_CHANNEL = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */
USER_OPT_HEAR_OWN_JOIN_SOUND = (1 << 21), /*!< Set if the caller should hear the join sound */
+ USER_OPT_ENDMARKEDANY = (1 << 22), /*!< Set if the user should be kicked after any marked user exits */
};
enum bridge_profile_flags {
; when a channel enters a empty conference. On by default.
;wait_marked=yes ; Sets if the user must wait for a marked user to enter before
; joining the conference. Off by default.
-;end_marked=yes ; This option will kick every user with this option set in their
- ; user profile after the last Marked user exists the conference.
+;end_marked=yes ; This option will kick every non-marked user with this option set in their
+ ; user profile after the last marked user exits the conference.
+;end_marked_any=no ; This option will kick every user with this option set in
+ ; their user profile after any marked user exits the conference.
+ ; Additionally, note that unlike end_marked, this includes marked users.
;dsp_drop_silence=yes ; This option drops what Asterisk detects as silence from
; entering into the bridge. Enabling this option will drastically
--- /dev/null
+Subject: app_confbridge
+
+Adds the end_marked_any option which can be used
+to kick users from a conference after any
+marked user leaves (including marked users).