There can also be hundreds of volts on the line at various times, not to mention induced voltages during storms.
Once you've handled that, it should be fairly easy to generate the right signals and do handshaking. An RP2040 / raspberry pi pico should be more than adequate.
Status changed from Stalled to Resolved
% Done changed from 80 to 100
"The break-out board has been verified by tnt at CCC Camp 2023, where he successfully transmitted a Fax (using spandsp) via pulseaudio - alsa - usb-audio - iCE40 FPGA - AMR riser. Closing."
A phone on-the-hook appears like an open circuit to direct current. Off-the-hook the circuit is closed, and current starts flowing. (Pulse dialing and "flash" signals open/close the circuit, telegraph style.) And ringing on POTS is done by applying about 20 Hz AC to the line at around 100 volts -- enough to make an electric motor ring a bell, or unpleasantly surprise someone playing with the "low voltage" phone line.
So you need to block the AC ringing (and other spikes), block the DC bias voltage (while presenting a phone-like impedance to the line), and then join both the DAC and ADC to the same two-wire line with matched impedance. It could be anywhere from a couple transformers and a few resistors and caps, to a very complicated arrangement with amplifiers, active noise cancelling and gain control circuits, etc. (There used to be dedicated ICs for those things.)
POTS, by its analog nature, is extremely flexible in practice. A couple 9V batteries are often enough to make two old phones work as intercoms. But the faster you want to go the more important it will be to match the expectations of a POTS line exactly.
I was living in a ramshackle house and I wanted dial up internet so I went to the phone company, paid the deposit, and activated my home phone.
Got back home, set up my computer, started looking for the phone line. No phone line.
Went to the store, bought the phone jack and some cable, hooked it up to the box outside, fished it through the wall.
No wire stripper. Not going to go to the store for a cheap wire stripper when I have teeth.
Bit into the wire, stripped the first one. Bit into the wire. Stripped the second one. Third one. Bit into the fourth one and got my world rocked.
Duh. Stupid. Phone is live. Hooked everything up, plugged in a phone and it immediately rang.
I answered, "Hello?"
Some woman: "I've been calling you for hours now! Where is Jake?!"
"I don't know a Jake"
"Stop lying! I know you know Jake!"
"Ma'am, I just turned this phone line on a few hours ago. I don't know Jake. You've got the wrong number"
"Oh, well, if you see Jake tell him I'm looking for him."
"Will do..."
This woman was calling my new number and fried the stupid out of my mouth looking for some guy. Strange coincidences abound.
Tony Fisher wrote V.32 soft modem stack for SGI Indy back in 1996. York University couldnt handle hosting whole 8 megabytes of his stuff https://www.cs.york.ac.uk/news/fisher/home-page but at least they had the decency to upload it to github instead of just deleting https://github.com/university-of-york/cs-www-users-fisher/tr... Randy Rossi rewrote this project and got working V.21/23 https://github.com/randyrossi/fisher-modem
Fabrice Bellard, because of course he did :), implemented his own version all the way to V.34 with parts of V.90 https://bellard.org/linmodem/ Currently actively maintained by Osmocom project https://osmocom.org/projects/linmodem "In Late 2021 we started a project to support AMR_Modem_Riser cards via a custom break-out board (#5294) and an associated FPGA softcore to interface the AC97 master interface with USB (audio)."
V.21 modem implemented in Gnu Radio https://web.archive.org/web/20170627151353/http://aaronscher...
amodem - good source of ready made modulation implementations https://github.com/romanz/amodem
minimodem- simple radio link FSK modem https://github.com/kamalmostafa/minimodem
audsl - leased line project, not compatible with standard modems https://www.araneus.fi/audsl/ but might give some ideas.
If I remember correctly as most of them were DSPs and need a driver to load a binary blob to work correctly. All of them had their own spin on the process. Most linux distros did not ship the blobs either. So you would have a bit of fun cracking it out of some random windows EXE just so you could put it somewhere the driver could reach it. It was worth the extra 20-50 bucks it would cost just to not buy one of those things and use it in linnx. Remember this was at a time when a bit of ram (1MB) would cost 100+ dollars. There was a reason they were cheap. They did not have enough hardware to run standalone and relied on the OS to do the loader work.