[asterisk-dev] DTMF detection and generation code

Steve Underwood steveu at coppice.org
Mon Apr 24 09:06:21 MST 2006


Chris Lee wrote:

>
>
> Steve Underwood wrote:
>
>> Vahan Yerkanian wrote:
>>
>>> Steve Underwood wrote:
>>>
>>>> With most cellular base stations each press of the buttons on the 
>>>> phone produces a fixed length DTMF pulse, with a fixed silence 
>>>> following it. If you press keys in quick succession, they are 
>>>> buffered up, and played out as tones at the pace the base station 
>>>> sees fit. Typically they make the tones very long, for some reason. 
>>>> 0.5 seconds in many cases. I think your application sounds broken 
>>>> by design. I've been through this before, trying to build things 
>>>> which require rhythmic input. It just doesn't work, unless your 
>>>> application is limited to plain old analogue land line phones.
>>>
>>>
>>>
>>> DTMF buffer is another useful thing - currently digits sent too fast 
>>> are guaranteed to be skipped. Ironically, I never get a double or 
>>> skipped digits from cellular networks - these send DTMFs with 
>>> loooong durations as the developers have accounted for lossy nature 
>>> of the cellular technology.
>>
>>
>> The lossy nature of cellular networks has no impact on DTMF. The 
>> phones do not generate DTMF. The base stations do. The phones merely 
>> send messages saying "user pressed one", "user pressed five", etc. 
>> and they don't tell the base station how long it was pressed for. The 
>> base station generates the DTMF tone in a non-lossy environment.
>>
>> Steve
>
> Steve,
> I would be happy to call you from my cellular phone and hold down keys
> to show you that the DTMF is generated for the duration of the hold down.
> I don't know if the UK networks are special but they (all of them tested
> except for 3) do provide a tone from minimum length (variable length 150
> to 500 ms) to duration of key held down.
> This works for all Nokia SonyEricson Siemens and LG phones so they are
> sending key down and key up information.
>
> Chris.

Intriguing. 5 years ago I tried all the operators in HK, and had 
consistent behaviour - however long you press a key the DTMF generated 
was the same length. After seeing your message I tried my own network 
again today. It now appears very broken. A quick press gives about 
750ms. If I hold a key down this is stretched. However, if I hold it 
down more than about 4 seconds the DTMF stops. After that things go 
weird. Further key presses don't come through for a while. Then they 
kinda start, but do all sorts of odd stuff, sometime sending the whole 
backlog of keys, paced at about one a second.

It looks like they have changed the behaviour, but sane it certainly 
isn't. The reason for manipulating these lengths is to try to make the 
behaviour robust in poor signal conditions, where command from the 
handset may not be very reliable. It looks like they may have changed 
things to try to convey at least some of the timing of key presses. It 
looks they have seriously screwed up. :-)

Because the minimum duration is stretched to 750ms, rhythmic input still 
ain't gonna work.

Steve





More information about the asterisk-dev mailing list