DTMF allows key-presses on inbound and outbound calls to be recognized by a phone system capable of decoding and registering these tones. This is useful for audio navigation of menu systems, IVRs, and phone trees.
With VoIP, DTMF is delivered using one (or more) of the following methods:
RFC2833 (recommended!), the time-tested and IETF-approved RTP DTMF signaling method. Almost 100% of VoIP carriers support and prefer this method.
Inband tone generation, usually known as "inband." Using this method, the audible tones are generated just like speech.
SIP INFO. This method was designed to signal digit presses as a SIP signaling packet, however it is difficult to use end-to-end and in a multi-carrier environment.
DTMF usually works without incident, but if you're having trouble with DTMF tone recognition on your Asterisk-based PBX you can try some of the following remedies.
Not setting a DTMF mode.
Some Teliax users report that removing references to a DTMF mode on their Asterisk-based PBXs (trixbox, FreePBX, etc.) will resolve DTMF issues. This is accomplished by editing the trunk or sip.conf to remove any reference to lines like "dtmfmode=rfc2833" or "dtmf=inband." This will let Asterisk negotiate DTMF based on the SIP/SDP.
Explicitly setting a DTMF mode.
On the contrary, some devices (Linksys, IP phones) require you to set a DTMF mode. In this case, try setting RFC2833 as the DTMF. If that's still not working, try inband.
Older versions of Asterisk (pre-1.4, usually) have trouble with RFC2833 or other DTMF modes. Some versions of Asterisk 1.4 actually send both inband and RFC2833 when you have RFC2833 enabled. If you're using an older version of Asterisk, an upgrade can be beneficial not only for DTMF, but for security and bug fixes as well.
These are just some places to start. If you're still having trouble after trying these, a quick Google for a combination of your PBX and DTMF will likely yield some great results if anyone else has experienced similar problems. DTMF is tricky, especially in a multi-carrier environment. We do everything we can to standardize and normalize what we receive from carriers and what is sent to carriers, however sometimes these issues take a bit more troubleshooting to find something that works.