New script to make call recordings visible in ARI

oneobserve
Posts: 85
Member Since:
2006-06-06

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

--

====================================================
Mark A. Holm
InfoArch, Inc.                                  Cell:    (503) 750-9741
7456 SW Baseline, PMB#123.          Office: (503) 943-3202
Hillsboro, OR 97123                     ...



jfinstrom
Posts: 1122
Member Since:
2007-03-07
This looks pretty good.. I

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....



jahyde
Posts: 1980
Member Since:
2006-06-02
awesome Mark, can we host

awesome Mark, can we host that file here? just to make sure it doesnt disappear.

--

--my PBX is run on 2 V8's



oneobserve
Posts: 85
Member Since:
2006-06-06
Updated description

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

--

====================================================
Mark A. Holm
InfoArch, Inc.                                  Cell:    (503) 750-9741
7456 SW Baseline, PMB#123.          Office: (503) 943-3202
Hillsboro, OR 97123                     ...



oneobserve
Posts: 85
Member Since:
2006-06-06
Updated script again

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

--

====================================================
Mark A. Holm
InfoArch, Inc.                                  Cell:    (503) 750-9741
7456 SW Baseline, PMB#123.          Office: (503) 943-3202
Hillsboro, OR 97123                     ...



oneobserve
Posts: 85
Member Since:
2006-06-06
Updated the script again

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

--

====================================================
Mark A. Holm
InfoArch, Inc.                                  Cell:    (503) 750-9741
7456 SW Baseline, PMB#123.          Office: (503) 943-3202
Hillsboro, OR 97123                     ...



oneobserve
Posts: 85
Member Since:
2006-06-06
The right solution for this

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

--

====================================================
Mark A. Holm
InfoArch, Inc.                                  Cell:    (503) 750-9741
7456 SW Baseline, PMB#123.          Office: (503) 943-3202
Hillsboro, OR 97123                     ...



imagex
Posts: 108
Member Since:
2006-06-06
I tryed this and it deletes

I tryed this and it deletes from the monitor file but doesnt put it in VM, any ideas?



cosmicwombat
Posts: 1144
Member Since:
2006-05-31
Did you ever

do as James suggested? Post this over on the FreePBX forum and see if there is interest in integrating with ARI?

--

Robert Keller - Chief Technologist at large
The VoIP Experience
Get Official FreePBX Training



imagex
Posts: 108
Member Since:
2006-06-06
I'm running 2.0.0 and it

I'm running 2.0.0 and it didnt work, so I had a friend fix it to work with 2.0.0 if any one could use it let me know and I'll post it.



oneobserve
Posts: 85
Member Since:
2006-06-06
Check your permissions

Check your /var/log/messages file and see if the script is generating errors and send them to me. If I miss my guess, you need to adjust your permissions to allow apache to write into the VM directories at a group level.

oneobserver aka oneobserver

--

====================================================
Mark A. Holm
InfoArch, Inc.                                  Cell:    (503) 750-9741
7456 SW Baseline, PMB#123.          Office: (503) 943-3202
Hillsboro, OR 97123                     ...



jfinstrom
Posts: 1122
Member Since:
2007-03-07
Oneobserve

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...



oneobserve
Posts: 85
Member Since:
2006-06-06
It does work with ARI now.

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

--

====================================================
Mark A. Holm
InfoArch, Inc.                                  Cell:    (503) 750-9741
7456 SW Baseline, PMB#123.          Office: (503) 943-3202
Hillsboro, OR 97123                     ...



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.