From 3eff2d553d04c831f419dd153954fed8aa6f7b83 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 18 Mar 2016 14:54:31 -0500 Subject: [PATCH] FS-7800 should be able to call extra screens with same extension as the original and place the param conferenceCanvasID with the desired canvas id into the call params in the same place bandwidth prefs are added --- .../mod_conference/conference_member.c | 10 +++++++--- src/mod/endpoints/mod_verto/mod_verto.c | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index f0d1c2c7a7..6eb2668331 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -738,6 +738,10 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_check_avatar(member, SWITCH_FALSE); + if (switch_true(switch_channel_get_variable_dup(member->channel, "video_second_screen", SWITCH_FALSE, -1))) { + conference_utils_member_set_flag(member, MFLAG_SECOND_SCREEN); + } + if ((var = switch_channel_get_variable_dup(member->channel, "video_initial_canvas", SWITCH_FALSE, -1))) { uint32_t id = atoi(var) - 1; if (id < conference->canvas_count) { @@ -748,16 +752,16 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if ((var = switch_channel_get_variable_dup(member->channel, "video_initial_watching_canvas", SWITCH_FALSE, -1))) { uint32_t id = atoi(var) - 1; - + if (id == 0) { id = conference->canvas_count; } - + if (id <= conference->canvas_count && conference->canvases[id]) { member->watching_canvas_id = id; } } - + conference_video_reset_member_codec_index(member); if (has_video) { diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 58fc3499cd..c4a4cd72ed 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -3350,7 +3350,7 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock_t *jsock, cJSON **response) { - cJSON *obj = cJSON_CreateObject(), *screenShare = NULL, *dedEnc = NULL, *mirrorInput, *json_ptr = NULL, *bandwidth = NULL; + cJSON *obj = cJSON_CreateObject(), *screenShare = NULL, *dedEnc = NULL, *mirrorInput, *json_ptr = NULL, *bandwidth = NULL, *canvas = NULL; switch_core_session_t *session = NULL; switch_channel_t *channel; switch_event_t *var_event; @@ -3433,6 +3433,21 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock switch_channel_set_flag(channel, CF_VIDEO_MIRROR_INPUT); } + if ((canvas = cJSON_GetObjectItem(dialog, "conferenceCanvasID"))) { + int canvas_id = 0; + + if (!zstr(canvas->valuestring)) { + canvas_id = atoi(canvas->valuestring); + } else if (canvas->valueint) { + canvas_id = canvas->valueint; + } + + if (canvas_id >= 0) { + switch_channel_set_variable_printf(channel, "video_initial_watching_canvas", "%d", canvas_id); + switch_channel_set_variable(channel, "video_second_screen", "true"); + } + } + if ((bandwidth = cJSON_GetObjectItem(dialog, "outgoingBandwidth"))) { int core_bw = 0, bwval = 0; const char *val;