[asterisk-commits] dvossel: branch dvossel/hd_confbridge r310881 - in /team/dvossel/hd_confbridg...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 15 12:16:46 CDT 2011


Author: dvossel
Date: Tue Mar 15 12:16:42 2011
New Revision: 310881

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=310881
Log:
Addition of the ability to kick conference participants when last marked user exits.

Modified:
    team/dvossel/hd_confbridge/apps/app_confbridge.c
    team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
    team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h
    team/dvossel/hd_confbridge/configs/confbridge.conf.sample

Modified: team/dvossel/hd_confbridge/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/app_confbridge.c?view=diff&rev=310881&r1=310880&r2=310881
==============================================================================
--- team/dvossel/hd_confbridge/apps/app_confbridge.c (original)
+++ team/dvossel/hd_confbridge/apps/app_confbridge.c Tue Mar 15 12:16:42 2011
@@ -619,9 +619,12 @@
 				ao2_lock(conference_bridge);
 			}
 
-			/* Now on to starting MOH if needed */
+			/* Now on to starting MOH or kick if needed */
 			AST_LIST_TRAVERSE(&conference_bridge->users_list, other_participant, list) {
-				if (ast_test_flag(&other_participant->u_profile, USER_OPT_MUSICONHOLD) && !ast_bridge_suspend(conference_bridge->bridge, other_participant->chan)) {
+				if (ast_test_flag(&other_participant->u_profile, USER_OPT_ENDMARKED)) {
+					other_participant->kicked = 1;
+					ast_bridge_remove(conference_bridge->bridge, other_participant->chan);
+				} else if (ast_test_flag(&other_participant->u_profile, USER_OPT_MUSICONHOLD) && !ast_bridge_suspend(conference_bridge->bridge, other_participant->chan)) {
 					ast_moh_start(other_participant->chan, other_participant->opt_args[OPTION_MUSICONHOLD_CLASS], NULL);
 					ast_bridge_unsuspend(conference_bridge->bridge, other_participant->chan);
 				}

Modified: team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c?view=diff&rev=310881&r1=310880&r2=310881
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/conf_config_parser.c Tue Mar 15 12:16:42 2011
@@ -231,6 +231,10 @@
 			u_profile->flags = ast_true(var->value) ?
 				u_profile->flags | USER_OPT_WAITMARKED :
 				u_profile->flags & ~USER_OPT_WAITMARKED;
+		} else if (!strcasecmp(var->name, "end_marked")) {
+			u_profile->flags = ast_true(var->value) ?
+				u_profile->flags | USER_OPT_ENDMARKED :
+				u_profile->flags & ~USER_OPT_ENDMARKED;
 		} else if (!strcasecmp(var->name, "announce_join_leave")) {
 			u_profile->flags = ast_true(var->value) ?
 				u_profile->flags | USER_OPT_ANNOUNCE_JOIN_LEAVE :
@@ -481,6 +485,9 @@
 		"enabled" : "disabled");
 	ast_cli(a->fd,"Wait Marked:         %s\n",
 		u_profile.flags & USER_OPT_WAITMARKED ?
+		"enabled" : "disabled");
+	ast_cli(a->fd,"END Marked:          %s\n",
+		u_profile.flags & USER_OPT_ENDMARKED ?
 		"enabled" : "disabled");
 	ast_cli(a->fd,"Denoise:             %s\n",
 		u_profile.flags & USER_OPT_DENOISE ?

Modified: team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h?view=diff&rev=310881&r1=310880&r2=310881
==============================================================================
--- team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h (original)
+++ team/dvossel/hd_confbridge/apps/confbridge/include/confbridge.h Tue Mar 15 12:16:42 2011
@@ -39,9 +39,10 @@
 	USER_OPT_MUSICONHOLD =  (1 << 4), /*!< Set if music on hold should be played if nobody else is in the conference bridge */
 	USER_OPT_QUIET =        (1 << 5), /*!< Set if no audio prompts should be played */
 	USER_OPT_ANNOUNCEUSERCOUNT = (1 << 6), /*!< Set if the number of users should be announced to the caller */
-	USER_OPT_WAITMARKED =   (1 << 7), /*!< Set if the conference must wait for a marked user before starting */
-	USER_OPT_DENOISE =      (1 << 8), /*!< Sets if denoise filter should be used on audio before mixing. */
-	USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 9), /*!< Sets if the user's name should be recorded and announced on join and leave. */
+	USER_OPT_WAITMARKED =   (1 << 7), /*!< Set if the user must wait for a marked user before starting */
+	USER_OPT_ENDMARKED =    (1 << 8), /*!< Set if the user should be kicked after the last Marked user exits */
+	USER_OPT_DENOISE =      (1 << 9), /*!< Sets if denoise filter should be used on audio before mixing. */
+	USER_OPT_ANNOUNCE_JOIN_LEAVE = (1 << 10), /*!< Sets if the user's name should be recorded and announced on join and leave. */
 };
 
 

Modified: team/dvossel/hd_confbridge/configs/confbridge.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/configs/confbridge.conf.sample?view=diff&rev=310881&r1=310880&r2=310881
==============================================================================
--- team/dvossel/hd_confbridge/configs/confbridge.conf.sample (original)
+++ team/dvossel/hd_confbridge/configs/confbridge.conf.sample Tue Mar 15 12:16:42 2011
@@ -17,7 +17,9 @@
 ;marked=yes    ; Sets if this is a marked user or not. Off by default.
 ;startmuted=yes; Sets if all users should start out muted. Off by default
 ;music_on_hold_when_empty=yes  ; Sets whether MOH should be played when only
-                               ; one person is in the conference.  Off by default.
+                               ; one person is in the conference or when the
+                               ; the user is waiting on a marked user to enter
+                               ; the conference. Off by default.
 ;quiet=yes     ; Sets if no audio prompts should be played.  There are some prompts,
                ; such as the prompt to enter a PIN number, that must be played regardless
                ; of what this option is set to.  Off by default
@@ -26,7 +28,9 @@
 ;announce_only_user=yes   ; Sets if the only user announcement should be played
                           ; 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
+                   ; 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.
 ;denoise=yes ; Sets whether or not a denoise filter should be applied
              ; to the audio before mixing or not.  Off by default. Requires
              ; codec_speex to be built and installed.




More information about the asterisk-commits mailing list