Have you written anything on the development of this project, or is this something you'd consider? I would love to build something similar, and the idea of combining old analogue technology with modern tools and integrations- especially PBX- is quite intriguing.
Asterisk is extremely powerful and reliable with good documentation. Because so many companies use it, I knew if something wasn't working that it was definitely on my configuration. Once you have Asterisk running on the LAN, you can you use any VOIP softphone app to connect and make "calls" to your scripts for testing.
I bought an analog telephone adapter (ATA) to connect the phone to the LAN as well. At that point, the ATA is the bridge between the PBX and the physical phone and it can now make and receive calls (to destinations reachable by the PBX).
If you want to make your scripts and devices accessible to the "real phone system" (PSTN) you can hook your ATA to a phone carrier (some ATA support this with a secondary port) or have asterisk connect to an external provider. I have not done this step.
There is definitely a bit of steps involved, so it would make a good write-up. A lot of potential to do some fun things with it.
I did create some static filler phrases stored locally (ummm, let me think, good question) to break the silence.
I am using Asterisk on Debian that calls my python script. The analog phone adapter auto dials when the receiver goes off hook, because rotary dialing sucks that much and the answering extension is chatgpt role playing different characters based on prompting.
I think it is neat. I need to work on better voice synthesis and improve latency a bit still, but it is a nice toy.