From c8dcc6e12ba681601058b248d82feb6005e1d336 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 2 Sep 2009 19:55:08 +0000 Subject: [PATCH] reduce poll timeout when dtmf is present git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14749 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 58931c109f..23072cacc6 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1800,7 +1800,15 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ } if (!rtp_session->timer.interval && rtp_session->read_pollfd) { - poll_status = switch_poll(rtp_session->read_pollfd, 1, &fdr, poll_sec * 1000000); + int pt = poll_sec * 1000000; + + if (rtp_session->dtmf_data.out_digit_dur > 0) { + pt = 20000; + } + poll_status = switch_poll(rtp_session->read_pollfd, 1, &fdr, pt); + if (rtp_session->dtmf_data.out_digit_dur > 0) { + do_2833(rtp_session); + } } if (poll_status == SWITCH_STATUS_SUCCESS) {