From 49b8cfa16b3f9f42aa747e7806e51752c480487d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 30 Dec 2009 23:10:38 +0000 Subject: [PATCH] FSRTP-10 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16100 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_rtp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index fac5a09704..9ff3107a49 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1879,8 +1879,16 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ } poll_loop = 1; - rtp_session->missed_count += (poll_sec * 1000 ) / (rtp_session->ms_per_packet ? rtp_session->ms_per_packet : 20 / 1000); + rtp_session->missed_count += (poll_sec * 1000 ) / (rtp_session->ms_per_packet ? rtp_session->ms_per_packet / 1000 : 20 ); bytes = 0; + + if (rtp_session->max_missed_packets) { + if (rtp_session->missed_count >= rtp_session->max_missed_packets) { + ret = -2; + goto end; + } + } + if (rtp_session->dtmf_data.out_digit_dur == 0 || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) { return_cng_frame(); }