Summary:ASTERISK-20748: Asterisk system didn't accept some dtmf digits when It called by a external PBX phone
Reporter:Code Breaker (codebreaker)Labels:
Date Opened:2012-11-28 04:27:16.000-0600Date Closed:2013-02-14 15:32:10.000-0600
Versions: 10.10.0 Frequency of
Environment:CentOS Linux, Asterisk, libPri 1.4-current, DAHDI 2.6 Card Details : Single span digital telephony card TE121. and using PRI E1 lines Attachments:( 0) debug.txt
( 1) dsp.conf
( 2) fsReceive1.wav
( 3) fsTransmit1.wav
Description:When some one call on our DAHDI(asterisk) system by their landline phone or the mobile phone the call goes perfectly and asterisk accept each of the dtmf digit pressed at other end.

but when the same call is done by their PBX phone, the system ignore some digits like when we press 100136972 it shows 100192, and if we do it again it shows 1001392.

I have tried
1. relaxdtmf = yes /no
2. toneduration = 300

but nothing help me.

Comments:By: Michael L. Young (elguero) 2012-11-28 08:34:34.453-0600

What kind of "pbx phone" are you using?  SIP phone?

If SIP, please also attach a pcap of the communication between the phone and the PBX.

We require a complete debug log to help triage the issue. This document will provide instructions on how to collect debugging logs from an Asterisk machine for the purpose of helping bug marshals troubleshoot an issue: https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

By: Code Breaker (codebreaker) 2012-11-28 23:29:20.928-0600

debug asterisk CLI when a communication is going on between our asterisk system and their PBX phone

By: Code Breaker (codebreaker) 2012-11-28 23:32:57.026-0600

Hi Michal, The problem occur when client dials our number, according to them, they are using ePBX phone,(Panasonix Advance ITX, DB.01017).

The client dial the call receive using PRI line, handle on DAHDI. I am attaching a debug when the communication is being going on.

They guys actually pressed 10011630903406. but our system ignore 4 and 6
and when the call has been second time it ignore 6 and 3.

By: Richard Mudgett (rmudgett) 2012-11-29 11:47:42.023-0600

DTMF decode has recently been made user configurable in dsp.conf because the DTMF specifications differ slightly among regions.  See ASTERISK-17493 and ASTERISK-20442 and the dsp.conf.sample file in Asterisk versions with these issues incorporated.

By: Michael L. Young (elguero) 2012-11-29 13:56:48.556-0600

Please confirm if following Richard's suggestion to make changes to dsp.conf helps correct this issue for you.

By: Alec Davis (alecdavis) 2012-11-29 18:55:54.571-0600

@Ankit start with changing the twist levels to 20.0, which is effectively disabled, see section below.

The term Twist is referring to the acceptable power level differece between the HIGH group of DTMF tones and the LOW group.
By default, the AT&T spec is quiet tight.

In file dsp.conf

If the above makes the DTMF detection better, then backoff the changes until acceptable.
Leaving the twist values at 20.0 risks 'talk off', which is where speech can trgger the DTMF detector.


By: Code Breaker (codebreaker) 2012-12-03 03:18:27.583-0600

@Alec Davis I have made the changes in the dsp.conf, even I make all values 20. but the problem still remain same.

Can you please tell me some more options which I can try? This problem makes me frustrated.

By: Alec Davis (alecdavis) 2012-12-03 17:16:33.723-0600

Ankit, not sure where to go from here.
But I need to confirm that these settings were put in dsp.conf under the [default]

By: Code Breaker (codebreaker) 2012-12-04 00:00:54.687-0600

The dsp.conf file which I have used.

By: Code Breaker (codebreaker) 2012-12-04 00:01:02.478-0600

@Alec Yes I have added these setting under the default context.
I have also attached my dsp.conf. Please have a look on it.

By: Alec Davis (alecdavis) 2012-12-04 02:44:00.117-0600

your dsp.conf looks fine.
Are you still running with the settings at 20?

10011630903406 << user dialled
1001163090340  << asterisk saw
From the debug.txt file starting at [Nov 27 17:15:04] only the last '6' was missed.

But what confuses me is this is before the changes to dsp.conf would have been made.
How ever I'm guessing the changes made no difference.

What also concerns me is the line:
[Nov 27 17:15:13] DTMF[1081] channel.c: DTMF end '4' received on DAHDI/i1/2267811000-21, duration 25 ms
A duration of 25ms is very short. The DTMF minimum is around 40ms.

If they are indeed coming in at this rate, then changing 'dtmf_misses_to_end=2' should allow for a 25ms silence gap.
The default is 3, which is ~37ms. But the more I think about it, we support zero interdigit pause.

you could try in dsp.conf setting, these are really fast DTMF, but worth ruling them out;


for these changes to take effect at the CLI type 'module reload dsp'
Or restart asterisk

By: Code Breaker (codebreaker) 2012-12-04 23:05:27.715-0600

@Alec Davis

I have applied the above setting, but it does not work for me. The problem still remain same.

By: Rusty Newton (rnewton) 2012-12-13 18:44:53.351-0600

Ankit, can you use [dahdi_monitor|http://docs.tzafrir.org.il/dahdi-tools/man/dahdi_monitor.8.html] to record the input (RX) stream of the inbound call. Then also attach debug like you have already gathered(asterisk full log with DTMF debug), but for that particular call. That may help a developer to compare the audio coming in before it gets to Asterisk, to what Asterisk is detecting.

By: Code Breaker (codebreaker) 2013-01-08 07:07:34.048-0600

Sorry for being too late.

@Alec Davis I have applied those settings and restart the system. The system accept the digits but now it ignore the digits randomly (before apply the setting it ignore digits every times), most of the time it ignore digit : 3

The setting work for me is
dtmf_reverse_twist=3.2 and rest are same as before. (Can you please tell me in detail "what is it means?")
Now I have increase its value, but system still ignore the digits

but one more problem occur, the tempo of the wav file got increase automatically only for same PBX phones (not for other landlines and mobile phones).

@Rusty Newton I have use dahdi_monitor to record rx stream. The digits which has ignored was not shown in the recording, mean the digit has been pressed at other end but our system didn't receive any such digits. Can you please tell what more options we can try.

By: Michael L. Young (elguero) 2013-01-08 09:33:25.859-0600

Ankit, so you are saying that at your hardware (DAHDI) level it is not even receiving the DTMF tone?  If at the hardware level, there is no DTMF, Asterisk will never receive anything, if I understood you correctly.

I want to confirm your setup:
Remote Location:                     Your Setup:
PBX Phone -> PSTN                    PSTN (PRI) -> DAHDI -> Asterisk

If I am understanding everything correctly, then you need to be looking at the remote location and confirm whether DTMF is being passed out to the PSTN or not.

Since calling in to your setup from any other phone (you mention that people calling in on other land line connections and mobile connections) works, you have basically narrowed the problem down to this one client's setup and they need to be looking at their PBX or PBX phone to figure out why it is not sending all the digits over the PSTN.

By: Code Breaker (codebreaker) 2013-01-08 23:38:34.491-0600

@Michael L. Young, Yes I have a setup as you described. This problem is not for a single client but it is for all of the clients who have setup the PBX phones at their ends.

Even DAHDI system was not receive the dtmf digits before, but when I change my dsp setting as previously define, it starts receiving but still it ignore few digits mostly 3.

One more problem occur for all of the PBX client, that tempo of the wav file(which have play at our end) got increased automatically.

By: ibercom (ibercom) 2013-01-09 12:58:32.819-0600

Ankit, can you try DAHDI 2.4.0 ?
I have problems with DTMF and DAHDI 2.5 - 2.6 in a busy machine.

By: Rusty Newton (rnewton) 2013-01-16 09:44:43.485-0600

@Rusty Newton I have use dahdi_monitor to record rx stream. The digits which has ignored was not shown in the recording, mean the digit has been pressed at other end but our system didn't receive any such digits. Can you please tell what more options we can try.

Ankit, please upload the dahdi_monitor recording of the call where you are sending DTMF digits to Asterisk. We'd like to take a look at it. Press "Send Back" when you have provided feedback.

By: Code Breaker (codebreaker) 2013-01-28 04:18:13.444-0600

I am uploading the dahdi_monitor recording. It accept the DTMF digits but the digits does not detected by the asterisk system.

I am wondering with a problem
Our system needs DTMF two times, 14 digits in first time and 4 in second time. System ignore only 3,6 digits n second time. No digit is escaped in first time.

I will highly obliged if you tell me the detailed meaning of dtmf_normal_twist and dtmf reverse_twist.

By: Code Breaker (codebreaker) 2013-01-28 04:24:34.877-0600

dahdi_monitor recording files

By: Alec Davis (alecdavis) 2013-01-28 05:07:20.718-0600

Reverse Twist and Normal Twist:
from http://www.britishtelephones.com/dtmf.htm the 8dB and 4dB values are specific to UK.

{code}Twist is caused by a non-uniform power loss across the frequency spectrum.
Normal twist is when low frequency power is greater than high frequency.
Reverse twist is obviously the reverse condition.
The detector must be reject 8db and 4db for normal and reverse twist respectively.

By: Rusty Newton (rnewton) 2013-01-31 14:25:10.304-0600

I used multimon to decode DTMF on the fsReceive1.wav file  (http://www.baycom.org/~tom/ham/linux/multimon.html)

multimon shows


A)do those numbers and sequence match what you dialed in the test where you captured that audio stream?
B)do those numbers match what Asterisk detected for that call?

By: Code Breaker (codebreaker) 2013-01-31 22:35:34.951-0600

Yaa I have passed 1,3,3,3,3,1 but our asterisk system receive only 1,3,3,1.

But when I make the value of dtmf_reverse_twist = 7.98, it starts receiving all digits.
But I want to know , Is there any drawback or cons to set the twist value 7.98.

By: Alec Davis (alecdavis) 2013-02-01 04:27:44.346-0600


From dsp.conf.sample
; Power level difference between frequencies for different Administrations/RPOAs
;               Power Gain              equiv
;               normal  reverse         dB's
; AT&T(default) 6.31    2.51            8dB(normal), 4dB(reverse)
; NTT           3.16    3.16            Max. 5dB
; Danish        3.98    3.98            Max. 6dB
; Australian    10.0    10.0            Max. 10dB
; Brazilian     7.94    7.94            Max. 9dB
; ETSI          3.98    3.98            Max. 6dB

Looks like your setting required the Brazilian levels, which are 9dB for normal and reverse twist.

The draw back, is if the reverse twist limit is too high, like 20.0 (or 100dB) as I first suggested, you run the risk of speech being detected as DTMF - this is referred to as 'talk off'.

With the default reverse twist of 2.51 (or 4dB), digits may be missed where line conditions do not meet AT&T specifications.

But as you have now closed the reverse twist limit to 7.98 (or ~9dB), I don't think you'll have the 'talk off' issues.


By: Alec Davis (alecdavis) 2013-02-06 22:20:47.045-0600

Ankit: Can this be closed?

By: Code Breaker (codebreaker) 2013-02-06 22:29:12.634-0600

@Alec When I check the log of my system then I found the new issue that my system accept 'A' as digits while user didn't enter any such digit.

Do this issue occur due to reverse twist limit?

Else we can close it, or please tell me solution how we can resolve this issue?

By: Rusty Newton (rnewton) 2013-02-14 15:29:27.699-0600

Do this issue occur due to reverse twist limit?
If you only started seeing the erroneous 'A' digits after you changed the dtmf_reverse_twist value, then I presume that is what caused it or at least part of the cause.

Else we can close it, or please tell me solution how we can resolve this issue?
I'm going to go ahead and close this, as it doesn't look like a bug.

After you have tweaked the various DTMF settings, if things are working then I wouldn't worry about the occasional stray 'A' digit if it doesn't bother your configuration.

Tweaking your DTMF configuration to get it just right is a configuration & support issue.

Despite JIRA not being a support forum, Michael and Alec have been extremely helpful in guiding you to the issue. You can continue to request help for your configuration issue on the Asterisk mailing list at http://lists.digium.com/mailman/listinfo/asterisk-users. If others still have assistance to provide, they can do so there.

If anyone feels that there are code improvements that can be done to make this configuration issue easier to solve, then feel free to re-open this and add a patch.

Thanks everyone!