AIS style custom anouncement

I want to ask if this is possible within freepbx. I want a dynamic recording to anwser my trunks,
but I don’t want to use TTS, I want to record my own phrases, as the old AIS systems did.
I want to set up a webhook to a homeassistant instance that will select what phrases to use.
The webhook takes CID and DID and responds with a string of digits, with zero skipping the step.
Say I record/program the folowing phrases/actions:

Phrase 1 Phrase 2 Phrase 3
Goodmorning, Good afternoon, Good evening,
Family name. Bussines inc. My name.
My lines are tied right now. I’m having some technical trouble right now. We are closed right now.
Please call back later. Please stay on the line. How many times do I have to tell you not to call me.
{terminate} {park} {black_hole}

Some examples:

GET homeassistant.local:8123/api/webhooks/AIS-welcome?CID=business-number&DID=business-line
200 OK
32311
Good evening, Bussiness inc. We are closed right now. Please call back later. {terminate}

GET homeassistant.local:8123/api/webhooks/AIS-welcome?CID=ex-number&DID=home-line
200 OK
13033
Good morning, My name. How many times do I have to tell you not to call me. {black_hole}

Would this be possible? Do I need to host this on a seperate machine? How would I get the DID and CID to the webhook in the first place?
If you have better suggestions to make this work other than the webhook and syntax i’ve explained please let me know.

1 Like