"+"Video Layout Canvas "+(j+1)+" "+"
";jq.append(vlhtml);}
$("#"+snapshot_id).click(function(){var file=prompt("Please enter file name","");if(file){confMan.modCommand("vid-write-png",null,file);}});}
$("#"+play_id).click(function(){var file=prompt("Please enter file name","");if(file){confMan.modCommand("play",null,file);}});$("#"+stop_id).click(function(){confMan.modCommand("stop",null,"all");});$("#"+recording_id).click(function(){var file=prompt("Please enter file name","");if(file){confMan.modCommand("recording",null,["start",file]);}});$("#"+rec_stop_id).click(function(){confMan.modCommand("recording",null,["stop","all"]);});}
function genControls(jq,rowid){var x=parseInt(rowid);var kick_id="kick_"+x;var canvas_in_next_id="canvas_in_next_"+x;var canvas_in_prev_id="canvas_in_prev_"+x;var canvas_out_next_id="canvas_out_next_"+x;var canvas_out_prev_id="canvas_out_prev_"+x;var canvas_in_set_id="canvas_in_set_"+x;var canvas_out_set_id="canvas_out_set_"+x;var layer_set_id="layer_set_"+x;var layer_next_id="layer_next_"+x;var layer_prev_id="layer_prev_"+x;var tmute_id="tmute_"+x;var tvmute_id="tvmute_"+x;var vbanner_id="vbanner_"+x;var tvpresenter_id="tvpresenter_"+x;var tvfloor_id="tvfloor_"+x;var box_id="box_"+x;var gainup_id="gain_in_up"+x;var gaindn_id="gain_in_dn"+x;var volup_id="vol_in_up"+x;var voldn_id="vol_in_dn"+x;var transfer_id="transfer"+x;var html="";html+="General Controls
";html+=""+""+""+""+""+""+"";if(confMan.params.hasVid){html+="
Video Controls
";html+=""+""+""+"";if(confMan.canvasCount>1){html+="
Canvas Controls
"+""+""+""+"
"+""+""+"";}
@@ -266,7 +266,7 @@ if(dialog.state==state||!checkStateChange(dialog.state,state)){console.error("Di
console.log("Dialog "+dialog.callID+": state change from "+dialog.state.name+" to "+state.name);dialog.lastState=dialog.state;dialog.state=state;if(!dialog.causeCode){dialog.causeCode=16;}
if(!dialog.cause){dialog.cause="NORMAL CLEARING";}
if(dialog.callbacks.onDialogState){dialog.callbacks.onDialogState(this);}
-switch(dialog.state){case $.verto.enum.state.early:case $.verto.enum.state.active:var speaker=dialog.useSpeak;console.info("Using Speaker: ",speaker);if(speaker&&speaker!=="any"){setTimeout(function(){dialog.setAudioPlaybackDevice(speaker);},500);}
+switch(dialog.state){case $.verto.enum.state.early:case $.verto.enum.state.active:var speaker=dialog.useSpeak;console.info("Using Speaker: ",speaker);if(speaker&&speaker!=="any"&&speaker!=="none"){setTimeout(function(){dialog.setAudioPlaybackDevice(speaker);},500);}
break;case $.verto.enum.state.trying:setTimeout(function(){if(dialog.state==$.verto.enum.state.trying){dialog.setState($.verto.enum.state.hangup);}},30000);break;case $.verto.enum.state.purge:dialog.setState($.verto.enum.state.destroy);break;case $.verto.enum.state.hangup:if(dialog.lastState.val>$.verto.enum.state.requesting.val&&dialog.lastState.val<$.verto.enum.state.hangup.val){dialog.sendMethod("verto.bye",{});}
dialog.setState($.verto.enum.state.destroy);break;case $.verto.enum.state.destroy:delete dialog.verto.dialogs[dialog.callID];if(dialog.params.screenShare){dialog.rtc.stopPeer();}else{dialog.rtc.stop();}
break;}
diff --git a/html5/verto/video_demo/verto.js b/html5/verto/video_demo/verto.js
index 2df2f0824d..997d63a119 100644
--- a/html5/verto/video_demo/verto.js
+++ b/html5/verto/video_demo/verto.js
@@ -799,6 +799,7 @@ function docall() {
check_vid_res();
console.error(outgoingBandwidth, incomingBandwidth);
+
cur_call = vertoHandle.newCall({
destination_number: $("#ext").val(),
caller_id_name: $("#cidname").val(),
@@ -807,9 +808,9 @@ function docall() {
incomingBandwidth: incomingBandwidth,
useVideo: check_vid(),
useStereo: $("#use_stereo").is(':checked'),
- useCamera: sessid ? "none" : $("#usecamera").find(":selected").val(),
- useMic: $("#usemic").find(":selected").val(),
- useSpeak: $("#usespeak").find(":selected").val(),
+ useCamera: (sessid || canvas_id) ? "none" : $("#usecamera").find(":selected").val(),
+ useMic: (sessid || canvas_id) ? "none" : $("#usemic").find(":selected").val(),
+ useSpeak: (sessid || canvas_id) ? "none" : $("#usespeak").find(":selected").val(),
dedEnc: $("#use_dedenc").is(':checked'),
mirrorInput: $("#mirror_input").is(':checked'),
userVariables: {
diff --git a/src/include/switch_types.h b/src/include/switch_types.h
index f740b94932..fda2d20b22 100644
--- a/src/include/switch_types.h
+++ b/src/include/switch_types.h
@@ -2551,7 +2551,8 @@ typedef enum {
SWITCH_MEDIA_FLOW_SENDRECV = 0,
SWITCH_MEDIA_FLOW_SENDONLY,
SWITCH_MEDIA_FLOW_RECVONLY,
- SWITCH_MEDIA_FLOW_INACTIVE
+ SWITCH_MEDIA_FLOW_INACTIVE,
+ SWITCH_MEDIA_FLOW_DISABLED
} switch_media_flow_t;
typedef enum {
diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c
index 0b685d3c3a..f3fce9d5a1 100644
--- a/src/mod/applications/mod_conference/conference_api.c
+++ b/src/mod/applications/mod_conference/conference_api.c
@@ -1161,6 +1161,8 @@ switch_status_t conference_api_sub_write_png(conference_obj_t *conference, switc
switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv)
{
video_layout_t *vlayout = NULL;
+ char *group_name = NULL;
+
int idx = 0;
if (!argv[2]) {
@@ -1186,7 +1188,6 @@ switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, swit
if (!strncasecmp(argv[2], "group", 5)) {
layout_group_t *lg = NULL;
- char *group_name = NULL;
int xx = 4;
if ((group_name = strchr(argv[2], ':'))) {
@@ -1195,7 +1196,7 @@ switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, swit
} else {
group_name = argv[3];
}
-
+
if (!group_name) {
stream->write_function(stream, "Group name not specified.\n");
return SWITCH_STATUS_SUCCESS;
@@ -1206,33 +1207,30 @@ switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, swit
conference->video_layout_group = switch_core_strdup(conference->pool, group_name);
conference_utils_set_flag(conference, CFLAG_REFRESH_LAYOUT);
return SWITCH_STATUS_SUCCESS;
- } else {
- vlayout = conference_video_find_best_layout(conference, lg, 0);
}
- }
-
- if (!vlayout) {
- stream->write_function(stream, "Invalid group layout [%s]\n", group_name);
- return SWITCH_STATUS_SUCCESS;
+ } else {
+ group_name = NULL;
}
stream->write_function(stream, "Change to layout group [%s]\n", group_name);
- conference->video_layout_group = switch_core_strdup(conference->pool, group_name);
if (argv[xx]) {
- idx = atoi(argv[xx]);
+ if ((idx = atoi(argv[xx])) > 0) {
+ idx--;
+ }
}
}
}
if (!vlayout && (vlayout = switch_core_hash_find(conference->layout_hash, argv[2]))) {
- conference->video_layout_group = NULL;
if (argv[3]) {
- idx = atoi(argv[3]);
+ if ((idx = atoi(argv[3]))) {
+ idx--;
+ }
}
}
- if (!vlayout) {
+ if (!vlayout && !group_name) {
stream->write_function(stream, "Invalid layout [%s]\n", argv[2]);
return SWITCH_STATUS_SUCCESS;
}
@@ -1246,9 +1244,15 @@ switch_status_t conference_api_sub_vid_layout(conference_obj_t *conference, swit
conference->new_personal_vlayout = vlayout;
switch_mutex_unlock(conference->member_mutex);
} else {
- stream->write_function(stream, "Change canvas %d to layout [%s]\n", idx + 1, vlayout->name);
+
switch_mutex_lock(conference->canvases[idx]->mutex);
- conference->canvases[idx]->new_vlayout = vlayout;
+ if (vlayout) {
+ stream->write_function(stream, "Change canvas %d to layout [%s]\n", idx + 1, vlayout->name);
+ conference->canvases[idx]->new_vlayout = vlayout;
+ } else if (group_name) {
+ conference->canvases[idx]->video_layout_group = switch_core_strdup(conference->pool, group_name);
+ conference_utils_set_flag(conference, CFLAG_REFRESH_LAYOUT);
+ }
switch_mutex_unlock(conference->canvases[idx]->mutex);
}
diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c
index 6eb2668331..21e29dbc2a 100644
--- a/src/mod/applications/mod_conference/conference_member.c
+++ b/src/mod/applications/mod_conference/conference_member.c
@@ -736,12 +736,12 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
channel = switch_core_session_get_channel(member->session);
- 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);
}
+ conference_video_check_avatar(member, SWITCH_FALSE);
+
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) {
diff --git a/src/mod/applications/mod_conference/conference_utils.c b/src/mod/applications/mod_conference/conference_utils.c
index 274b499e44..269e558879 100644
--- a/src/mod/applications/mod_conference/conference_utils.c
+++ b/src/mod/applications/mod_conference/conference_utils.c
@@ -338,12 +338,18 @@ switch_bool_t conference_utils_test_mflag(conference_obj_t *conference, member_f
void conference_utils_member_set_flag(conference_member_t *member, member_flag_t flag)
{
member->flags[flag] = 1;
+
+ if (flag == MFLAG_SECOND_SCREEN) {
+ member->flags[MFLAG_CAN_SPEAK] = 0;
+ member->flags[MFLAG_CAN_HEAR] = 0;
+ member->flags[MFLAG_CAN_BE_SEEN] = 0;
+ }
}
void conference_utils_member_set_flag_locked(conference_member_t *member, member_flag_t flag)
{
switch_mutex_lock(member->flag_mutex);
- member->flags[flag] = 1;
+ conference_utils_member_set_flag(member, flag);
switch_mutex_unlock(member->flag_mutex);
}
diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c
index c473769880..87a0d24b93 100644
--- a/src/mod/applications/mod_conference/conference_video.c
+++ b/src/mod/applications/mod_conference/conference_video.c
@@ -1340,7 +1340,13 @@ video_layout_t *conference_video_find_best_layout(conference_obj_t *conference,
{
video_layout_node_t *vlnode = NULL, *last = NULL;
- if (!count) count = conference->members_with_video + conference->members_with_avatar;
+ if (!count) {
+ count = conference->members_with_video;
+
+ if (!conference_utils_test_flag(conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS)) {
+ count += conference->members_with_avatar;
+ }
+ }
for (vlnode = lg->layouts; vlnode; vlnode = vlnode->next) {
if (vlnode->vlayout->layers >= (int)count) {
@@ -1624,6 +1630,10 @@ void conference_video_check_avatar(conference_member_t *member, switch_bool_t fo
return;
}
+ if (conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {
+ return;
+ }
+
canvas = conference_video_get_canvas_locked(member);
if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS) &&
@@ -2149,6 +2159,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
int last_personal = conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS) ? 1 : 0;
canvas->video_timer_reset = 1;
+ canvas->video_layout_group = conference->video_layout_group;
packet = switch_core_alloc(conference->pool, SWITCH_RTP_MAX_BUF_LEN);
@@ -2161,7 +2172,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
switch_image_t *async_file_img = NULL, *normal_file_img = NULL, *file_imgs[2] = { 0 };
switch_frame_t file_frame = { 0 };
int j = 0, personal = conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS) ? 1 : 0;
-
+ int video_count = 0;
+
if (!personal) {
if (canvas->new_vlayout && switch_mutex_trylock(conference->canvas_mutex) == SWITCH_STATUS_SUCCESS) {
conference_video_init_canvas_layers(conference, canvas, NULL);
@@ -2180,7 +2192,24 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
canvas->send_keyframe = 1;
}
-
+ video_count = 0;
+
+ switch_mutex_lock(conference->member_mutex);
+ for (imember = conference->members; imember; imember = imember->next) {
+ int no_muted = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS);
+ int no_av = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS);
+ int seen = conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN);
+
+ if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
+ !conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) &&
+ conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || imember->avatar_png_img)
+ && imember->canvas_id == canvas->canvas_id && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY) {
+ video_count++;
+ }
+ }
+ canvas->video_count = video_count;
+ switch_mutex_unlock(conference->member_mutex);
+
switch_core_timer_next(&canvas->timer);
now = switch_micro_time_now();
@@ -2204,28 +2233,18 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
if (members_with_avatar != conference->members_with_avatar) {
count_changed = 1;
}
+
+ if (conference_utils_test_flag(conference, CFLAG_REFRESH_LAYOUT)) {
+ count_changed = 1;
+ conference_utils_clear_flag(conference, CFLAG_REFRESH_LAYOUT);
+ }
if (count_changed && !personal) {
layout_group_t *lg = NULL;
video_layout_t *vlayout = NULL;
- int canvas_count = 0;
-
- switch_mutex_lock(conference->member_mutex);
- for (imember = conference->members; imember; imember = imember->next) {
- int no_muted = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS);
- int no_av = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS);
- int seen = conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN);
- if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
- conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || imember->avatar_png_img)
- && imember->canvas_id == canvas->canvas_id && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY) {
- canvas_count++;
- }
- }
- switch_mutex_unlock(conference->member_mutex);
-
- if (conference->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, conference->video_layout_group))) {
- if ((vlayout = conference_video_find_best_layout(conference, lg, canvas_count))) {
+ if (canvas->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, canvas->video_layout_group))) {
+ if ((vlayout = conference_video_find_best_layout(conference, lg, canvas->video_count))) {
switch_mutex_lock(conference->member_mutex);
canvas->new_vlayout = vlayout;
switch_mutex_unlock(conference->member_mutex);
@@ -2534,11 +2553,6 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
switch_mutex_lock(conference->member_mutex);
- if (conference_utils_test_flag(conference, CFLAG_REFRESH_LAYOUT)) {
- count_changed = 1;
- conference_utils_clear_flag(conference, CFLAG_REFRESH_LAYOUT);
- }
-
for (imember = conference->members; imember; imember = imember->next) {
if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY) ||
@@ -2547,7 +2561,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
}
if (!imember->canvas) {
- if ((vlayout = conference_video_get_layout(conference, conference->video_layout_name, conference->video_layout_group))) {
+ if ((vlayout = conference_video_get_layout(conference, conference->video_layout_name, canvas->video_layout_group))) {
conference_video_init_canvas(conference, vlayout, &imember->canvas);
conference_video_init_canvas_layers(conference, imember->canvas, vlayout);
} else {
@@ -2584,7 +2598,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
total = 0;
}
- if (conference->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, conference->video_layout_group))) {
+ if (canvas->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, canvas->video_layout_group))) {
if ((vlayout = conference_video_find_best_layout(conference, lg, total + file_count))) {
conference_video_init_canvas_layers(conference, imember->canvas, vlayout);
}
diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c
index 791b722ce4..3ed558f983 100644
--- a/src/mod/applications/mod_conference/mod_conference.c
+++ b/src/mod/applications/mod_conference/mod_conference.c
@@ -279,7 +279,12 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
}
}
- if (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_VIDEO_READY) && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY && (!conference_utils_test_flag(conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) || conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN))) {
+ if (switch_channel_ready(channel) &&
+ switch_channel_test_flag(channel, CF_VIDEO_READY) &&
+ imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY &&
+ !conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) &&
+ (!conference_utils_test_flag(conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) ||
+ conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN))) {
members_with_video++;
}
diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h
index c7407391fd..02b3355384 100644
--- a/src/mod/applications/mod_conference/mod_conference.h
+++ b/src/mod/applications/mod_conference/mod_conference.h
@@ -485,6 +485,8 @@ typedef struct mcu_canvas_s {
int refresh;
int send_keyframe;
int play_file;
+ int video_count;
+ char *video_layout_group;
switch_rgb_color_t bgcolor;
switch_rgb_color_t border_color;
switch_rgb_color_t letterbox_bgcolor;
diff --git a/src/switch_core_media.c b/src/switch_core_media.c
index 7441f018b9..f4a1a9b491 100644
--- a/src/switch_core_media.c
+++ b/src/switch_core_media.c
@@ -3625,7 +3625,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
switch_channel_t *channel = switch_core_session_get_channel(session);
const char *val;
const char *crypto = NULL;
- int got_crypto = 0, got_video_crypto = 0, got_audio = 0, got_avp = 0, got_video_avp = 0, got_video_savp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0;
+ int got_crypto = 0, got_video_crypto = 0, got_audio = 0, saw_audio = 0, got_avp = 0, got_video_avp = 0, got_video_savp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0;
int scrooge = 0;
sdp_parser_t *parser = NULL;
sdp_session_t *sdp;
@@ -3666,6 +3666,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
return 0;
}
+ switch_channel_clear_flag(channel, CF_AUDIO_PAUSE);
+
if (dtls_ok(session) && (tmp = switch_channel_get_variable(smh->session->channel, "webrtc_enable_dtls")) && switch_false(tmp)) {
switch_channel_clear_flag(smh->session->channel, CF_DTLS_OK);
switch_channel_clear_flag(smh->session->channel, CF_DTLS);
@@ -3751,6 +3753,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
continue;
}
+ if (m->m_type == sdp_media_audio) {
+ saw_audio = 1;
+ }
+
ptime = dptime;
maxptime = dmaxptime;
@@ -3929,7 +3935,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
break;
}
}
-
+
for (attr = sdp->sdp_attributes; attr; attr = attr->a_next) {
if (zstr(attr->a_name)) {
continue;
@@ -4780,6 +4786,35 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
}
+ if (!saw_audio) {
+ payload_map_t *pmap;
+
+ a_engine->rmode = SWITCH_MEDIA_FLOW_DISABLED;
+ switch_channel_set_variable(smh->session->channel, "audio_media_flow", "inactive");
+
+
+ pmap = switch_core_media_add_payload_map(session,
+ SWITCH_MEDIA_TYPE_AUDIO,
+ "L16",
+ NULL,
+ NULL,
+ SDP_TYPE_REQUEST,
+ 97,
+ 8000,
+ 20,
+ 1,
+ SWITCH_TRUE);
+
+ pmap->remote_sdp_ip = "127.0.0.1";
+ pmap->remote_sdp_port = 9999;
+ pmap->agreed_pt = 97;
+ pmap->recv_pt = 97;
+ pmap->codec_ms = 20;
+ a_engine->cur_payload_map = pmap;
+ switch_channel_set_flag(channel, CF_AUDIO_PAUSE);
+ }
+
+
if (!match && vmatch) match = 1;
done:
@@ -6480,7 +6515,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
if (!strcasecmp(val, "passthru")) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Activating RTCP PASSTHRU PORT %d\n", remote_rtcp_port);
switch_rtp_activate_rtcp(a_engine->rtp_session, -1, remote_rtcp_port, a_engine->rtcp_mux > 0);
- } else {
+ } else if (remote_rtcp_port) {
int interval = atoi(val);
if (interval < 100 || interval > 500000) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
@@ -7766,6 +7801,10 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
username, smh->owner_id, smh->session_id, family, ip, username, family, ip, srbuf);
+ if (a_engine->rmode == SWITCH_MEDIA_FLOW_DISABLED) {
+ goto video;
+ }
+
if (switch_channel_test_flag(smh->session->channel, CF_ICE)) {
gen_ice(session, SWITCH_MEDIA_TYPE_AUDIO, ip, port);
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=msid-semantic: WMS %s\r\n", smh->msid);
@@ -8059,6 +8098,8 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
}
+ video:
+
if (!switch_channel_test_flag(session->channel, CF_VIDEO_POSSIBLE)) {
if (switch_channel_test_flag(session->channel, CF_VIDEO_SDP_RECVD)) {
switch_channel_clear_flag(session->channel, CF_VIDEO_SDP_RECVD);
@@ -9129,6 +9170,10 @@ SWITCH_DECLARE(switch_bool_t) switch_core_media_check_dtls(switch_core_session_t
engine = &smh->engines[type];
+ if (engine->rmode == SWITCH_MEDIA_FLOW_DISABLED) {
+ return SWITCH_TRUE;
+ }
+
do {
if (engine->rtp_session) checking = check_engine(engine);
} while (switch_channel_ready(session->channel) && checking);