From aadf89620a6658c37361153f11572c9e456a674b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 14 Apr 2016 12:38:18 -0500 Subject: [PATCH] FS-8949 #resolve [switch_rtp.c Send end packet for [X] not recognised] --- src/switch_rtp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 2d94601340..a58b693d70 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -560,6 +560,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ rtp_session->dtmf_data.last_digit = 0; rtp_session->dtmf_data.in_digit_ts = 0; + rtp_session->dtmf_data.in_digit_queued = 0; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Failed DTMF sanity check.\n"); } @@ -593,6 +594,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ rtp_session->dtmf_data.last_digit = 0; rtp_session->dtmf_data.in_digit_ts = 0; rtp_session->dtmf_data.in_digit_sanity = 0; + rtp_session->dtmf_data.in_digit_queued = 0; } end = packet[1] & 0x80 ? 1 : 0; @@ -631,6 +633,16 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_ ts, duration, rtp_session->last_rtp_hdr.m, end, end && !rtp_session->dtmf_data.in_digit_ts ? "ignored" : ""); #endif + + if (rtp_session->dtmf_data.in_digit_ts && rtp_session->dtmf_data.in_digit_ts != ts) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TS changed from last packet, resetting....\n"); + rtp_session->dtmf_data.last_digit = 0; + rtp_session->dtmf_data.in_digit_ts = 0; + rtp_session->dtmf_data.in_digit_sanity = 0; + rtp_session->dtmf_data.in_digit_queued = 0; + } + + if (!rtp_session->dtmf_data.in_digit_queued && rtp_session->dtmf_data.in_digit_ts) { if ((rtp_session->rtp_bugs & RTP_BUG_IGNORE_DTMF_DURATION)) { switch_dtmf_t dtmf = { key, switch_core_min_dtmf_duration(0), 0, SWITCH_DTMF_RTP };