switch_status_t conference_api_sub_vid_role_id(conference_member_t *member, switch_stream_handle_t *stream, void *data)
{
char *text = (char *) data;
-
+ int force = 0;
+
if (member == NULL)
return SWITCH_STATUS_GENERR;
stream->write_function(stream, "-ERR conference is not in mixing mode\n");
return SWITCH_STATUS_SUCCESS;
}
-
- if (zstr(text) || !strcasecmp(text, "clear") || (member->video_role_id && !strcasecmp(text, member->video_role_id))) {
+
+ if (!zstr(text) && *text == '=') {
+ text++;
+ force = 1;
+ }
+
+ if (zstr(text) || !strcasecmp(text, "clear") || (!force && member->video_role_id && !strcasecmp(text, member->video_role_id))) {
member->video_role_id = NULL;
stream->write_function(stream, "+OK role_id cleared\n");
} else {
conference_member_t *lmember = NULL;
conference->floor_holder_score_iir = 0;
-
+
if (conference->floor_holder) {
if ((member && conference->floor_holder == member->id) || (id && conference->floor_holder == id)) {
goto end;
member = lmember = conference_member_get(conference, id);
}
-
if (member) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding floor %s\n",
switch_channel_get_name(member->channel));
switch_assert(params);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conference_name", conference->name);
- if (!(cxml = switch_xml_open_cfg("conference_layouts.conf", &cfg, params))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", "conference_layouts.conf");
+ if (!(cxml = switch_xml_open_cfg(conference->video_layout_conf, &cfg, params))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", conference->video_layout_conf);
goto done;
}
vlayout->layers++;
}
+ if (!conference->default_layout_name) {
+ conference->default_layout_name = switch_core_strdup(conference->pool, name);
+ }
switch_core_hash_insert(conference->layout_hash, name, vlayout);
if (!COMPLETE_INIT) {
}
if (member && member->video_reservation_id) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Setting floor not allowed on a member with a res id\n");
/* no video floor when a reservation id is set */
return;
}
+ if (member && member->video_role_id) {
+ /* no video floor when a role id is set */
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Setting floor not allowed on a member with a role id\n");
+ return;
+ }
+
if ((!force && conference_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK))) {
return;
}
//(!conference_utils_test_flag(conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) {
conference_member_set_floor_holder(conference, imember, 0);
- floor_holder = imember->id;
+ floor_holder = conference->floor_holder;
}
video_media_flow = switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO);
char *perpetual_sound = NULL;
char *moh_sound = NULL;
char *outcall_templ = NULL;
+ char *video_layout_conf = NULL;
char *video_layout_name = NULL;
char *video_layout_group = NULL;
char *video_canvas_size = NULL;
outcall_templ = val;
} else if (!strcasecmp(var, "video-layout-name") && !zstr(val)) {
video_layout_name = val;
+ } else if (!strcasecmp(var, "video-layout-conf") && !zstr(val)) {
+ video_layout_conf = val;
} else if (!strcasecmp(var, "video-canvas-count") && !zstr(val)) {
video_canvas_count = atoi(val);
} else if (!strcasecmp(var, "video-super-canvas-label-layers") && !zstr(val)) {
/* Set defaults and various paramaters */
+ if (zstr(video_layout_conf)) {
+ video_layout_conf = "conference_layouts.conf";
+ }
+
/* Timer module to use */
if (zstr(timer_name)) {
timer_name = "soft";
conference->tts_voice = switch_core_strdup(conference->pool, tts_voice);
}
+ conference->video_layout_conf = switch_core_strdup(conference->pool, video_layout_conf);
conference->comfort_noise_level = comfort_noise_level;
conference->pin_retries = pin_retries;
conference->caller_id_name = switch_core_strdup(conference->pool, caller_id_name);
conference->video_layout_group = switch_core_strdup(conference->pool, video_layout_group);
}
+ if (!conference_video_get_layout(conference, video_layout_name, video_layout_group)) {
+ conference->video_layout_name = conference->video_layout_group = video_layout_group = video_layout_name = NULL;
+ if (conference_video_get_layout(conference, conference->default_layout_name, NULL)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Defaulting to layout %s\n", conference->default_layout_name);
+ video_layout_name = conference->video_layout_name = conference->default_layout_name;
+ }
+ }
+
if (!conference_video_get_layout(conference, video_layout_name, video_layout_group)) {
conference->video_layout_name = conference->video_layout_group = video_layout_group = video_layout_name = NULL;
conference->conference_video_mode = CONF_VIDEO_MODE_TRANSCODE;
int auto_record_canvas;
char *record_filename;
char *outcall_templ;
+ char *video_layout_conf;
char *video_layout_name;
char *video_layout_group;
char *video_canvas_bgcolor;
char *scale_h264_canvas_bandwidth;
uint32_t moh_wait;
uint32_t floor_holder_score_iir;
+ char *default_layout_name;
} conference_obj_t;
/* Relationship with another member */