# DTMF problem with voice intermixed

**URL:** <https://community.asterisk.org/t/dtmf-problem-with-voice-intermixed/37669>\
**Category:** Asterisk Support\
**Created:** [December 15, 2011, 8:18pm UTC](https://community.asterisk.org/t/dtmf-problem-with-voice-intermixed/37669 "2011-12-15T20:18:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomJohnson](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@TomJohnson](https://community.asterisk.org/u/TomJohnson)\
**Post date:** [December 15, 2011, 8:18pm UTC](https://community.asterisk.org/t/dtmf-problem-with-voice-intermixed/37669/1 "2011-12-15T20:18:52Z")

</div>

I am using the release of Asterisk 1.4.42 and discovered that if Asterisk receives a DTMF RTP event followed by an audio RTP packet each with different timestamps, it will end the digit and thus produce incorrect digits. According to searches, this problem seems to have been fixed in Asterisk 1.4 in earlier releases, but that change seems to have been lost. The problem seems to be in rtp.c in the ast\_rtp\_read function. An if near the bottom:

if (rtp-\>dtmf\_timeout && rtp-\>dtmf\_timeout \< timestamp)

does not take into account that the timestamp might be different for a non-RTP event packet. To make the server happy, I added “&& payloadtype==101” to the IF. Not an elegant solution, was hoping someone could post a better solution.
