Friends, good morning!
I have a client who is a medical clinic, and they needed an automatic confirmation solution (where the PBX pulls the doctor’s schedule, saves it in a database, calls the patients, informs them of the appointment via Azure Voice AI and gives options to confirm, cancel, reschedule, among others).
We managed to achieve this goal with the help of some Python scripts and the creation of some ODBC functions, the scheme is as follows:
Scripts location: /opt/medical
agenda.py (script that pulls the agenda from their system endpoint and saves it in a database, runs every day at a specific time getting the next day’s agenda)
dialer.py - calls patients (originating a call via AMI), and when they answer, forwards to the ivr-medical context
confirmation.py - script that runs in a loop, whenever a new entry is detected in the confirmations table (when a client confirms a appointment via ivr), sends this to their system endpoint
see the context here: Context - AMI AI Calls - Pastebin.com
and the python script who initiate the calls: Context AI Calls - Pastebin.com
In general, this scheme has been working well, and there are a few more scripts (like the one that calls the Microsoft Azure API and generates the audio that the context plays) but one difficulty that I haven’t been able to solve yet is getting these calls to be recorded correctly .
I even managed to get the audio to be generated through context, but it remains silent and only lasts for a second. Is it something I got wrong in the context? or in the script? Is there an easier way to do what these scripts are doing? If someone can help me with this I would be very happy.
ps: some things were translated from pt-br (original language where everything was written, like the comments) to English, so if something was confusing I can clarify… also, if anyone is interested in some of the scripts (start call, pull agenda to save in the database, script that generates audio with azure) I can send or publish on pastebin.