Added optional GPG audio recording encryption.

Added option to use RECID as a recording filename variable.

git-svn-id: svn://192.168.202.10@2378 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2015-09-16 02:20:11 +00:00
parent 8e21e76b92
commit 1bd24b2302
12 changed files with 574 additions and 77 deletions
+38 -7
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-NVA_recording.agi version 2.10
# agi-NVA_recording.agi version 2.12
#
# This script is designed to give recording ability to agents not the using
# ViciDial agent screen
@@ -11,21 +11,26 @@
# ; 4. log this call in call_log (Y|N) default N, ONLY NEEDED FOR INBOUND AND INTERSYSTEM CALLS!!!
# ; 5. audio record this call (Y|N) default N
# ; 6. double-log this call in call_log (Y|N) default N, ONLY NEEDED FOR INBOUND CALLMENU FORWARDED CALLS!!!
# ; 7. play the recording ID of this call before recording starts
# ; 8. include the recording ID in the filename
#
# ;custom dialplan entry example: (similar to the defaultlog Call Menu)
#exten => _X.,1,AGI(agi-NVA_recording.agi,BOTH------Y---N---Y---N)
#exten => _X.,1,AGI(agi-NVA_recording.agi,BOTH------Y---N---Y---N---N---N)
#exten => _X.,n,Goto(default,${EXTEN},1)
#exten => _X.,n,Hangup
#
# ;inbound to agent example:
#exten => 5678,1,AGI(agi-NVA_recording.agi,BOTH------Y---Y---Y---N)
#exten => 5678,1,AGI(agi-NVA_recording.agi,BOTH------Y---Y---Y---N---N---N)
#exten => 5678,n,Goto(vicidial-auto,5678,1)
#exten => 5678,n,Hangup
#
# ; example of dial prefix of 94 in System Settings Custom Dialplan to default log
#exten => _941NXXNXXXXXX,1,Goto(defaultlog,9${EXTEN:2},1)
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# ; example of using as Call Menu prompt to record with playing of recording id
#agi-NVA_recording.agi,BOTH------Y---N---Y---N---Y---Y
#
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGELOG
# 91105-1402 - First build
@@ -34,6 +39,7 @@
# 130108-1811 - Changes for Asterisk 1.8 compatibility
# 130326-1510 - Added lead_id and user logging from vicidial values
# 141124-2309 - Fixed Fhour variable bug
# 150915-1824 - Added recording ID play and filename options
#
&get_time_now;
@@ -135,6 +141,8 @@ if (length($ARGV[0])>1)
$log_call = $ARGV_vars[3];
$record_call = $ARGV_vars[4];
$double_log = $ARGV_vars[5];
$play_recid = $ARGV_vars[6];
$file_recid = $ARGV_vars[7];
if ($AGI_output =~ /STDERR/) {$AGILOG = '1';}
if ($AGI_output =~ /FILE/) {$AGILOG = '2';}
@@ -246,6 +254,32 @@ if ($record_call =~ /Y/)
$filename =~ s/\"|\'//gi;
### code to record call goes here ###
### insert record into recording_log table ###
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,length_in_sec,filename,lead_id,user,location,vicidial_id) values('$channel','$VARserver_ip','$extension','$now_date','$start_epoch','0','$filename','$lead_id','$accountcode','$filename','$unique_id');";
$affected_rows = $dbhA->do($stmtA);
$stmtB = "SELECT LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$recording_id = $aryA[0];
}
if ($file_recid =~ /Y/)
{
$filename .= "$US$recording_id";
$stmtA = "UPDATE recording_log SET filename='$filename',location='$filename' where recording_id='$recording_id';";
$affected_rows = $dbhA->do($stmtA);
}
if ($play_recid =~ /Y/)
{
$AGI->stream_file('id_number');
$AGI->say_digits("$recording_id");
}
%ast_ver_str = parse_asterisk_version($asterisk_version);
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
{
@@ -256,9 +290,6 @@ if ($record_call =~ /Y/)
$AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$filename");
}
### insert record into recording_log table ###
$stmtA = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,length_in_sec,filename,lead_id,user,location,vicidial_id) values('$channel','$VARserver_ip','$extension','$now_date','$start_epoch','0','$filename','$lead_id','$accountcode','$filename','$unique_id');";
$affected_rows = $dbhA->do($stmtA);
}
### if set to user log this call, insert user_call_log entry ###