From b6ddbe90ccaa187342fd273f9ad203dd4ed26bed Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 9 Nov 2009 07:56:44 +0000 Subject: [PATCH] - Added agi-NVA_recording.agi script to allow for logging and recording of phone dialed calls - Added MIX directory auto mixing option to CRON audio step 1 - Added outbound callerIDnumber to DROP and other AGI transfers for in-groups - Changed called_count to increment on alt-dial calls - Fixed variable mis-assignment in several AGI and bin scripts - Fixed Pause code issue with QueueMetrics git-svn-id: svn://192.168.202.10@1254 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/agi/VDL_CID_lookup.agi | 2 +- agc_2-X/trunk/agi/VD_amd.agi | 2 +- agc_2-X/trunk/agi/VD_auto_post_VERIFY.agi | 2 +- agc_2-X/trunk/agi/agi-AGENT_dial_in.agi | 4 +- agc_2-X/trunk/agi/agi-CANADA_PRI_CIDname.agi | 2 +- agc_2-X/trunk/agi/agi-DID_route.agi | 2 +- .../agi/agi-IVR_recording_verification.agi | 4 +- agc_2-X/trunk/agi/agi-NVA_recording.agi | 223 ++++++++++++++++++ agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 124 ++++++++-- agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi | 8 +- .../agi/agi-VDAD_inbound_calltime_check.agi | 2 +- agc_2-X/trunk/agi/agi-VDAD_pin_IVR.agi | 2 +- agc_2-X/trunk/agi/agi-VDADautoREMINDER.agi | 6 +- .../trunk/agi/agi-VDADautoREMINDERxfer.agi | 8 +- agc_2-X/trunk/agi/agi-VDADfixCXFER.agi | 2 +- .../agi/agi-VDADinbound_NI_DNC_CIDlookup.agi | 2 +- agc_2-X/trunk/agi/agi-VDADlisten_DTMF.agi | 2 +- agc_2-X/trunk/agi/agi-VDADselective_CID.agi | 2 +- .../agi/agi-VDADselective_CID_hangup.agi | 2 +- agc_2-X/trunk/agi/agi-record_prompts.agi | 2 +- agc_2-X/trunk/agi/call_inbound.agi | 2 +- agc_2-X/trunk/agi/debug_speak.agi | 2 +- agc_2-X/trunk/agi/invalid_speak.agi | 2 +- agc_2-X/trunk/agi/park_CID.agi | 2 +- .../trunk/bin/ADMIN_timeclock_auto_logout.pl | 2 +- .../trunk/bin/AST_CRON_audio_1_move_mix.pl | 13 +- agc_2-X/trunk/bin/AST_VDauto_dial.pl | 39 ++- agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl | 2 +- agc_2-X/trunk/bin/AST_VDhopper.pl | 2 +- agc_2-X/trunk/bin/AST_VDremote_agents.pl | 2 +- agc_2-X/trunk/bin/FastAGI_log.pl | 4 +- agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt | 49 ++++ .../trunk/extras/MySQL_AST_CREATE_tables.sql | 9 +- agc_2-X/trunk/extras/upgrade_2.2.0.sql | 8 + agc_2-X/trunk/install.pl | 3 + agc_2-X/trunk/www/agc/vdc_db_query.php | 7 +- agc_2-X/trunk/www/agc/vicidial.php | 22 +- .../trunk/www/vicidial/AST_timeonVDADall.php | 9 +- 38 files changed, 511 insertions(+), 71 deletions(-) create mode 100644 agc_2-X/trunk/agi/agi-NVA_recording.agi diff --git a/agc_2-X/trunk/agi/VDL_CID_lookup.agi b/agc_2-X/trunk/agi/VDL_CID_lookup.agi index f3c626a6..d9085a6b 100644 --- a/agc_2-X/trunk/agi/VDL_CID_lookup.agi +++ b/agc_2-X/trunk/agi/VDL_CID_lookup.agi @@ -34,7 +34,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/VD_amd.agi b/agc_2-X/trunk/agi/VD_amd.agi index b781467a..32e0e3f4 100644 --- a/agc_2-X/trunk/agi/VD_amd.agi +++ b/agc_2-X/trunk/agi/VD_amd.agi @@ -43,7 +43,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/VD_auto_post_VERIFY.agi b/agc_2-X/trunk/agi/VD_auto_post_VERIFY.agi index 3d937289..949d12e1 100644 --- a/agc_2-X/trunk/agi/VD_auto_post_VERIFY.agi +++ b/agc_2-X/trunk/agi/VD_auto_post_VERIFY.agi @@ -38,7 +38,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-AGENT_dial_in.agi b/agc_2-X/trunk/agi/agi-AGENT_dial_in.agi index aae8bf06..d6200dc2 100644 --- a/agc_2-X/trunk/agi/agi-AGENT_dial_in.agi +++ b/agc_2-X/trunk/agi/agi-AGENT_dial_in.agi @@ -35,7 +35,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -407,7 +407,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-CANADA_PRI_CIDname.agi b/agc_2-X/trunk/agi/agi-CANADA_PRI_CIDname.agi index 34d3ca77..6be35afe 100644 --- a/agc_2-X/trunk/agi/agi-CANADA_PRI_CIDname.agi +++ b/agc_2-X/trunk/agi/agi-CANADA_PRI_CIDname.agi @@ -29,7 +29,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-DID_route.agi b/agc_2-X/trunk/agi/agi-DID_route.agi index d81adffa..e847da4f 100644 --- a/agc_2-X/trunk/agi/agi-DID_route.agi +++ b/agc_2-X/trunk/agi/agi-DID_route.agi @@ -32,7 +32,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi b/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi index 2b378c5d..6ecab848 100644 --- a/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi +++ b/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi @@ -66,7 +66,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -690,7 +690,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-NVA_recording.agi b/agc_2-X/trunk/agi/agi-NVA_recording.agi new file mode 100644 index 00000000..3f6b4f34 --- /dev/null +++ b/agc_2-X/trunk/agi/agi-NVA_recording.agi @@ -0,0 +1,223 @@ +#!/usr/bin/perl +# +# agi-NVA_recording.agi version 0.1 +# +# This script is designed to give recording ability to agents not the using +# ViciDial agent screen +# +# ; 1. logging output (NONE|STDERR|FILE|BOTH) +# ; 2. the ViciDial user ID, if empty it defaults to accountcode(usually phone extension) +# ; 3. log this call in user_call_log (Y|N) default N +# ; 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 +# +# ;custom dialplan entry example: +#exten => _.,1,AGI(agi-NVA_recording.agi,BOTH------Y---N---Y) +#exten => _.,n,Goto(default,${EXTEN},1) +#exten => _.,n,Hangup +# +# ;inbound to agent example: +#exten => 5678,1,AGI(agi-NVA_recording.agi,BOTH------Y---Y---Y) +#exten => 5678,n,Goto(vicidial-auto,5678,1) +#exten => 5678,n,Hangup +# +# +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# +# CHANGELOG +# 91105-1402 - First build +# + +&get_time_now; + +$script = 'agi-NVA_recording.agi'; + +$now_date_epoch = time(); +$start_epoch = $now_date_epoch; + +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$year = ($year + 1900); +$mon++; +if ($mon < 10) {$mon = "0$mon";} +if ($mday < 10) {$mday = "0$mday";} +if ($hour < 10) {$Fhour = "0$hour";} +if ($min < 10) {$min = "0$min";} +if ($sec < 10) {$sec = "0$sec";} +$now_date = "$year-$mon-$mday $hour:$min:$sec"; +$filedate = "$year$mon$mday$hour$min$sec"; + +$US='_'; + + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) + {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} + if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) + {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +if (!$VARDB_port) {$VARDB_port='3306';} +if (!$AGILOGfile) {$AGILOGfile = "$PATHlogs/nvaout.$year-$mon-$mday";} + +use DBI; +use Asterisk::AGI; +$AGI = new Asterisk::AGI; + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + + +### begin parsing run-time options ### +if (length($ARGV[0])>1) + { + if ($ARGV[0] =~ /---/) + { + ### list of command-line array arguments: + @ARGV_vars = split(/---/, $ARGV[0]); + + $AGI_output = $ARGV_vars[0]; + if (length($ARGV_vars[1]) > 0) + {$user = $ARGV_vars[1];} + $log_user_call = $ARGV_vars[2]; + $log_call = $ARGV_vars[3]; + $record_call = $ARGV_vars[4]; + + if ($AGI_output =~ /STDERR/) {$AGILOG = '1';} + if ($AGI_output =~ /FILE/) {$AGILOG = '2';} + if ($AGI_output =~ /BOTH/) {$AGILOG = '3';} + + if ($AGILOG) {$agi_string = "Perl Environment Dump:"; &agi_output;} + if ($AGILOG) {$agi_string = "$AGI_output|$user|$log_call|$record_call|$uniqueid_log"; &agi_output;} + } + } + + +$|=1; +while() + { + chomp; + last unless length($_); + if ($AGILOG) + { + if (/^agi_(\w+)\:\s+(.*)$/) + { + $AGI{$1} = $2; + $agi_string = "$1|$2"; &agi_output; + } + } + if (/^agi_uniqueid\:\s+(.*)$/) {$unique_id = $1;} + if (/^agi_extension\:\s+(.*)$/) {$extension = $1;} + if (/^agi_accountcode\:\s+(.*)$/) {$accountcode = $1;} + if (/^agi_type\:\s+(.*)$/) {$type = $1;} + if (/^agi_channel\:\s+(.*)$/) {$channel = $1;} + if (/^agi_callerid\:\s+(.*)$/) {$callerid = $1;} + if (/^agi_calleridname\:\s+(.*)$/) {$calleridname = $1;} + } + +if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) ) + { + $calleridname = $callerid; + $calleridname =~ s/\<\d\d\d\d\d\d\d\d\d\d\>//gi; + $calleridname =~ s/\"|\" //gi; + } + + $callerid =~ s/\D//gi; + $calleridname =~ s/unknown//gi; +if ( (!$callerid) or ($callerid =~ /unknown/) ) + {$callerid = $calleridname;} + +if (length($user) > 0) + {$accountcode = $user;} + +### if set to record this call, start recording ### +if ($record_call =~ /Y/) + { + $filename = "$filedate$US$accountcode$US$extension"; + ### code to record call goes here ### + + $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','0','$accountcode','$filename','$unique_id');"; + $affected_rows = $dbhA->do($stmtA); + } + +### if set to user log this call, insert user_call_log entry ### +if ($log_user_call =~ /Y/) + { + ### insert record into user_call_log table ### + $stmtA = "INSERT INTO user_call_log SET user='$accountcode', call_date='$now_date', call_type='PHONE_DIAL', server_ip='$VARserver_ip', phone_number='$extension', number_dialed='$extension', callerid='$callerid', group_alias_id='$unique_id';"; + $affected_rows = $dbhA->do($stmtA); + } + +### if set to log this call, insert call_log entry ### +if ($log_call =~ /Y/) + { + ### insert record into call_log table ### + $stmtA = "INSERT INTO call_log SET uniqueid='$unique_id', channel='$channel', channel_group='PHONE_DIAL', server_ip='$VARserver_ip', type='$type', extension='$accountcode', number_dialed='$extension', caller_code='$callerid', start_time='$now_date', start_epoch='$start_epoch';"; + $affected_rows = $dbhA->do($stmtA); + } + + +exit; + + + +sub get_time_now #get the current date and time and epoch for logging call lengths and datetimes + { + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); + $year = ($year + 1900); + $mon++; + if ($mon < 10) {$mon = "0$mon";} + if ($mday < 10) {$mday = "0$mday";} + if ($hour < 10) {$Fhour = "0$hour";} + if ($min < 10) {$min = "0$min";} + if ($sec < 10) {$sec = "0$sec";} + + $now_date_epoch = time(); + $now_date = "$year-$mon-$mday $hour:$min:$sec"; + $filedate = "$year$mon$mday$hour$min$sec"; + } + + +sub agi_output + { + if ($AGILOG >=2) + { + ### open the log file for writing ### + open(Lout, ">>$AGILOGfile") + || die "Can't open $AGILOGfile: $!\n"; + print Lout "$now_date|$script|$agi_string\n"; + close(Lout); + } + ### send to STDERR writing ### + if ( ($AGILOG == '1') || ($AGILOG == '3') ) + {print STDERR "$now_date|$script|$agi_string\n";} + $agi_string=''; + } diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index 76e7023b..662c5307 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -102,6 +102,7 @@ # 90726-0114 - Fixed bug on some calls for agent grab # 90808-0307 - Added longest_wait_time as agent routing option # 91004-0959 - Fix for queue_log consultative transfers +# 91105-1258 - Added CallerIDnumber change on Drop when sending call out # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -121,7 +122,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -224,15 +225,15 @@ $sthA->finish(); ### begin parsing run-time options ### if (length($ARGV[0])>1) -{ + { if ($AGILOG) {$agi_string = "Perl Environment Dump:"; &agi_output;} $i=0; while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - if ($AGILOG) {$agi_string = "$i|$ARGV[$i]"; &agi_output;} - $i++; - } + { + $args = "$args $ARGV[$i]"; + if ($AGILOG) {$agi_string = "$i|$ARGV[$i]"; &agi_output;} + $i++; + } ### list of command-line array arguments: @ARGV_vars = split(/-----/, $ARGV[0]); @@ -248,20 +249,20 @@ if (length($ARGV[0])>1) $phone_code = $ARGV_vars[8]; $Scampaign_id = $ARGV_vars[9]; $agent_only = $ARGV_vars[10]; -} + } $|=1; while() -{ + { chomp; last unless length($_); if ($AGILOG) - { - if (/^agi_(\w+)\:\s+(.*)$/) { + if (/^agi_(\w+)\:\s+(.*)$/) + { $AGI{$1} = $2; + } } - } if (/^agi_uniqueid\:\s+(.*)$/) {$unique_id = $1; $uniqueid = $unique_id;} if (/^agi_channel\:\s+(.*)$/) {$channel = $1;} @@ -269,7 +270,7 @@ while() if (/^agi_type\:\s+(.*)$/) {$type = $1;} if (/^agi_callerid\:\s+(.*)$/) {$callerid = $1;} if (/^agi_calleridname\:\s+(.*)$/) {$calleridname = $1;} -} + } if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) ) @@ -743,6 +744,26 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) if ($after_hours_action =~ /EXTENSION/) { $DROPexten = "$after_hours_exten"; + $CIDcampaign_cid='0000000000'; + ### Grab ID values from the database + $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $CIDcampaign_id = $aryA[0]; + $CIDcampaign_cid = $aryA[1]; + } + $sthA->finish(); + + $newcallerid = "\"$callerid <$CIDcampaign_cid>\""; + $AGI->set_callerid($newcallerid); + print STDERR "Setting CID \"$newcallerid\"\n"; + checkresult($result); + if ($AGILOG) {$agi_string = "callerID changed: \"$callerid\" \<$CIDcampaign_cid\> from $CIDcampaign_id"; &agi_output;} } if ($after_hours_action =~ /VOICEMAIL/) { @@ -878,6 +899,27 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/) @EXno_agent_action_value = split(/,/,$no_agent_action_value); $DROPexten = $EXno_agent_action_value[0]; $ext_context = $EXno_agent_action_value[1]; + + $CIDcampaign_cid='0000000000'; + ### Grab ID values from the database + $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $CIDcampaign_id = $aryA[0]; + $CIDcampaign_cid = $aryA[1]; + } + $sthA->finish(); + + $newcallerid = "\"$callerid <$CIDcampaign_cid>\""; + $AGI->set_callerid($newcallerid); + print STDERR "Setting CID \"$newcallerid\"\n"; + checkresult($result); + if ($AGILOG) {$agi_string = "callerID changed: \"$callerid\" \<$CIDcampaign_cid\> from $CIDcampaign_id"; &agi_output;} } if ($no_agent_action =~ /DID/) { @@ -919,7 +961,7 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/) sleep(1); } - if ($AGILOG) {$agi_string = "exiting the VDAD app after hours, transferring call to $DROPexten"; &agi_output;} + if ($AGILOG) {$agi_string = "exiting the VDAD app no agent no queue, transferring call to $DROPexten"; &agi_output;} print "SET CONTEXT $ext_context\n"; checkresult($result); print "SET EXTENSION $DROPexten\n"; @@ -1560,7 +1602,7 @@ if ( ($agent_search_method =~ /^SO|^LO/) && ($skipLOSO < 1) ) $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -1942,7 +1984,7 @@ if ($agent_search_method =~ /^LO|^LB/) $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -2370,7 +2412,30 @@ $exitwithkey=0; if ($hold_time_option =~ /EXTENSION/) { if (length($hold_time_option_exten)>0) - {$DROPexten = "$hold_time_option_exten";} + { + $DROPexten = "$hold_time_option_exten"; + + $CIDcampaign_cid='0000000000'; + ### Grab ID values from the database + $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $CIDcampaign_id = $aryA[0]; + $CIDcampaign_cid = $aryA[1]; + } + $sthA->finish(); + + $newcallerid = "\"$callerid <$CIDcampaign_cid>\""; + $AGI->set_callerid($newcallerid); + print STDERR "Setting CID \"$newcallerid\"\n"; + checkresult($result); + if ($AGILOG) {$agi_string = "callerID changed: \"$callerid\" \<$CIDcampaign_cid\> from $CIDcampaign_id"; &agi_output;} + } } if ($hold_time_option =~ /PRESS_VMAIL/) { @@ -2637,7 +2702,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -2691,6 +2756,29 @@ if ($drop_action =~ /MESSAGE|EXTEN/) $drop_exten = $did_extension; $ext_context = $did_exten_context; } + else + { + $CIDcampaign_cid='0000000000'; + ### Grab ID values from the database + $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $CIDcampaign_id = $aryA[0]; + $CIDcampaign_cid = $aryA[1]; + } + $sthA->finish(); + + $newcallerid = "\"$callerid <$CIDcampaign_cid>\""; + $AGI->set_callerid($newcallerid); + print STDERR "Setting CID \"$newcallerid\"\n"; + checkresult($result); + if ($AGILOG) {$agi_string = "callerID changed: \"$callerid\" \<$CIDcampaign_cid\> from $CIDcampaign_id"; &agi_output;} + } if (length($drop_exten)>0) {$DROPexten = "$drop_exten";} } diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index 41c5e586..ecf65209 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -1515,7 +1515,7 @@ while ($drop_timer <= $DROP_TIME) $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -1719,7 +1719,7 @@ while ($drop_timer <= $DROP_TIME) $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -1778,7 +1778,7 @@ if ($drop_timer > $DROP_TIME) $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -2077,7 +2077,7 @@ sub cpd_end_call $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi b/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi index bcb585b7..2c10c533 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_inbound_calltime_check.agi @@ -44,7 +44,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-VDAD_pin_IVR.agi b/agc_2-X/trunk/agi/agi-VDAD_pin_IVR.agi index 4310ceb4..e1f6b145 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_pin_IVR.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_pin_IVR.agi @@ -55,7 +55,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; diff --git a/agc_2-X/trunk/agi/agi-VDADautoREMINDER.agi b/agc_2-X/trunk/agi/agi-VDADautoREMINDER.agi index 18854310..11df36fa 100644 --- a/agc_2-X/trunk/agi/agi-VDADautoREMINDER.agi +++ b/agc_2-X/trunk/agi/agi-VDADautoREMINDER.agi @@ -46,7 +46,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -382,7 +382,7 @@ if ($pin == "1") ### send call to voicemail $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -440,7 +440,7 @@ if ($pin == "2") ### mark call as a CALLBK $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-VDADautoREMINDERxfer.agi b/agc_2-X/trunk/agi/agi-VDADautoREMINDERxfer.agi index da391cc1..eb63d98b 100644 --- a/agc_2-X/trunk/agi/agi-VDADautoREMINDERxfer.agi +++ b/agc_2-X/trunk/agi/agi-VDADautoREMINDERxfer.agi @@ -48,7 +48,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -384,7 +384,7 @@ if ($pin == "1") ### send call to voicemail $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -442,7 +442,7 @@ if ($pin == "2") ### mark call as a CALLBK $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -488,7 +488,7 @@ if ($pin == "3") ### send call to extension $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-VDADfixCXFER.agi b/agc_2-X/trunk/agi/agi-VDADfixCXFER.agi index f08161f9..fe052ea2 100644 --- a/agc_2-X/trunk/agi/agi-VDADfixCXFER.agi +++ b/agc_2-X/trunk/agi/agi-VDADfixCXFER.agi @@ -27,7 +27,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; diff --git a/agc_2-X/trunk/agi/agi-VDADinbound_NI_DNC_CIDlookup.agi b/agc_2-X/trunk/agi/agi-VDADinbound_NI_DNC_CIDlookup.agi index 082a1bbe..867b82fb 100644 --- a/agc_2-X/trunk/agi/agi-VDADinbound_NI_DNC_CIDlookup.agi +++ b/agc_2-X/trunk/agi/agi-VDADinbound_NI_DNC_CIDlookup.agi @@ -40,7 +40,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-VDADlisten_DTMF.agi b/agc_2-X/trunk/agi/agi-VDADlisten_DTMF.agi index bf389c96..8347dd98 100644 --- a/agc_2-X/trunk/agi/agi-VDADlisten_DTMF.agi +++ b/agc_2-X/trunk/agi/agi-VDADlisten_DTMF.agi @@ -54,7 +54,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; diff --git a/agc_2-X/trunk/agi/agi-VDADselective_CID.agi b/agc_2-X/trunk/agi/agi-VDADselective_CID.agi index 86fc4caf..5fe6aa1d 100644 --- a/agc_2-X/trunk/agi/agi-VDADselective_CID.agi +++ b/agc_2-X/trunk/agi/agi-VDADselective_CID.agi @@ -35,7 +35,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-VDADselective_CID_hangup.agi b/agc_2-X/trunk/agi/agi-VDADselective_CID_hangup.agi index 90dae7f5..5f1d2417 100644 --- a/agc_2-X/trunk/agi/agi-VDADselective_CID_hangup.agi +++ b/agc_2-X/trunk/agi/agi-VDADselective_CID_hangup.agi @@ -32,7 +32,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/agi-record_prompts.agi b/agc_2-X/trunk/agi/agi-record_prompts.agi index 56766aa5..f973e473 100644 --- a/agc_2-X/trunk/agi/agi-record_prompts.agi +++ b/agc_2-X/trunk/agi/agi-record_prompts.agi @@ -322,7 +322,7 @@ sub get_time_now #get the current date and time and epoch for logging call lengt $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/call_inbound.agi b/agc_2-X/trunk/agi/call_inbound.agi index 49078c0e..7a61cab9 100644 --- a/agc_2-X/trunk/agi/call_inbound.agi +++ b/agc_2-X/trunk/agi/call_inbound.agi @@ -34,7 +34,7 @@ $Y = substr($year, 0, 1); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/debug_speak.agi b/agc_2-X/trunk/agi/debug_speak.agi index 5039bbd3..bd481022 100644 --- a/agc_2-X/trunk/agi/debug_speak.agi +++ b/agc_2-X/trunk/agi/debug_speak.agi @@ -23,7 +23,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/invalid_speak.agi b/agc_2-X/trunk/agi/invalid_speak.agi index ee7466ab..f3f07a2f 100644 --- a/agc_2-X/trunk/agi/invalid_speak.agi +++ b/agc_2-X/trunk/agi/invalid_speak.agi @@ -40,7 +40,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/agi/park_CID.agi b/agc_2-X/trunk/agi/park_CID.agi index 2089d1e6..7dd0a33d 100644 --- a/agc_2-X/trunk/agi/park_CID.agi +++ b/agc_2-X/trunk/agi/park_CID.agi @@ -28,7 +28,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} $now_date_epoch = time(); diff --git a/agc_2-X/trunk/bin/ADMIN_timeclock_auto_logout.pl b/agc_2-X/trunk/bin/ADMIN_timeclock_auto_logout.pl index 225b33b8..434601b4 100644 --- a/agc_2-X/trunk/bin/ADMIN_timeclock_auto_logout.pl +++ b/agc_2-X/trunk/bin/ADMIN_timeclock_auto_logout.pl @@ -28,7 +28,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} $file_date = "$year-$mon-$mday"; diff --git a/agc_2-X/trunk/bin/AST_CRON_audio_1_move_mix.pl b/agc_2-X/trunk/bin/AST_CRON_audio_1_move_mix.pl index 6fd75b0d..1009e1b8 100644 --- a/agc_2-X/trunk/bin/AST_CRON_audio_1_move_mix.pl +++ b/agc_2-X/trunk/bin/AST_CRON_audio_1_move_mix.pl @@ -12,7 +12,7 @@ # every 3 minutes or however often you desire # # ### 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 --GSM # 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 --GSM @@ -29,8 +29,11 @@ # # 80302-1958 - First Build # 80731-2253 - Changed size comparisons for more efficiency +# 91105-1353 - Added --MIX option to only check the /var/spool/asterisk/monitor/MIX directory # +$MIX=0; + ### begin parsing run-time options ### if (length($ARGV[0])>1) { @@ -63,6 +66,11 @@ if (length($ARGV[0])>1) $T=1; $TEST=1; print "\n-----TESTING -----\n\n"; } + if ($args =~ /--MIX/i) + { + $MIX=1; + if ($DB) {print "MIX directory audio processing only\n";} + } } } else @@ -160,6 +168,9 @@ else $dir1 = "$PATHmonitor"; $dir2 = "$PATHDONEmonitor"; +if ($MIX > 0) + {$dir1 = "$PATHmonitor/MIX";} + opendir(FILE, "$dir1/"); @FILES = readdir(FILE); diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index b098fc0f..66e9e74a 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -85,6 +85,7 @@ # 90917-1432 - Fixed issue on high-volume systems with lagged agents # 90924-0914 - Added List callerid override option # 91026-1218 - Added AREACODE DNC option +# 91108-2122 - Added LAGGED PAUSEREASON QM entry for lagged agents # @@ -896,7 +897,7 @@ while($one_day_interval > 0) $sthA->finish(); } - $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; + $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR',called_count='$called_count',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; } else { @@ -1269,7 +1270,7 @@ while($one_day_interval > 0) if ($Vaffected_rows > 0) { - $stmtA = "SELECT agent_log_id from vicidial_live_agents where callerid='$KLcallerid[$kill_vac]';"; + $stmtA = "SELECT agent_log_id,user from vicidial_live_agents where callerid='$KLcallerid[$kill_vac]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArowsML=$sthA->rows; @@ -1278,6 +1279,7 @@ while($one_day_interval > 0) { @aryA = $sthA->fetchrow_array; $MLAGagent_log_id[$lagged_ids] = $aryA[0]; + $MLAGuser[$lagged_ids] = $aryA[1]; $lagged_ids++; } $sthA->finish(); @@ -1286,6 +1288,21 @@ while($one_day_interval > 0) { $stmtA = "UPDATE vicidial_agent_log set sub_status='LAGGED' where agent_log_id='$MLAGagent_log_id[$lagged_ids]';"; $VLaffected_rows = $dbhA->do($stmtA); + + if ($enable_queuemetrics_logging > 0) + { + $secX = time(); + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='NONE',agent='Agent/$MLAGuser[$lagged_ids]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LAGGED';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } + $lagged_ids++; } @@ -1666,7 +1683,7 @@ while($one_day_interval > 0) if ($toPAUSEcount > 0) { - $stmtA = "SELECT agent_log_id from vicidial_live_agents where server_ip='$server_ip' and last_update_time < '$PDtsSQLdate' and status NOT IN('PAUSED');"; + $stmtA = "SELECT agent_log_id,user from vicidial_live_agents where server_ip='$server_ip' and last_update_time < '$PDtsSQLdate' and status NOT IN('PAUSED');"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArowsL=$sthA->rows; @@ -1675,6 +1692,7 @@ while($one_day_interval > 0) { @aryA = $sthA->fetchrow_array; $LAGagent_log_id[$lagged_ids] = $aryA[0]; + $LAGuser[$lagged_ids] = $aryA[1]; $lagged_ids++; } $sthA->finish(); @@ -1683,6 +1701,21 @@ while($one_day_interval > 0) { $stmtA = "UPDATE vicidial_agent_log set sub_status='LAGGED' where agent_log_id='$LAGagent_log_id[$lagged_ids]';"; $VLaffected_rows = $dbhA->do($stmtA); + + if ($enable_queuemetrics_logging > 0) + { + $secX = time(); + $dbhB = DBI->connect("DBI:mysql:$queuemetrics_dbname:$queuemetrics_server_ip:3306", "$queuemetrics_login", "$queuemetrics_pass") + or die "Couldn't connect to database: " . DBI->errstr; + + if ($DBX) {print "CONNECTED TO DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";} + + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$secX',call_id='NONE',queue='NONE',agent='Agent/$LAGuser[$lagged_ids]',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='LAGGED';"; + $Baffected_rows = $dbhB->do($stmtB); + + $dbhB->disconnect(); + } + $lagged_ids++; } diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl index e397b75d..839cbcdc 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl @@ -717,7 +717,7 @@ while($one_day_interval > 0) $sthA->finish(); } - $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; + $stmtA = "UPDATE vicidial_list set called_since_last_reset='$CSLR', called_count='$called_count',user='VDAD',last_local_call_time='$LLCT_DATE' where lead_id='$lead_id'"; } else { diff --git a/agc_2-X/trunk/bin/AST_VDhopper.pl b/agc_2-X/trunk/bin/AST_VDhopper.pl index b470335b..b133d82a 100644 --- a/agc_2-X/trunk/bin/AST_VDhopper.pl +++ b/agc_2-X/trunk/bin/AST_VDhopper.pl @@ -82,7 +82,7 @@ $mon++; $wtoday = $wday; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} $file_date = "$year-$mon-$mday"; diff --git a/agc_2-X/trunk/bin/AST_VDremote_agents.pl b/agc_2-X/trunk/bin/AST_VDremote_agents.pl index 6c83f6d6..7aab6152 100644 --- a/agc_2-X/trunk/bin/AST_VDremote_agents.pl +++ b/agc_2-X/trunk/bin/AST_VDremote_agents.pl @@ -862,7 +862,7 @@ sub get_time_now #get the current date and time and epoch for logging call lengt $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/bin/FastAGI_log.pl b/agc_2-X/trunk/bin/FastAGI_log.pl index bde07417..fd33c4d4 100644 --- a/agc_2-X/trunk/bin/FastAGI_log.pl +++ b/agc_2-X/trunk/bin/FastAGI_log.pl @@ -109,7 +109,7 @@ $year = ($year + 1900); $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} -if ($hour < 10) {$Fhour = "0$hour";} +if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} @@ -166,7 +166,7 @@ sub process_request $mon++; if ($mon < 10) {$mon = "0$mon";} if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$Fhour = "0$hour";} + if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} diff --git a/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt b/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt index 8dab16a9..774c69e0 100644 --- a/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt +++ b/agc_2-X/trunk/docs/REQUIRED_APPS_INSTALL.txt @@ -510,6 +510,8 @@ rm -f /usr/lib/asterisk/modules/res_smdi.so rm -f /usr/lib/asterisk/modules/res_snmp.so rm -f /usr/lib/asterisk/modules/res_speech.so +##### Asterisk 1.4.21.2 with zaptel + mkdir /usr/src/asterisk-1.4 cd /usr/src/asterisk-1.4 wget http://downloads.digium.com/pub/asterisk/old-releases/asterisk-1.4.21.2.tar.gz @@ -547,6 +549,53 @@ modprobe ztdummy +##### Asterisk 1.4.27 with Dahdi + +cd /usr/src/asterisk-1.4/ +wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.26.3.tar.gz +wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.27-rc3.tar.gz +wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.10.2.tar.gz +wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-2.2.0.2.tar.gz +wget http://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-2.2.0.tar.gz +tar xvfz dahdi-tools-2.2.0.tar.gz +tar xfz dahdi-linux-2.2.0.2.tar.gz +tar xfz libpri-1.4.10.2.tar.gz +tar xfz asterisk-1.4.27-rc3.tar.gz +tar xfz asterisk-1.4.26.3.tar.gz +cd ../dahdi-linux-2.2.0.2 +make +make install +cd ../dahdi-tools-2.2.0 +./configure +make +make install +make config +dahdi_genconf modules +dahdi_cfg +modprobe dahdi +cd ../libpri-1.4.10.2 +./configure +make +make install +cd ../asterisk-1.4.27-rc3 +wget http://download.vicidial.com/asterisk-patches/1.4-gsm-gcc4.2.patch +wget http://download.vicidial.com/asterisk-patches/moh-alpha-sort-1.4.26.2.patch +wget http://download.vicidial.com/asterisk-patches/netborder-cpd-1.4.patch +wget http://download.vicidial.com/asterisk-patches/app_waitforsilence.c-1.4 +wget http://download.vicidial.com/asterisk-patches/leave.h +wget http://download.vicidial.com/asterisk-patches/enter.h +mv -f enter.h apps/enter.h +mv -f leave.h apps/leave.h +patch -p1 ./codecs/gsm/Makefile 1.4-gsm-gcc4.2.patch +patch -p1 < moh-alpha-sort-1.4.26.2.patch +patch -p1 < netborder-cpd-1.4.patch +./configure +make +make install +asterisk -vvvvvvvvvvvvvvvvvvgc + + + #### pureftpd FTP server installation instructions #### diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 43617f62..75427bfd 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -1522,7 +1522,8 @@ lead_id INT(9) UNSIGNED, callerid VARCHAR(20), group_alias_id VARCHAR(30), index (user), -index (call_date) +index (call_date), +index (group_alias_id) ); CREATE TABLE vicidial_tts_prompts ( @@ -1929,6 +1930,10 @@ INSERT INTO vicidial_drop_rate_groups SET group_id='110'; INSERT INTO vicidial_process_triggers SET trigger_id='LOAD_LEADS',server_ip='10.10.10.15',trigger_name='Load Leads',trigger_time='2009-01-01 00:00:00',trigger_run='0',trigger_lines='/usr/share/astguiclient/VICIDIAL_IN_new_leads_file.pl'; +INSERT INTO vicidial_call_menu SET menu_id='defaultlog',menu_name='logging of all outbound calls from agent phones',menu_prompt='sip-silence',menu_timeout='20',menu_timeout_prompt='NONE',menu_invalid_prompt='NONE',menu_repeat='0',menu_time_check='0',call_time_id='',track_in_vdac='0',custom_dialplan_entry='exten => _.,1,AGI(agi-NVA_recording.agi,BOTH------Y---Y---Y)\nexten => _.,n,Goto(default,${EXTEN},1)',tracking_group=''; + +INSERT INTO vicidial_call_menu_options SET menu_id='defaultlog',option_value='TIMEOUT',option_description='hangup',option_route='HANGUP',option_route_value='vm-goodbye',option_route_value_context=''; + UPDATE system_settings SET qc_last_pull_time=NOW(); CREATE INDEX country_postal_code on vicidial_postal_codes (country_code,postal_code); @@ -1949,7 +1954,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number); CREATE INDEX date_user on vicidial_closer_log (call_date,user); CREATE INDEX comment_a on live_inbound_log (comment_a); -UPDATE system_settings SET db_schema_version='1179',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1180',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.2.0.sql b/agc_2-X/trunk/extras/upgrade_2.2.0.sql index bb70a50b..cc816d11 100644 --- a/agc_2-X/trunk/extras/upgrade_2.2.0.sql +++ b/agc_2-X/trunk/extras/upgrade_2.2.0.sql @@ -600,3 +600,11 @@ UPDATE system_settings SET db_schema_version='1178',db_schema_update_date=NOW(); ALTER TABLE vicidial_server_carriers ADD carrier_description VARCHAR(255); UPDATE system_settings SET db_schema_version='1179',db_schema_update_date=NOW(); + +CREATE INDEX group_alias_id ON user_call_log (group_alias_id); + +INSERT INTO vicidial_call_menu SET menu_id='defaultlog',menu_name='logging of all outbound calls from agent phones',menu_prompt='sip-silence',menu_timeout='20',menu_timeout_prompt='NONE',menu_invalid_prompt='NONE',menu_repeat='0',menu_time_check='0',call_time_id='',track_in_vdac='0',custom_dialplan_entry='exten => _.,1,AGI(agi-NVA_recording.agi,BOTH------Y---Y---Y)\nexten => _.,n,Goto(default,${EXTEN},1)',tracking_group=''; + +INSERT INTO vicidial_call_menu_options SET menu_id='defaultlog',option_value='TIMEOUT',option_description='hangup',option_route='HANGUP',option_route_value='vm-goodbye',option_route_value_context=''; + +UPDATE system_settings SET db_schema_version='1180',db_schema_update_date=NOW(); diff --git a/agc_2-X/trunk/install.pl b/agc_2-X/trunk/install.pl index 9e91d1e3..8aa91b84 100644 --- a/agc_2-X/trunk/install.pl +++ b/agc_2-X/trunk/install.pl @@ -19,6 +19,7 @@ # 90312-1256 - Added CLI flag for automatic configuration # 90620-1910 - Added check before creating directories and formatting changes # 90727-1457 - Added GSW directory creation +# 91105-1359 - Added MIX directory to /var/spool/asterisk/monitor # ############################################ @@ -2172,6 +2173,8 @@ if ($WEBONLY < 1) `mkdir -p $PATHmonitor`; `chmod -R 0766 $PATHmonitor`; } + if (!-e "$PATHmonitor/MIX") {`mkdir -p $PATHmonitor/MIX`;} + if (!-e "$PATHDONEmonitor") { `mkdir -p $PATHDONEmonitor`; diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index e1f8ad2a..44dd2758 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -219,10 +219,11 @@ # 91012-0535 - Fixed User territory no-hopper dial bug # 91019-1224 - Fixed auto-alt-dial DNC issues # 91026-1101 - Added AREACODE DNC option +# 91108-2120 - Fixed QM log issue with PAUSEREASON entries # -$version = '2.2.0-128'; -$build = '91026-1101'; +$version = '2.2.0-129'; +$build = '91108-2120'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=256; $one_mysql_log=0; @@ -5310,7 +5311,7 @@ if ($ACTION == 'PauseCodeSubmit') $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); - $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='$campaign',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='PAUSEREASON',serverid='$queuemetrics_log_id',data1='$status';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00177',$user,$server_ip,$session_name,$one_mysql_log);} diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index d0e3eba1..1e45d52a 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -257,10 +257,11 @@ # 90923-1310 - Rolled back last change # 90928-1955 - Added lead update before closer transfer # 90930-2243 - Added Territory selection functions +# 91108-2118 - Added QM pause code entry # -$version = '2.2.0-235'; -$build = '90930-2243'; +$version = '2.2.0-236'; +$build = '91108-2118'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=61; $one_mysql_log=0; @@ -2059,6 +2060,23 @@ else $agent_log_id = mysql_insert_id($link); echo "\n"; + if ($enable_queuemetrics_logging > 0) + { + $StarTtimEpause = ($StarTtimE + 1); + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); + mysql_select_db("$queuemetrics_dbname", $linkB); + + $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimEpause',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEREASON',data1='LOGIN',serverid='$queuemetrics_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $linkB); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($linkB); + echo "\n"; + + mysql_close($linkB); + mysql_select_db("$VARDB_database", $link); + } + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id' where user='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index 77e10374..c6fca55f 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -56,10 +56,11 @@ # 90808-0212 - Fixed inbound only non-ALL bug, changed times to use agent last_state_change # 90907-0915 - Added PARK status # 90914-1154 - Added AgentOnly display column to waiting calls section +# 91102-2013 - Changed in-group color styles for incoming calls waiting # -$version = '2.0.5-47'; -$build = '90914-1154'; +$version = '2.0.5-48'; +$build = '91102-2013'; header ("Content-type: text/html; charset=utf-8"); @@ -479,7 +480,7 @@ $open_list = "< $row=mysql_fetch_row($rslt); $group_id[$g] = $row[0]; $group_color[$g] = $row[1]; - echo " .$group_id[$g] {color: black; background-color: $group_color[$g]}\n"; + echo " .csc$group_id[$g] {color: black; background-color: $group_color[$g]}\n"; $g++; } } @@ -1269,7 +1270,7 @@ while($p<$k) $G = ''; $EG = ''; if ($CDcall_type[$p] == 'IN') { - $G=""; $EG=''; + $G=""; $EG=''; } if (strlen($CDagent_only[$p]) > 0) {$Gcalltypedisplay = "$G$Cagent_only$EG";}