I'm trying to do something I think much simpler, and it sounds like you have that part figured out ... I've got an analog phone line (two pair) that I want, using a RPi (and presumably modem) to get a dial tone, and dial a number; when it connects, put the output to a speaker (and input a microphone), and is able to send hang up commands to the modem type device and also listen for touch tones received. It would be put into the physical shell of a call box at a gate entry, to connect would-be visitors to the station via conventional phone.
I figured it was possible with an RPi but don't know where to begin. Any advice on that would be really appreciated! (And, sorry I'm no help in what you're trying to do, although I agree, this problem has to have been solved elsewhere, somehow)