[core] polish SEND_RTCP_MESSAGE

This commit is contained in:
Dragos Oancea 2021-09-30 11:39:39 +00:00
parent 607f5db140
commit acbe88d18d

View File

@ -8596,6 +8596,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
goto end;
}
if (switch_channel_var_true(session->channel, "fire_rtcp_events")) {
flags[SWITCH_RTP_FLAG_AUDIO_FIRE_SEND_RTCP_EVENT] = 1;
if (switch_channel_test_flag(session->channel, CF_VIDEO_POSSIBLE) &&
switch_channel_var_true(session->channel, "rtp_video_send_rtcp_message_event")) {
flags[SWITCH_RTP_FLAG_VIDEO_FIRE_SEND_RTCP_EVENT] = 1;
}
}
if (!is_reinvite) {
if (switch_rtp_ready(a_engine->rtp_session)) {
if (switch_channel_test_flag(session->channel, CF_TEXT_POSSIBLE) && !switch_rtp_ready(t_engine->rtp_session)) {
@ -8774,11 +8782,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
if (switch_channel_up(session->channel)) {
switch_channel_set_variable(session->channel, "rtp_use_timer_name", timer_name);
if (switch_channel_var_true(session->channel, "fire_rtcp_events")) {
flags[SWITCH_RTP_FLAG_AUDIO_FIRE_SEND_RTCP_EVENT] = 1;
}
a_engine->rtp_session = switch_rtp_new(a_engine->local_sdp_ip,
a_engine->local_sdp_port,
a_engine->cur_payload_map->remote_sdp_ip,
@ -9513,11 +9516,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
if (v_engine->tmmbr) {
flags[SWITCH_RTP_FLAG_TMMBR]++;
}
if (switch_channel_var_true(session->channel, "fire_rtcp_events") &&
switch_channel_var_true(session->channel, "enable_send_rtcp_message_event_video")) {
flags[SWITCH_RTP_FLAG_VIDEO_FIRE_SEND_RTCP_EVENT] = 1;
}
v_engine->rtp_session = switch_rtp_new(a_engine->local_sdp_ip,
v_engine->local_sdp_port,