Page 1 of 2

Feature request: Call recording management

PostPosted: Fri Sep 01, 2006 2:24 am
by kchung
Currently, what's the best way to listen to the recordings?

Since User Stats lists last 50 calls, why not also list the call recordings there?
The problem is, the files are in /var/spool/asterisk/monitor. Can a script on the server redirect it to be served out via httpd?

While it's there, how about the ability to delete the files?

A separate call recording management page would be nice, with the ability to archive off calls, autopurge old calls and recording listening.

PostPosted: Fri Sep 01, 2006 6:47 am
by mflorell
Dealing with recordings is a very difficult thing to standardize within astGUIclient/VICIDIAL. If you record all calls on an outbound VICIDIAL campaign there is no way to store recordings locally on the server, and if there was enough room you would not want the extra load of serving them up on a web page.

The next issue with recordings is if you have mulitple servers. What we have done at most of our installs is to set up an FTP server with a lot of drive space and a web server and use this as a central place for all servers to send recordings to and for users to retrieve recordings from with a simple PHP search page that queries the recording_log table.

There is also the issue of retrieving recordings by user. Since there is no user field in recording_log it is impossible to guarantee searching or retrieval of recordings by user ID.

PostPosted: Fri Sep 08, 2006 12:27 am
by kchung
How about this:

Set a recording server path variable in our vicidial config (i.e. http://serverXYZ/vicidial/recordings/ or ftp://serverABC/vicidial/recordings/ ). The filename of the recording should be stored in table 'vicidial_agent_log' or recording_log with each row if the call was recorded.

When we pull user stats, the recording server path will be appended to the filename. Therefore, we're not bound by the asterisk server. You can have a script move it to a diff webserver and still have a link that's autogenerated.

Also, can the list of 'last 50 calls' be increased from 50 to something else or add a link for 'next 50 calls'?

PostPosted: Fri Sep 08, 2006 6:28 am
by mflorell
There is already a "location" field in the recording_log table that many companies use to locate recordings.

As for the vicidial_agent_log, we may want to add a recording_id field to that table in order to cross-reference recordings to agents and phone calls they've taken.

As for increasing the call_log number in user_stats.php, just increase the number in the code, replace 50 with whatevery you like.

For both of these issues you can also create "new feature" issues in the tracker for them:
http://www.eflo.net/VICIDIALmantis

PostPosted: Thu Sep 14, 2006 3:40 am
by gerski
I also created a user_history.php same thing as the user_stats.php but with no authentication. Since some agent would like to see their own call history. And change the last 50 for about 200 last calls.

But it would be better if the user_stats.php will show the CALL HISTORY for the day that we input rather than the LAST XX CALLS.

PostPosted: Thu Sep 14, 2006 10:24 am
by enjay
Just an FYI I posted ( a while back ) a few different mix_recording scripts to Mantis where I had the recordnigs placed in a direcftory by date. I also pasted a snippet which sorts these via a php web interface so you can index them by Campaign, Agent, Phone Number and always sorted by date/time.

-enjay

PostPosted: Fri Sep 22, 2006 6:43 pm
by kchung
Can someone please enlighten me as to which script is tasked with recording all calls? more specifically which script writes to the recording_log table?

PostPosted: Fri Sep 22, 2006 8:32 pm
by mflorell
manager_send.php starts the recordings and vdc_db_query.php will update the record at call hangup.

PostPosted: Tue Oct 03, 2006 4:47 pm
by kchung
OK, I'm attempting to hack this in myself. I'll be posting my notes here.

First, i modify the DB to add a 'recording_id' to the 'vicidal_log' table:

ALTER TABLE `vicidial_log` ADD `recording_id` INT( 10 ) UNSIGNED NULL ;

Pull old data from recording_id back into vicidial_log:

update vicidial_log a, recording_log b set a.recording_id = b.recording_id where a.end_epoch = b.end_epoch

at line 959 of vdc_db_query.php, i changed it to read:

Code: Select all
echo "$recording_id|$length_in_min|";
$stmt = "UPDATE vicidial_log set recording_id='$recording_id'where lead_id='$lead_id' and uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
}

PostPosted: Wed Oct 04, 2006 1:21 pm
by kchung
mflorell wrote:There is already a "location" field in the recording_log table that many companies use to locate recordings.
http://www.eflo.net/VICIDIALmantis


What script, if any, writes to the location field?

PostPosted: Wed Oct 04, 2006 8:35 pm
by mflorell
Nothing does in the release. It is easy to add a MySQL query that would though. And in the archival systems I've built I usually have a drop-box on the FTP server and then send the files to other servers depending on the campaign they were recorded in and the location field is used by that archival system.

PostPosted: Thu Oct 26, 2006 10:55 am
by vctor
You can just create a PHP page that queries the recording_log, you can then symlink the folder to an apache folder, that way you can view it on the web. and you can manipulate it using PHP,

PostPosted: Sat Oct 28, 2006 8:54 am
by mflorell
What if your recordings are not stored on your web server?

If someone wants to submit a page that will do this, I will try to get it into the next release. It will need to be posted to the tracker though.

PostPosted: Mon Oct 30, 2006 4:34 pm
by kchung
ok, lemme rehack my patch so it uses record_log instead. What's my deadline for this to make it into the next release?

PostPosted: Mon Oct 30, 2006 7:57 pm
by Op3r
What if your recordings are not stored on your web server?


You can just compile/install apache on the asterisk server then have the php page call for it.

anything that can make the recordings simple process is a great idea.

PostPosted: Tue Oct 31, 2006 12:24 am
by mflorell
All of the overhead of runing Apache/PHP on a VICIDIAL server is a lot of load not to mention the added disk read activity if you are retrieving recordings during production hours while recording.

If you have a patch please post it to the tracker.

PostPosted: Tue Oct 31, 2006 12:25 am
by mflorell
kchung wrote:ok, lemme rehack my patch so it uses record_log instead. What's my deadline for this to make it into the next release?


Not sure. i am hoping to do the next release before December. November 14th sounds like a reasonable day for a deadline.

PostPosted: Tue Nov 07, 2006 1:25 pm
by vctor
mflorell wrote:All of the overhead of runing Apache/PHP on a VICIDIAL server is a lot of load not to mention the added disk read activity if you are retrieving recordings during production hours while recording.

If you have a patch please post it to the tracker.


Then just install apache on a recording server. It does not mean the asterisk server.

PostPosted: Wed Nov 22, 2006 3:44 pm
by kchung
mflorell wrote:manager_send.php starts the recordings and vdc_db_query.php will update the record at call hangup.


Am I correct to say that vdc_db_query.php only stops recording and update the record if a call hung up?

I'm trying to put uniqueid into the recording_log via manager_send.php line 884 and 946:
Code: Select all
$stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,uniqueid) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$uniqueid')";


It won't do a thing. How can I pass uniqueid into this script properly?
Also, i see debugging facilities for these scripts. How do I invoke them and view the debug data?

PostPosted: Wed Nov 22, 2006 11:12 pm
by mflorell
You need to send the uniqueid with the XMLHTTPRequest call that hangs up the call in the vicidial.php script.(This is also where you would need to trigger the debugging)

Why do you want to store uniqueid in recording_log?

PostPosted: Fri Nov 24, 2006 8:44 pm
by kchung
mflorell wrote:Why do you want to store uniqueid in recording_log?


I want to be able to link a recording or sets of recordings with a call record.

Before, I put the recording_id with each call recordin in the vicidial_log table, but that won't work if there's multiple recordings per call. I had modified user_stats.php and admin_modify_lead.php to display the recording_id next to the lead column, which is linked to the recording mp3.

So the best thing to do, i think, is to put the uniqueid with the recording record in the recording_log table and do the same type of query to get the recording ID and filename of the recording.

mflorell wrote:You need to send the uniqueid with the XMLHTTPRequest call that hangs up the call in the vicidial.php script.(This is also where you would need to trigger the debugging)


Dude, you totally lost me there. Can you provide some code snippets? And where would you see the debugging info?

PostPosted: Sat Nov 25, 2006 1:13 am
by mflorell
I was planning on adding the lead_id to the recording_log table which would have the effect of tracking the recordings that happen within a call without the problems that can occur with the uniqueID(some different Asterisk versions use different types of uniqueID, for VICIDIAL dialing out manual dial, the uniqueID will change after the call hangs up leading to a different uniqueid for ring time than for after the Answer signal.).

As for debugging and XMLHTTPRequest, that's a different world of programming. The vicidial.php script needs to send a request with some Javascript variables in it to the php script that will do the recording, that second script needs to take in the variables and parse them then do the database queries to activate recording.

You will have to edit the request string in the conf_send_recording function of vicidial.php to add lead_id to the query string.

Then in the manager_send.php script you have to go to the MonitorConf section and add lead_id to the insert statement for the recording_log table.

PostPosted: Thu Nov 30, 2006 5:16 pm
by mflorell
I have added the lead_id into the recording_log table as of SVN 2-X today(2006-11-30)

There is also a list of recordings for a lead on the lead modification page accessible from the lead search on the admin.php page.

PostPosted: Thu Nov 30, 2006 5:40 pm
by kchung
It would be very handy to see user_id in there too. Please add!

PostPosted: Fri Dec 01, 2006 2:27 am
by mflorell
I'm thinking about it. It was not very involved to add lead_id so this shouldn't be a problem.

If it will be added, the field would be "user". I'm not sure if I would want to index the column or not. I will have to test.

PostPosted: Fri Dec 01, 2006 11:50 am
by mflorell
user has been added in SVN 2-X as of this morning. I also modified user_stats.php to list recordings fo an agent.

PostPosted: Fri Dec 08, 2006 2:16 am
by ramindia
Hi Matt

I have updated to my setup with latest SVN

iam able to see the User_stats

is there any option we can add some hyper link on FILENAME
so can hear from the Page directly.. just iam thinking that Idea

is that Good Idea ?


Another thing i noticed is some of the pages
we can not go back to main admin page, we need to use back button to go to main admin page.

adding small hyper link to go to the main Admin page
would be great.

any suggestions

Ram

PostPosted: Fri Dec 08, 2006 2:22 am
by kchung
I've modded an older build to do that. I've been meaning to contribute it but haven't had the time.

PostPosted: Fri Dec 08, 2006 2:27 am
by ramindia
Hi

thats great
why dont you contribute or upload your files
so people can look around and modify as per the convinient

Ram

PostPosted: Fri Dec 08, 2006 10:08 am
by mflorell
Can you list the pages that don't have Admin links so that I can add them?

PostPosted: Fri Dec 08, 2006 11:56 am
by ramindia

PostPosted: Mon Dec 11, 2006 1:44 pm
by Op3r
Whats the status of this feature?

kchung do you mind if you upload the script to tracker so that we may contribute something?

PostPosted: Wed Dec 13, 2006 4:02 pm
by mflorell
I have added links to the admin page from several of the scripts that did not have them, including the ones you listed. Thanks.

PostPosted: Wed Dec 13, 2006 9:18 pm
by ramindia
Hi

is there any document, how we can upgrade the files in web server
from old to new

or just get them from SVN and copy to respected directories.

how can i do only modified files, since i have also edited some files for my own use

Ram

PostPosted: Wed Dec 13, 2006 10:33 pm
by mflorell
You would just need to copy them manually if you do not want to just run the install.pl and update everything.

A lot of the scripts have changed from 2.0.1. You might do better to copy your files off for backup and run install.pl and then run WinMerge or another diff utility to see the differences between your customized scripts and the new ones.

As for which files have changed, just get RapidSVN and you can look at the changelog for each file right in the RapidSVN GUI.

PostPosted: Wed Dec 13, 2006 11:26 pm
by ramindia
Hi

thats good idea

i have moved aleady from 2.0.1 to 2.0.2, but some latest changes need to update

i will work on that, post if any problem.
and any links have problem, not going to admin page.


Ram

PostPosted: Fri Dec 15, 2006 3:20 am
by ramindia
Hi

I have updated latest SVN, the links which were not going back to admin page, now its solved.

apprciated for this work

Ram

PostPosted: Fri Dec 29, 2006 4:01 pm
by kchung
My patch has been uploaded! see mantis: http://www.eflo.net/VICIDIALmantis/view.php?id=44

recording mgmt.patch enhances 2.0.2's recording management features.

Adds several new variables:
PATHmon_done - where processed recordings will be saved at on the server; was at PATHmonitor/DONE, now defaults to PATHweb/vicidial/recordings
VARREC_loc - web address where the recording can be reached
VARREC_format - file extension of the recordings depending on which AST_CRON_mix_recordings script you choose

Modifies:
/install.pl - adds the new variables to the install & astguiclient.conf
/bin/AST_CRON_mix_recording scripts - uses the PATHmon_done path for done recordings
/www/vicidial/dbconnect.php - passes the VARREC variables
/www/vicidial/user_stats.php - Added hyperlinks to Campaigns, Lists and Recordings based on $VARREC_loc and $VARREC_format
/www/vicidial/admin_modify_lead.php - Modifed Comments to use textarea & added hyperlinks to Campaign, List and Recordings based on $VARREC_loc and $VARREC_format

PostPosted: Fri Dec 29, 2006 4:05 pm
by mflorell
Thank you very much for posting!

PostPosted: Fri Dec 29, 2006 4:08 pm
by kchung
no, no! thank you very much for the changes you've made to 2.0.2 which made this much easier!