New script to make call recordings visible in ARI

oneobserve
Posts: 87
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: 1922
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: 1996
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: 87
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: 87
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: 87
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: 87
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: 121
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: 1173
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
Open Telephony Training Seminar



imagex
Posts: 121
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: 87
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: 1922
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: 87
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                     ...



sisyphus
Posts: 7
Member Since:
2007-03-24
Repository

Hi All

The link http://support.infoarch.com/tools/move-recordings.zip does not seem to be available any longer.

Is there a repositore that these very friendly members of the community can upload their contributions to rather than hosting it themselves?

It seems like such a waster when these contributions disappear.

Regards
Sisyphus



oneobserve
Posts: 87
Member Since:
2006-06-06
Sorry was organizing

Sorry I was cleaning up and reorganizing. It's back, but I can't guarantee it still works with the current version.

markh

--

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



ip-rob
Posts: 5
Member Since:
2009-02-19
Additional folder

I just found this script...very useful. I know some people using the recording a feature a lot and need a way to better organize them. In ARI, the list of valid folders is defined in includes/main.conf.php. If an additional folder is added to the valid list then the script could organize all recordings into that folder. I'm going to set this up on a test system and try it out. Just an idea for making it even easier to keep them organized. I really like this approach since it allows the users to access the recordings from a landline by dialing into their voice mailbox. Great work!

Rob



robert_c
Posts: 9
Member Since:
2009-01-09
Used for recorded conference

A very useful script. Can be used for listen and download recorded conference? The recorded conference are saved in the same folder but is saved in format like that: meetme-conf-rec-conf_name-1234955922.890.wav . The number i think is a uniq id. I'm thinking if i create an extension with the same name like the conference, the script can put the file into voicemail folder of extension or I must modify something to it?

Robert



oneobserve
Posts: 87
Member Since:
2006-06-06
Modify as you see fit...

Change or modify as you need to fit your environment. I would like to see what changes you come up with though, so can you send me the modifications? I no longer run a TrixBox, so I am also looking at adapting this and any changes into Elastix. It was mostly working before the last update...

markh aka oneobserver

--

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



robert_c
Posts: 9
Member Since:
2009-01-09
recording conferecen

It is not allowed to make extension with the same name like conference. So, anybody have any idea how recorded conference can be listen/downloaded? The idea is the following: I have 2-3 conference room, every room have recorded always on. I want that owner of every conference can login to ARI and listen/download his recorded conference.



ip-rob
Posts: 5
Member Since:
2009-02-19
Not possible using ARI

I've been looking at this too and I don't see a way to do it within ARI. The only way I see to do it is to install web-meetme and use it to manage conferences. The authentication of ARI uses the voicemail configuration file. Conferences are not stored (including PIN's) in these configuration files, only in the extensions_additional.conf and the mysql database. So either the authentication of ARI would need to change to allow review of call logs or you use web-meetme. Most of the other features available in ARI don't make sense for conferences so I think web-meetme is the right way to go.

Rob



robert_c
Posts: 9
Member Since:
2009-01-09
no recording in meetme

In the web-meetme conference I don't find any way how to setup that always record. Is there a way to do that?

Robert



ip-rob
Posts: 5
Member Since:
2009-02-19
Recording

You have to set it up to record when you set up the conference. Unfortunately there is no way to set it up beforehand that I know of anyway. You may be able to do so by looking through the defines or php code.

For on-demand, why wouldn't someone just use *1 to record it and the script moves to voicemail? That would provide on-demand recording if someone forgot to set it up to record?

Rob



robert_c
Posts: 9
Member Since:
2009-01-09
Scenario

This is the scenario: one client want a conference number. He don't know anything about extensions or something else. He only know that he have a real number where he and his friends can call from mobile or PSTN and make a conference. After the conference is finis he wants to receive or listen recorded conference throw email or anywhere else. For the moment I don't find any solution to send automatically the record to email like voicemail or to listen that conference into a web interface.

Robert



ip-rob
Posts: 5
Member Since:
2009-02-19
Web Meetme

Web Meetme will do it on top of Asterisk. You set up a destination for a DID that goes into the conference, and they can be recorded.

Rob



robert_c
Posts: 9
Member Since:
2009-01-09
move recording

I get the following error when i run the script:

./move-recordings.sh: line 62: [: 1235479494.972.wav: integer expression expected
./move-recordings.sh: line 67: [: .wav: integer expression expected

Did you know what can be wrong?

Robert



ip-rob
Posts: 5
Member Since:
2009-02-19
Name wrong - using for conference recordings?

This script is not designed to move conference recordings so if that is what you are attempting to do it will not work. As I posted before, web-meetme is designed to handle recording and playback of conference recordings. The filename in your error log looks like naming used for conference recordings. The script is only designed to process recorded files for individual extensions since asterisk puts these in a special naming format which is used by the script to determine where it should go.

Rob



robert_c
Posts: 9
Member Since:
2009-01-09
not conferene recording

No Rob, I don't try to use it to move recorded conference. I try to move recording between 2 extensions. i use trixbox 2.6.2.1



robert_c
Posts: 9
Member Since:
2009-01-09
file name format

I think that format of the recorded file name was changed in the new version. The format is this:
For Group:
$agi->set_variable("CALLFILENAME","g{$exten}-{$timestamp}-{$uniqueid}");

For OUT:
$agi->set_variable("CALLFILENAME","OUT{$exten['data']}-{$timestamp}-{$uniqueid}");

For IN:
$agi->set_variable("CALLFILENAME","{$timestamp}-{$uniqueid}");

For in i see that extension it is not exist in the file name.
oneobserver can you modify the script to work with the new version of trixbox?

Robert



Comment viewing options

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