Page 1 of 1

Recording Filename

PostPosted: Thu Nov 06, 2014 6:57 pm
by ruben23
Hi Guys,

If i may ask how do we find the script or dial plan that handles the file naming of all recording on vicidial somehow..? like on the Web management we see this Campaign Rec Filename:

Any idea what script handle this or maybe a dialplan. Thanks

Re: Recording Filename

PostPosted: Thu Nov 06, 2014 7:23 pm
by dspaan
Hey Ruben, good to hear from you again.

Isn't this done by any of these scripts you can find with crontab -e:

### recording mixing/compressing/ftping scripts
#0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl
1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3
2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3

Also check out /usr/share/astguiclient/AST_VDsales_export.pl which allows you to move sale recordings to a different directory or server.

Re: Recording Filename

PostPosted: Thu Nov 06, 2014 7:56 pm
by ruben23
@dspaan

Thanks for the reply, is it possible to name recording by adding custom field on it somehow also..?

Coz i need to follow this recording format somehow on my recording output, im just not sure how to define it on the Campaign Rec Filename: what variable i will put in equivalent, some are good already like:

out_call,datetime,ext,phone_number,live_submit_id,unique_id

- CUSTPHONE
- FULLDATE
- AGENT
- CAMPAIGN

but the rest how do i define the live_submit and unique_id also the TEXT infront of recroding as Out_call (outboundcalls)

Any help

Re: Recording Filename

PostPosted: Thu Nov 06, 2014 8:17 pm
by dspaan
I don't know. I think you would have to analyze those perl scripts, find someone who can do that for you. Maybe Matt or Mcargile can point you to which line(s) in which script you have to edit.

I assume you are referring to this setting from the campaign details screen:

Campaign Rec Filename - This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN INGROUP CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. Te resulting filename must be less than 90 characters in length.

Re: Recording Filename

PostPosted: Wed Nov 12, 2014 4:22 am
by DomeDan
its the variable $campaign_rec_filename in these agi scripts:
agi-VDAD_ALL_inbound.agi
agi-VDAD_ALL_outbound.agi
agi-VDAD_RINGALL.agi
VD_amd.agi

you can use the variables the script already uses or you can change/write some query to get more data from the database.

here is an example:

uniqueid (big font and bold is added code):

$stmtA = "SELECT campaign_id,phone_number,phone_code,lead_id,call_time,alt_dial,queue_priority,uniqueid FROM vicidial_auto_calls where callerid='$callerid' order by call_time desc limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01006'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VDADcampaign = $aryA[0];
$VDADphone = $aryA[1];
$VDADphone_code = $aryA[2];
$VDADlead_id = $aryA[3];
$VDADcall_time = $aryA[4];
$VDADalt_dial = $aryA[5];
$VDADqueue_priority = $aryA[6];
$VDADuniqueid = $aryA[7];
}
$sthA->finish();

...

$campaign_rec_filename =~ s/CAMPAIGN/$VDADcampaign/gi;
$campaign_rec_filename =~ s/INGROUP/$VDADcampaign/gi;
$campaign_rec_filename =~ s/CUSTPHONE/$VDADphone/gi;
$campaign_rec_filename =~ s/FULLDATE/$recdate/gi;
$campaign_rec_filename =~ s/TINYDATE/$tinydate/gi;
$campaign_rec_filename =~ s/EPOCH/$now_date_epoch/gi;
$campaign_rec_filename =~ s/AGENT/VDAD/gi;
$campaign_rec_filename =~ s/VENDORLEADCODE/$vendor_lead_code/gi;
$campaign_rec_filename =~ s/LEADID/$CIDlead_id/gi;
$campaign_rec_filename =~ s/CALLID/$callerid/gi;
$campaign_rec_filename =~ s/UNIQUEID/$VDADuniqueid/gi;
$campaign_rec_filename =~ s/\"|\'//gi;
$campaign_rec_filename =~ s/ //gi;



BUT I think you can use the alrady defined variable $uniqueid instead of getting it from the sql query
then you can use UNIQUEID in the filename campaign setting

Have not tried this and any modification are done at your own risk.
remember to backup!

Re: Recording Filename

PostPosted: Sun Nov 16, 2014 8:03 pm
by ruben23
@DomeDan,

Thanks a lot..the uniqueid code is working already which i just used the default, but any chances i can replace the AGENT variable with PHONE EXTENSION number only..?
we are required to with the recording file name based on Phone extension not by AGENT name.

Re: Recording Filename

PostPosted: Mon Nov 17, 2014 2:54 am
by DomeDan
try to use the variable $eac_extension dont know it its populated at that part though
or find an other query where data is gathered from vicidial_live_agents or write a new query

Re: Recording Filename

PostPosted: Mon Nov 17, 2014 10:27 pm
by ruben23
Quick resolution made is just rename the UserID of all the Agent to match there respective extension, so on the recording file name it will display the AgentID as there equivalent extensions

@DomeDan..Thanks a lot

Re: Recording Filename

PostPosted: Tue Nov 18, 2014 7:12 am
by DomeDan
sounds like a weird was to solve the feature, just add code:

$campaign_rec_filename =~ s/EXTENSION/$eac_extension/gi;

and try to use EXTENSION in the filename campaign setting, it might work and it might not work because I dont know it that variable is populated