From 922e1d65ce8224060a91a007fbab484296012f20 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 11 Dec 2009 05:14:45 +0000 Subject: [PATCH] FSCORE-510 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15904 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_rtp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index eec2baec8b..6f950f28f2 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -215,6 +215,7 @@ struct switch_rtp { switch_rtp_stats_t stats; uint32_t hot_hits; uint32_t sync_packets; + uint32_t dtmf_wait; #ifdef ENABLE_ZRTP zrtp_session_t *zrtp_session; @@ -1604,6 +1605,7 @@ static void do_2833(switch_rtp_t *rtp_session) rtp_session->next_write_samplecount = rtp_session->timer.samplecount + samples * 5; } rtp_session->dtmf_data.out_digit_dur = 0; + rtp_session->dtmf_wait = rtp_session->samples_per_interval ? ((rtp_session->samples_per_second / 4) / rtp_session->samples_per_interval) : 12; } } @@ -1616,7 +1618,11 @@ static void do_2833(switch_rtp_t *rtp_session) } } - if (switch_queue_trypop(rtp_session->dtmf_data.dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) { + if (rtp_session->dtmf_wait) { + rtp_session->dtmf_wait--; + } + + if (!rtp_session->dtmf_wait && switch_queue_trypop(rtp_session->dtmf_data.dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) { switch_dtmf_t *rdigit = pop; int64_t offset; switch_size_t wrote;