]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8786 #resolve [rtp-timeout-sec on profile triggers when receiving T.38 UDPTL frames]
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 27 Jan 2016 16:49:34 +0000 (10:49 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 27 Jan 2016 16:49:44 +0000 (10:49 -0600)
src/switch_rtp.c

index 8d83dafb39cf97acc2bcfc7550bf8ed6278b450d..2fea561191627635eed7dd91b21642916838cfc3 100644 (file)
@@ -2730,6 +2730,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s
 
 SWITCH_DECLARE(void) switch_rtp_set_max_missed_packets(switch_rtp_t *rtp_session, uint32_t max)
 {
+       if (!switch_rtp_ready(rtp_session) || rtp_session->flags[SWITCH_RTP_FLAG_UDPTL]) {
+               return;
+       }
+
        if (rtp_session->missed_count >= max) {
                
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING,
@@ -2835,6 +2839,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_udptl_mode(switch_rtp_t *rtp_session)
                switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
        }
 
+       rtp_session->missed_count = 0;
+       rtp_session->max_missed_packets = 0;
+
        rtp_session->flags[SWITCH_RTP_FLAG_ENABLE_RTCP] = 0;
 
        if (rtp_session->rtcp_sock_input) {
@@ -6320,7 +6327,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                                        goto end;
                                }
 
-                               if (rtp_session->max_missed_packets && read_loops == 1 && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
+                               if (rtp_session->max_missed_packets && read_loops == 1 && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && 
+                                       !rtp_session->flags[SWITCH_RTP_FLAG_UDPTL]) {
                                        if (bytes && status == SWITCH_STATUS_SUCCESS) {
                                                rtp_session->missed_count = 0;
                                        } else if (++rtp_session->missed_count >= rtp_session->max_missed_packets) {