google dtfm decoder
I think you assume that the DTFM tones are monotones, that is each button has one unique frequency, that is not the case, each button has two tones mixed so a simple frequency counter sketch would not be able to give you what you need.
I am using a MT8870 DTMF tone decoder chip in this project. I tried doing the decoding in the Arduino, but it was unreliable. With the MT8870 it gets the number right every time.
If the plan is to make the Arduino act like a human pressing a keypad button, then that is not easy. It takes a fair bit of external circuitry.
There is probably a better way to do what you want, if you will tell us more about the project.
jremington - you are correct I essentially do want to make the Arduino press a keypad button. The project is to interface an old analog paging system with a modern SIP phone system. The SIP side is "easy" and it will generate DTMF tones all day long, but it is also fussy. The paging system uses a non-standard dial tone frequency. To a human the dial tone sounds funny, but the SIP system's FXO port ignores it because the frequency is out of range.
The analog paging system is basically its own PBX and uses old school telephone technology. So that means it has 48VDC on hook voltage and requires and a 7VDC button press voltage. It doesn't "hear" the DTMF tone without that voltage being applied to the line. My plan was to use an inexpensive analog phone to isolate the Arduino and handle the DTMF tone generation and voltage. The 7 wires refer to the columns and rows for the buttons on the handset. I can simulate button presses by shorting the correct wires.
So, that's it in a simplified nutshell. Ideas or suggestions how to get an Arduino to "press" a button greatly appreciated.