Hardware selection for VoIP
I don't think an ESP8266 has the necessary computational power to pull this off.

Also, for VOIP you really want a fully fledged networking stack, you'll need some kind of multitasking OS and so on, so the ESP8266 is even architecturally not a good fit.

So: do what everyone does, get a Linux-capable box (a raspberry pi or so?), and run linux and a VoIP gateway software on it (for example, asterisk, although that is a really large project). If you search the internet for help on how to "connect {name of VoIP gateway software} to POTS" (POTS = Plain old telephone service), you'll find hardware recommendations. Be warned that handling telephone line signal levels is not very nice for standard components!

Anyway, there's literally hundreds of consumer telephone-VoIP gateways – they often come in the shape of DSL routers. In Germany, for example, the Fritz!Box brand is really popular, and you can buy a used one that talks DSL and plain old telephone on one side, and WiFi, ethernet and VoIP on the other. If you don't have DSL, well, then DSL doesn't work. These things are often sold for much less than 10€, so if you're after a cost-efficient, known-to-work, reliable and easy-to-use solution, go for that.

There's also dedicated cheap POTS-VoIP boxes, but I've never used one of these.

To answer your question regarding requirements:


Voltage tolerance up to ca +- 50V (Ring voltages are pretty mean!)
electrical interface to a low-impedance network, with  the option to short-circuit and open the lines (to simulate the physical hang-up)
some very mediocre current sensitivity for the receiving end
officially, an adjustable resistance as the "microphone replacement". Think Op-amp controlled current source.
DTMF tones are the least of your problems – they're just tones. If you have a computer of any kind that produces the audio of your telephone call, it could just as well generate the call tones.


Thinking about that, a good old dial-up modem would do the trick of dialing and physically handling the line for you, and once the connection is made, you could "splice in" your signal path (very much like people used to have modems and telephones on the same physical telephone line, and if you picked up the earpiece while you were online, there was a chance to "hear" the digital transmission until it broke down. Which wasn't pleasant at all.).

Again, very much homebuilt stuff for electronics that are very cheap used and still cheap new, and ship to everywhere in this world that has a postal service (China really isn't that strict on embargoes, but that's a story for another day).