IVR - DTMF not recognized?

I run Freepbx 2.4.0 with all module updates on Ubuntu Server 8.0.4.

I have a Sipgate Trunk which works fine for inbound and outbound calls.

Now i want to create an IVR wiht 2 options.

If i press 1 it should connect to extension 2003 and if i press 2 it should connect to extension 2004.

Unfortunately i only get the recorded message (press 1 for 2003 or press 2 for 2004) played but pressing any buttons on the phone does not have any effect and after repeating the message 2 times the ivr times out and hangs up.

Can anybody help? Where can i look for misconfiguration?

check with your trunk provider for dtmf signaling. it is not set to patch what they are providing which results in what you are seeing. The sip trunk can do inband,rfc2833 (out of band) , or info (I also thought there was auto ut could be wrong). you need to match what they are doing.

for what its worth, you need to use GSM protocol to carry DTMF signalling correctly or reliably, I remember this advice that someone once gave to somebody (on another forum), it works for me, its not like DTMF won’t work with other codecs but it may not always work if I understand it correctly

Thanks for your help :slight_smile:

Sipgate needs rfc2833. So i changed my trunk. I looks now like this:

Unfortunately it does not work :frowning:

Any other hints? Maybe in IVR or Announcement configuration?

Ulaw works best for RFC2833…

From the WiKi

Unreliable detection of inband DTMF
Possible solution: Make sure you have a zaptel timer / timing device, i.e. either ‘ztdummy’ or some zaptel hardware on your system.
Another possible solution: If your asterisk isn’t reliably recognizing dtmf and you’re using a provider that only supports inband dtmf, consider dumping them for another provider that can give you out of band dtmf such as RFC2833. Depending on your situation, this may be an easier fix than some other solutions. Inband dtmf detection seems to be very problematic.

Testing DTMF with Asterisk
The D option to the Dial command transmits DTMF tones, with a ‘w’ causing a pause:


remember the issue popped up when the world switched to 1.4 branch of asterisk…the world moved on did your provider??

Thanks for your help.

My provider (sipgate) supports RFC2833.

The Zaptel Dummy Module is also loaded (i already need it for conferences).

Changing the allowed codec to ulaw does not help :frowning:

Changing “toneduration=600” and “relaxdtmf=yes” in zapdata.conf does not help either.

Any other ideas?

That will solve your issue:

include the following entries in sip_custom.conf file in /etc/asterisk

externip = xx.xxx.xx.xx
localnet =
defaultexpirey = 1800
dtmfmode = rfc2833
port = 5060
bindaddr =
disallow = all
allow = ulaw
allow = g729
allow = gsm
allow = g723


ulaw is for the North America, alaw is pretty much the rest of the world and from the looks of it you need alaw NOT ulaw. DTMF works perfectly when using ulaw and alaw (that’s the encoding the phone company uses to send the calls down digital trunks like PRI, T1, E1).

The g729 and g723 codecs by default will only work in pass through mode (i.e. not touched/interacted with/ recorded by asterisk in voicemail, IVR, etc. ) otherwise you need to purchase and install licensing for each of them to work. So unless you have licensing installed for them, allowing them can cause a problem.

monotek are you behind a firewall? if so you need to change nat=no to nat=yes.

by default bindaddr defaults to bindaddr= so not listing it is the same thing.

You also don’t say which version of asterisk you have installed.

Thanks again for your help and sorry for the long delay.

It works now for incoming SIP calls from local clients.

This is the used configuration:


Unfortunately im not able to get this work with calls from normal phones or cell phones.

Any other hints for this?

I am actually having the exact same problem with a slight twist. we have 2 companies on the exact same PBX system which is 2.4.0 One companies IVR is working fine while the other will not accept DTMF tone corrrectly. Their current circuit vendor happens to be the vendor that the majority of our boxes are on and we have never had an issue with DTMF tone with them. This would be a first. the thing Is i am scared to change dtmf to “dtmfmode=rfc2833,” because the bigger of the 2 companies is the IVR that is working and the smaller office is the one not working.

Our current config is:


I’m not sure if this fix applies to others as well, but I fixed my inbound DTMF issues by replacing my firewall. I was running FreeBSD based firewalls (m0n0wall and pfSense) and switched to a couple of Cisco/Linksys RV042s. I also tested the setup with a basic Linksys WRT54GL router loaded with Tomato firmware.

I can’t take any credit for this I couldn’t figure this one out without the help from the support staff at Sipgate. Kudos to them!

There’s been quite a lot of threads on various forums / newsgroups about problems with incoming DTMF signalling with Sipgate trunks. I’ve been suffering the same problem so not being able to use IVRs. Anyway today I decided to get it sorted and the possible reason for the issue that I’ve found is this - the voicemail facility provided by Sipgate themselves.

I have several accounts with Sipgate. For any that I have activated the voicemail facility (i.e. set up a PIN) the incoming DTMF does not work. For any Sipgate account where I have not setup the voicemail DTMF works perfectly. I’ve asked Sipgate if they could disable the voicemail for one of my ‘troublesome’ accounts just to help prove/disprove my suspicion - I’ll see what they say.

As for other settings, key one is dtmfmode=rfc2833 in sip.conf. With the Codec issue, alaw / ulaw no problem, GSM should also be fine. Lower bandwidth codecs such as G729 not so sure - suck it and see. Certainly for troubleshooting I’d stick to alaw/ulaw (G711) first, then try others once that’s working.

Just my 2 cents worth - hope it helps someone


I have same problem with Asterisk and TalkSwitch PBX (TS). I created a SIP Trunk in Asterisk connecting to TS.

The registration is successful, I can make outgoing calls and receive incoming calls without any problems.

I enabled the IVR into this SIP truck so that the caller can enter the desired extension.

The problem, SIP trunk does not recognize the DTMF from analog phones or PSTN connected to TS while it is working fine with IP Phones connected to TS.

Any help.