I am currently writing a module with FreePBX with the attempt to monitor some IVR traffic. I am able to modify the existing IVR Module code to achieve what I want (although this is not a solution I deem satisfying).
I currently have modified the IVR module functions where it writes out it’s part to extensions_additional.conf with the following line:
$ext->add($id, $dest['selection'],'', new ext_system('echo "$(date +%s)|${CDR(uniqueid)}|'.$item['ivr_id'].'|'.$dest['selection'].'" >> /var/log/ivr-track.txt'));
This allows a secondary script to read up the logs and do tracking on it.
My curiosity is whether there is a way I can write a module myself that would add these lines without mucking up the IVR module’s code.
I am relatively new with modifying code in FreePBX and if I am in the completely wrong direction I would appreciate if anyone would let me know.