I've built telephone line interfaces for years. I used to carry the Carterphone Decision WikiPedia HERE: around in my briefcase to show to unbelieving OutSide Plant Supervisors at various phone companies I worked with as a Broadcast Engineer.
It is not "Illegal" to build and connect your own devices to the switched telephone network (POTS). As long as (as the decision said), "as long as they did not cause harm to the system.". These days you see the community center holding "wire up your own telephone" classes with a bunch of everyone from kids to little old ladies. It's Over.
So what you basically need:
RING DETECT: A low-current Optoisolator with it's input LED in series with a small capacitor. I think I used .1 Uf in series with 1000 ohms). Try this first with a plain LED, capacitor and resistor. You should see the LED light on ring. OH: You need another LED back-to-back with the first one so the reverse voltage is controlled, or ZAP goes the LED.
The OPtoisolator output goes to an Arduino Digital input which you will be polling for RING.
- A small isolation transformer (ideally about 600 to 600 ohms impedance) whose primary is connected across the phone line in series with a 10 Uf or so Non-Polarized Capacitor (Can use two electrolytic capacitors back-to-back-opposite polarity for this). The isolated secondary winding gives you audio off the line. As mentionaed, old MODEMs have all these parts.
DTMF Decoder/Receiver: You send the audio signal to it. Maybe use a prebuilt module?
These decoders give you 4 bits of "what button was pushed" and a "Valid Button" bit. Grab them as decide..
UPDATE: The schematic HERE: shows a capacitively-coupled approach with no transformer. See the article HERE:
You can start breadboarding this. One thing at a time. Stepwise refinement..
The POTS (Plain Old Telephone System) is it's own best defense. Open circuit is 48 VDC. Short Circuit is about 60 mA. Ring voltage is about 100 VAC at 20Hz which can jolt you but not kill you.
If anyone wants to send high-quality audio over the phone line, email and I'll dig out my 40 year old schematics. I designed and published Telephone Talk systems for Broadcasting before the Carterphone decision was a month old. Most small radio stations use the regular telephone system to send audio for remote broadcasts like football games back to the studio. Lately a lot is done on the web if that's available. When I first helped my Dad set up Broadcast Equipment at Yale Bowl in 1951, he had the phone company set up physical long line wired connections direct to the WELI studio.
A lot has changed in 60+ years :-)