]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] polish SEND_RTCP_MESSAGE
authorDragos Oancea <dragos@signalwire.com>
Thu, 30 Sep 2021 11:39:39 +0000 (11:39 +0000)
committerDragos Oancea <dragos@signalwire.com>
Mon, 4 Oct 2021 08:54:05 +0000 (08:54 +0000)
src/switch_core_media.c

index 40180edc38592a80957f36e67586a7b7c49d9c05..0e947242493978fb777b0a24a9b931950159e816 100644 (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,