[asterisk-dev] DTMF mute in RTP
Matthew Jordan
mjordan at digium.com
Fri May 23 08:54:24 CDT 2014
On Fri, May 23, 2014 at 8:43 AM, Olle E. Johansson <oej at edvina.net> wrote:
>
> On 23 May 2014, at 15:39, Matthew Jordan <mjordan at digium.com> wrote:
>
>> On Fri, May 23, 2014 at 4:22 AM, Olle E. Johansson <oej at edvina.net> wrote:
>>> rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
>>>
>>> Am I right in that we mute half a second between DTMF signals here? I had to take it down to 45000 microseconds to make my alarms work.
>>>
>>> In channel.c we have a forced gap on 45 ms, which is more reasonable.
>>>
>>> /*! Minimum amount of time between the end of the last digit and the beginning
>>> * of a new one - 45ms */
>>> #define AST_MIN_DTMF_GAP 45
>>>
>>>
>>> I think we should implement a #define in res_rtp_asterisk.c and take down the dtmf mute to a reasonable level, or make it configurable.
>>>
>>> What is your opinion?
>>>
>>
>> I wonder if this shouldn't just be handled in the core, and not in
>> res_rtp_asterisk at all. Technically, anything could create DTMF and
>> pass it off to a channel to be handled - having the management of DTMF
>> in channel.c does seem to make some sense.
>>
>> I'm curious, what happens if you just remove the checks in res_rtp_asterisk?
>
> That's a good question. I wonder if anyone remembers why this was put in there.
> There's talk about removing "dtmf echo" in the code.
>
> Will see if I get to try it out. Have some pretty heavy DTMF sending/receiving equipment on my table. My ears are singing with the joy of DTMF being played all day.
>
> To get a similar experience, please play music from this site in your office.
> http://www.michaelv.org/projects/telephone/
>
> Mine is unfortunately more random.
>
Doing some archaeology work, I think we're looking at some _very_ old
code - from main/rtp.c in 1.4:
41632 file (type == AST_FRAME_DTMF_BEGIN)) &&
ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) {
svn log turns up:
------------------------------------------------------------------------
r41632 | file | 2006-08-31 16:00:16 -0500 (Thu, 31 Aug 2006) | 2 lines
Tweak the DTMF muting stuff a bit to take into account VLDTMF and compensation.
------------------------------------------------------------------------
Since Josh's update to that code was back in 2006 (and he was
obviously fixing a bug in that update, not adding the logic), I think
we're unlikely to find the reason for its existence...
--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
More information about the asterisk-dev
mailing list