[asterisk-commits] dvossel: branch dvossel/shortbus r325409 - in /team/dvossel/shortbus: apps/ a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 28 16:42:14 CDT 2011


Author: dvossel
Date: Tue Jun 28 16:42:11 2011
New Revision: 325409

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=325409
Log:
Adds DTMF action to set self as video source of conference

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

Modified: team/dvossel/shortbus/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/shortbus/apps/app_confbridge.c?view=diff&rev=325409&r1=325408&r2=325409
==============================================================================
--- team/dvossel/shortbus/apps/app_confbridge.c (original)
+++ team/dvossel/shortbus/apps/app_confbridge.c Tue Jun 28 16:42:11 2011
@@ -614,20 +614,10 @@
 	return res;
 }
 
-static int conf_member_is_video_capable(struct conference_bridge_user *conference_bridge_user)
-{
-	if (!ast_format_cap_has_type(conference_bridge_user->chan->nativeformats, AST_FORMAT_TYPE_VIDEO)) {
-		return 0;
-	}
+static void handle_video_on_join(struct conference_bridge *conference_bridge, struct conference_bridge_user *conference_bridge_user)
+{
+	/* only automatically set video source for marked users */
 	if (!ast_test_flag(&conference_bridge_user->u_profile, USER_OPT_MARKEDUSER)) {
-		return 0;
-	}
-	return 1;
-}
-
-static void handle_video_on_join(struct conference_bridge *conference_bridge, struct conference_bridge_user *conference_bridge_user)
-{
-	if (!conf_member_is_video_capable(conference_bridge_user)) {
 		return;
 	}
 
@@ -664,14 +654,21 @@
 		return;
 	}
 
-	/* Make the next avaliable participant capable of video the src. */
+	/* if the video_mode isn't set to automatically pick the video source, do nothing on exit. */
+	if (!ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED) &&
+		!ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_VIDEO_SRC_LAST_MARKED)) {
+		return;
+	}
+
+	/* Make the next avaliable marked user the video src.  */
 	ao2_lock(conference_bridge);
 	AST_LIST_TRAVERSE(&conference_bridge->users_list, tmp_user, list) {
 		if (tmp_user == conference_bridge_user) {
 			continue;
 		}
-		if (conf_member_is_video_capable(tmp_user)) {
+		if (ast_test_flag(&tmp_user->u_profile, USER_OPT_MARKEDUSER)) {
 			ast_bridge_set_single_src_video_mode(conference_bridge->bridge, tmp_user->chan);
+			break;
 		}
 	}
 	ao2_unlock(conference_bridge);
@@ -1749,6 +1746,12 @@
 			break;
 		case MENU_ACTION_NOOP:
 			break;
+		case MENU_ACTION_SET_SINGLE_VIDEO_SRC:
+			ao2_lock(conference_bridge);
+			ast_log(LOG_NOTICE, "HIT\n");
+			ast_bridge_set_single_src_video_mode(conference_bridge->bridge, bridge_channel->chan);
+			ao2_unlock(conference_bridge);
+			break;
 		}
 	}
 	return res;

Modified: team/dvossel/shortbus/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/shortbus/apps/confbridge/conf_config_parser.c?view=diff&rev=325409&r1=325408&r2=325409
==============================================================================
--- team/dvossel/shortbus/apps/confbridge/conf_config_parser.c (original)
+++ team/dvossel/shortbus/apps/confbridge/conf_config_parser.c Tue Jun 28 16:42:11 2011
@@ -540,6 +540,7 @@
 	case MENU_ACTION_ADMIN_TOGGLE_LOCK:
 	case MENU_ACTION_ADMIN_KICK_LAST:
 	case MENU_ACTION_LEAVE:
+	case MENU_ACTION_SET_SINGLE_VIDEO_SRC:
 		break;
 	case MENU_ACTION_PLAYBACK:
 	case MENU_ACTION_PLAYBACK_AND_CONTINUE:
@@ -655,6 +656,8 @@
 			res |= add_action_to_menu_entry(menu_entry, MENU_ACTION_ADMIN_KICK_LAST, NULL);
 		} else if (!strcasecmp(action, "leave_conference")) {
 			res |= add_action_to_menu_entry(menu_entry, MENU_ACTION_LEAVE, NULL);
+		} else if (!strcasecmp(action, "set_as_single_video_src")) {
+			res |= add_action_to_menu_entry(menu_entry, MENU_ACTION_SET_SINGLE_VIDEO_SRC, NULL);
 		} else if (!strncasecmp(action, "dialplan_exec(", 14)) {
 			ast_copy_string(buf, action, sizeof(buf));
 			action_args = buf;
@@ -1156,6 +1159,9 @@
 			case MENU_ACTION_LEAVE:
 				ast_cli(a->fd, "leave_conference");
 				break;
+			case MENU_ACTION_SET_SINGLE_VIDEO_SRC:
+				ast_cli(a->fd, "set_as_single_video_src");
+				break;
 			}
 			action_num++;
 		}

Modified: team/dvossel/shortbus/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/shortbus/apps/confbridge/include/confbridge.h?view=diff&rev=325409&r1=325408&r2=325409
==============================================================================
--- team/dvossel/shortbus/apps/confbridge/include/confbridge.h (original)
+++ team/dvossel/shortbus/apps/confbridge/include/confbridge.h Tue Jun 28 16:42:11 2011
@@ -80,6 +80,7 @@
 	MENU_ACTION_ADMIN_KICK_LAST,
 	MENU_ACTION_LEAVE,
 	MENU_ACTION_NOOP,
+	MENU_ACTION_SET_SINGLE_VIDEO_SRC,
 };
 
 /*! The conference menu action contains both

Modified: team/dvossel/shortbus/configs/confbridge.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/shortbus/configs/confbridge.conf.sample?view=diff&rev=325409&r1=325408&r2=325409
==============================================================================
--- team/dvossel/shortbus/configs/confbridge.conf.sample (original)
+++ team/dvossel/shortbus/configs/confbridge.conf.sample Tue Jun 28 16:42:11 2011
@@ -170,7 +170,9 @@
 
 ;video_mode = first_marked ; Sets how confbridge handles video distribution to the conference participants.
                           ; --- MODES ---
-                          ; none: No video is allowed into the conference.  This is the default value.
+                          ; none: No video sources are set by default in the conference. It is still
+                          ;       possible for a user to be set as a video source via AMI or DTMF action
+                          ;       at any time.
                           ;
                           ; last_marked: The last marked user to join the conference with video capabilities
                           ;              will be the single source of video distributed to all participants.
@@ -278,6 +280,8 @@
 ; admin_toggle_conference_lock ; This action allows an Admin to toggle locking and
                                ; unlocking the conference.  Non admins can not use
                                ; this action even if it is in their menu.
+; set_as_single_video_src   ; This action allows any user to set themselves as the
+                            ; single video source distributed to all participants.
 
 [sample_user_menu]
 type=menu




More information about the asterisk-commits mailing list