From acbe88d18d8a8e6c03ba05d43a4473c9dcf22a33 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Thu, 30 Sep 2021 11:39:39 +0000 Subject: [PATCH] [core] polish SEND_RTCP_MESSAGE --- src/switch_core_media.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 40180edc38..0e94724249 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -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,