New script to make call recordings visible in ARI
After working with Perry's archiver script for a bit and finding that I couldn't get it working on the latest release of TrixBox, I decided that it wasn't what I really wanted anyway, since it still required central control and didn't give control back to the end users. So I wrote a shell script that parses the monitor directory and moves the files to the voice-mail directories instead. This way the individuals doing the recording had control over their own recordings. Only idiosyncrasies I can see with this are as follows:
- If a call between extensions is recorded, the recording is sent to BOTH voice mail directories, since it's not easily possible to discern which extension invoked the recording. If you only allow the calling party to initiate the recordings then you can comment out the second "if" clause for the RCD_TERM_EXT so it only delivers to the originating extension.
- So you can discern a recording from a regular voicemail in the verbal interface, the from number is prefaced with 999 and the to number is prefaced with 222 when it reads back the caller to you
To install:
1) Download the script from:
http://support.infoarch.com/tools/move-recordings.zip
2) Expand the contents of the archive with unzip
3) Edit the usr/local/bin/move-recordings.sh script to set your correct MIN_EXT and MAX_EXT for your extension range, then move it into /usr/local/bin and make sure it is executable.
4) Move the etc/init.d/move-recordings startup script to /etc/init.d and make sure it is executable.
5) Run "chkconfig --add move-recordings" to add to run levels
6) Add a crontab entry similar to the following:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/move-recordings.sh
I set mine to run every 5 minutes because I have low volume, and demanding users. Adjust as needed for your user base.
So bottom line is that this makes the recordings usable within the existing interface without any major modifications to the core system.
markh AKA oneobserver
This looks pretty good.. I am not a fan of the ARI mostly because tracking monitors is crappy but this looks like it could be a decent solution... maybe the trick is to hook up with the FreePBX team and see if it could be put in to the dialplan and used as an AGI and called as needed and more real time....
I just updated the initial post to remove caveat 2, since that was an artifact of my bad programming that I fixed, and added to Step 3 of the Install instructions to note that you need to edit the script to set the appropriate MIN_EXT and MAX_EXT for your extension range.
Yes, James, it would be nice if we could get this functionality built into an AGI script and part of the actual recordings interface. The script would have to be converted to perl or PHP though and that's a bit beyond me still. If anybody else would like to attempt it...
Yes, jahyde, you can also host the file as well. Please grab the version I just put up there as I added the first post as a README-First file so it would have some self contained instructions. If I make improvements I'll post updates to this thread so you can grab the improved versions
There are probably lots of things that could be added or changed, but it's a good workable start on something that's been missing for a while, and something I didn't want to pay the upgrade to the hybrid hosted version to get back.
markh aka oneobserver
Just updated the script for most likely the last time. I estimated the length of the message and added that, and added "from_number to to_number" to the description to make it easier to identify the recordings. New file is updated on the server.
This will be most likely the last time I update this as I don't see much else to do to it with the lack of access to further information about the recordings.
markh aka oneobserver
I just updated the script one more time. I had to add a bit of error checking for extensions that had not yet set up their VM, and I changed the way the files were moved over so they actually are named correctly such that the ARI and phone interface can now both access the recordings properly. I had to build in an artifact so the recordings could be verbally identified as recordings. It now prefaces the from number with 999 and the 2 number with 222, so you can tell this is a recording. It can make the read back a bit long, but there had to be something...
I updated the initial posting to note the new change. The only outstanding item I can see is that there is a slight possibility of a race condition if there is a new VM coming in, or somebody is deleting VM's in the INBOX while it is processing the new recordings.
The file has been updated on my archive, so if any of you are holding copies, it's time to update your archives.
markh aka oneobserver
The right solution for this would be to actually add a new folder in each VM box for Recordings and put it there. While this violates my original premise of no changes to the original structure of trixbox, it was easy enough to modularize the script to handle a defined folder name. Now if somebody can tell me how a new folder could be added to the change folders option in the VM interface...
markh aka oneobserver
P.S. that also means I just updated the file again
Just a suggestion, I know this is probably a personal toy but since your invested in the gneral Idea of how it all works maybe look at and see if you can adjust the ARI to make it functional on its own, then submit the patches to freepbx.org. It is the community that makes these projects go round...
It does work with ARI now. It puts them in the main INBOX, and they are viewable from there with no problems. My suggestion was to be able to make a subdirectory for recordings, but after reading through the other requests for ARI and others problems in making changes, I can tell I'm not a good enough programmer for that.
markh


Member Since:
2006-06-06