Added queue_log DID and IVR logging entries for QueueMetrics
git-svn-id: svn://192.168.202.10@1262 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -272,6 +272,8 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
|
||||
make sure you use the STEP 1 audio mixing script in your crontab with
|
||||
the "--MIX" option so that these recordings are stored properly
|
||||
|
||||
67. Added queue_log DID and IVR logging entries for QueueMetrics
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
# 90214-0217 - Added 'default' did option, to send all non-matching calls to, enforced did_active setting
|
||||
# 90507-1145 - Added CALLMENU option
|
||||
# 90825-2252 - Changed PHONE to route using dialplan number
|
||||
# 91122-0743 - Added QueueMetrics logging as DID INFO entries
|
||||
#
|
||||
|
||||
$script = 'agi-DID_route.agi';
|
||||
@@ -103,40 +104,60 @@ $stmtA = "SELECT agi_output,local_gmt FROM servers where server_ip = '$VARserver
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
$AGILOG = '0';
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$DBagi_output = "$aryA[0]";
|
||||
$local_gmt = "$aryA[1]";
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
$rec_count++;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$DBagi_output = "$aryA[0]";
|
||||
$local_gmt = "$aryA[1]";
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
#############################################
|
||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||
$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend FROM system_settings;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$enable_queuemetrics_logging = $aryA[0];
|
||||
$queuemetrics_server_ip = $aryA[1];
|
||||
$queuemetrics_dbname = $aryA[2];
|
||||
$queuemetrics_login= $aryA[3];
|
||||
$queuemetrics_pass = $aryA[4];
|
||||
$queuemetrics_log_id = $aryA[5];
|
||||
$queuemetrics_eq_prepend = $aryA[6];
|
||||
}
|
||||
$sthA->finish();
|
||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$|=1;
|
||||
while(<STDIN>)
|
||||
{
|
||||
{
|
||||
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;}
|
||||
if (/^agi_extension\:\s+(.*)$/) {$extension = $1;}
|
||||
if (/^agi_type\:\s+(.*)$/) {$type = $1;}
|
||||
if (/^agi_type\:\s+(.*)$/) {$type = $1;}
|
||||
if (/^agi_callerid\:\s+(.*)$/) {$callerid = $1;}
|
||||
if (/^agi_calleridname\:\s+(.*)$/) {$calleridname = $1;}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) )
|
||||
@@ -146,8 +167,8 @@ if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown
|
||||
$calleridname =~ s/\"|\" //gi;
|
||||
}
|
||||
|
||||
$callerid =~ s/\D//gi;
|
||||
$calleridname =~ s/unknown//gi;
|
||||
$callerid =~ s/\D//gi;
|
||||
$calleridname =~ s/unknown//gi;
|
||||
if ( (!$callerid) or ($callerid =~ /unknown/) )
|
||||
{$callerid = $calleridname;}
|
||||
|
||||
@@ -315,6 +336,20 @@ if ($did_route =~ /AGENT/)
|
||||
}
|
||||
|
||||
|
||||
### QueueMetrics logging if enabled
|
||||
if ( ($did_route =~ /EXTEN|CALLMENU/) && ($enable_queuemetrics_logging > 0) )
|
||||
{
|
||||
$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 QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='DID',data2='$extension',serverid='$queuemetrics_log_id';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhB->disconnect();
|
||||
}
|
||||
|
||||
|
||||
### Route call to an extension on the system
|
||||
if ($did_route =~ /EXTEN/)
|
||||
{
|
||||
@@ -354,60 +389,66 @@ if ($did_route =~ /CALLMENU/)
|
||||
######### SUBROUTINES #################
|
||||
|
||||
sub checkresult
|
||||
{
|
||||
{
|
||||
$pass=0; $fail=0;
|
||||
my ($res) = @_;
|
||||
my $retval;
|
||||
$tests++;
|
||||
chomp $res;
|
||||
if ($res =~ /^200/) {
|
||||
if ($res =~ /^200/)
|
||||
{
|
||||
$res =~ /result=(-?\d+)/;
|
||||
if (!length($1)) {
|
||||
if (!length($1))
|
||||
{
|
||||
# print STDERR "FAIL ($res)\n";
|
||||
$fail++;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
# print STDERR "PASS ($1)\n";
|
||||
$pass++;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# print STDERR "FAIL (unexpected result '$res')\n";
|
||||
$fail++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub leading_zero($)
|
||||
{
|
||||
{
|
||||
$_ = $_[0];
|
||||
s/^(\d)$/0$1/;
|
||||
s/^(\d\d)$/0$1/;
|
||||
return $_;
|
||||
} # End of the leading_zero() routine.
|
||||
} # End of the leading_zero() routine.
|
||||
|
||||
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);
|
||||
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='';
|
||||
}
|
||||
### send to STDERR writing ###
|
||||
if ( ($AGILOG == '1') || ($AGILOG == '3') )
|
||||
{print STDERR "$now_date|$script|$agi_string\n";}
|
||||
$agi_string='';
|
||||
}
|
||||
|
||||
sub did_output
|
||||
{
|
||||
if ($AGILOG >=2)
|
||||
{
|
||||
### open the log file for writing ###
|
||||
open(Dout, ">>$DIDLOGfile")
|
||||
|| die "Can't open $DIDLOGfile: $!\n";
|
||||
print Dout "$did_string\n";
|
||||
close(Dout);
|
||||
if ($AGILOG >=2)
|
||||
{
|
||||
### open the log file for writing ###
|
||||
open(Dout, ">>$DIDLOGfile")
|
||||
|| die "Can't open $DIDLOGfile: $!\n";
|
||||
print Dout "$did_string\n";
|
||||
close(Dout);
|
||||
}
|
||||
$did_string='';
|
||||
}
|
||||
$did_string='';
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@
|
||||
# 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
|
||||
# 91122-2352 - Added queue_log IVR and DID entry linking
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_ALL_inbound.agi';
|
||||
@@ -1101,25 +1102,23 @@ $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$dbhP=$dbhA; $mysql_count='02026'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
$rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$enable_queuemetrics_logging = "$aryA[0]";
|
||||
$queuemetrics_server_ip = "$aryA[1]";
|
||||
$queuemetrics_dbname = "$aryA[2]";
|
||||
$queuemetrics_login= "$aryA[3]";
|
||||
$queuemetrics_pass = "$aryA[4]";
|
||||
$queuemetrics_log_id = "$aryA[5]";
|
||||
$queuemetrics_eq_prepend = "$aryA[6]";
|
||||
$rec_count++;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$enable_queuemetrics_logging = $aryA[0];
|
||||
$queuemetrics_server_ip = $aryA[1];
|
||||
$queuemetrics_dbname = $aryA[2];
|
||||
$queuemetrics_login= $aryA[3];
|
||||
$queuemetrics_pass = $aryA[4];
|
||||
$queuemetrics_log_id = $aryA[5];
|
||||
$queuemetrics_eq_prepend = $aryA[6];
|
||||
}
|
||||
$sthA->finish();
|
||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||
###########################################
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$data2 = "$phone_number";
|
||||
$data2 = "$phone_number";
|
||||
|
||||
if ( (length($queuemetrics_eq_prepend) > 0) && ($queuemetrics_eq_prepend !~ /NONE/) )
|
||||
{
|
||||
@@ -1131,11 +1130,11 @@ if ($enable_queuemetrics_logging > 0)
|
||||
$rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
$DASH='-';
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$QMprepend = "$aryA[0]";
|
||||
$rec_count++;
|
||||
$data2 = "$QMprepend$DASH$phone_number";
|
||||
$DASH='-';
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$QMprepend = "$aryA[0]";
|
||||
$rec_count++;
|
||||
$data2 = "$QMprepend$DASH$phone_number";
|
||||
}
|
||||
$sthA->finish();
|
||||
}
|
||||
@@ -1148,7 +1147,6 @@ if ($enable_queuemetrics_logging > 0)
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$YqueryCID',queue='$channel_group',agent='NONE',verb='ENTERQUEUE',data2='$data2',serverid='$queuemetrics_log_id';";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02028'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging;
|
||||
$dbhB->disconnect();
|
||||
}
|
||||
|
||||
|
||||
@@ -1163,6 +1161,7 @@ $stmtA = "select auto_call_id from vicidial_auto_calls where uniqueid='$uniqueid
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($AGILOG) {$agi_string = "$sthArows|$stmtA|"; &agi_output;}
|
||||
$dbhP=$dbhA; $mysql_count='02029'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@@ -1171,8 +1170,8 @@ if ($sthArows > 0)
|
||||
|
||||
### UPDATE existing record to LIVE in the vicidial_auto_calls table
|
||||
$stmtA = "UPDATE vicidial_auto_calls SET campaign_id='$channel_group',status='LIVE',lead_id='$insert_lead_id',callerid='$callerid',channel='$channel',phone_code='$phone_code',phone_number='$phone_number',call_time='$SQLdate',call_type='IN',stage='LIVE-0',queue_priority='$queue_priority' $adSQL WHERE auto_call_id='$auto_call_id';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$Uaffected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "$Uaffected_rows|$stmtA|"; &agi_output;}
|
||||
$dbhP=$dbhA; $mysql_count='02029'; $MEL_aff_rows=$Uaffected_rows; &mysql_error_logging;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -1197,6 +1196,16 @@ if ($Uaffected_rows < 1)
|
||||
$sthA->finish();
|
||||
}
|
||||
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$QL_last_day = ($now_date_epoch - 86400);
|
||||
$stmtB = "UPDATE queue_log SET call_id='$YqueryCID' where time_id > '$QL_last_day' and call_id='$uniqueid' and queue='NONE' and agent='NONE' and verb='INFO' and data1 IN('DID','IVR');";
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
if ($AGILOG) {$agi_string = "$Baffected_rows|$stmtB|"; &agi_output;}
|
||||
$dbhP=$dbhB; $stmtA=$stmtB; $mysql_count='02XXX'; $MEL_aff_rows=$Baffected_rows; &mysql_error_logging;
|
||||
$dbhB->disconnect();
|
||||
}
|
||||
|
||||
$stmtA = "INSERT INTO vicidial_closer_log SET lead_id='$insert_lead_id', campaign_id='$channel_group', call_date='$SQLdate', start_epoch='$now_date_epoch', status='QUEUE', phone_code='$phone_code', phone_number='$phone_number', user='VDCL', processed='N', xfercallid='$insert_xfer_id', uniqueid='$uniqueid' $adSQL;";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
# 81017-0238 - Fixed duplication bug for vac in multi-entry dialplans
|
||||
# 90504-1555 - Added call time scheme override
|
||||
# 90621-1130 - Fixed issue when no call time is specified
|
||||
# 91122-2353 - Added QueueMetrics logging as IVR INFO entries
|
||||
#
|
||||
|
||||
$script = 'agi-VDAD_inbound_calltime_check.agi';
|
||||
@@ -127,8 +128,7 @@ $stmtA = "SELECT agi_output FROM servers where server_ip = '$VARserver_ip';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
$rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
$AGILOG = '0';
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
@@ -136,10 +136,30 @@ while ($sthArows > $rec_count)
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
#############################################
|
||||
##### START QUEUEMETRICS LOGGING LOOKUP #####
|
||||
$stmtA = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_eq_prepend FROM system_settings;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$enable_queuemetrics_logging = $aryA[0];
|
||||
$queuemetrics_server_ip = $aryA[1];
|
||||
$queuemetrics_dbname = $aryA[2];
|
||||
$queuemetrics_login= $aryA[3];
|
||||
$queuemetrics_pass = $aryA[4];
|
||||
$queuemetrics_log_id = $aryA[5];
|
||||
$queuemetrics_eq_prepend = $aryA[6];
|
||||
}
|
||||
$sthA->finish();
|
||||
##### END QUEUEMETRICS LOGGING LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
### begin parsing run-time options ###
|
||||
if (length($ARGV[0])>1)
|
||||
@@ -243,13 +263,12 @@ $sthArows=$sthA->rows;
|
||||
while ($sthArows > $cbc)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
|
||||
$DBvoicemail_dump_exten = "$aryA[0]";
|
||||
$DBext_context = "$aryA[1]";
|
||||
$DBanswer_transfer_agent = "$aryA[2]";
|
||||
$DBSERVER_GMT = "$aryA[3]";
|
||||
$DBasterisk_version = "$aryA[4]";
|
||||
$DBmax_vicidial_trunks = "$aryA[5]";
|
||||
$DBvoicemail_dump_exten = $aryA[0];
|
||||
$DBext_context = $aryA[1];
|
||||
$DBanswer_transfer_agent = $aryA[2];
|
||||
$DBSERVER_GMT = $aryA[3];
|
||||
$DBasterisk_version = $aryA[4];
|
||||
$DBmax_vicidial_trunks = $aryA[5];
|
||||
if ($DBvoicemail_dump_exten) {$voicemail_dump_exten = $DBvoicemail_dump_exten;}
|
||||
if ($DBext_context) {$ext_context = $DBext_context;}
|
||||
if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;}
|
||||
@@ -271,28 +290,27 @@ if (length($channel_group) > 1)
|
||||
while ($sthArows > $cbc)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
|
||||
$call_time_id = "$aryA[0]";
|
||||
$after_hours_action = "$aryA[1]";
|
||||
$after_hours_message_filename = "$aryA[2]";
|
||||
$after_hours_exten = "$aryA[3]";
|
||||
$after_hours_voicemail = "$aryA[4]";
|
||||
$welcome_message_filename = "$aryA[5]";
|
||||
$moh_context = "$aryA[6]";
|
||||
$onhold_prompt_filename = "$aryA[7]";
|
||||
$prompt_interval = "$aryA[8]";
|
||||
$agent_alert_exten = "$aryA[9]";
|
||||
$agent_alert_delay = "$aryA[10]";
|
||||
$drop_call_seconds = "$aryA[11]";
|
||||
$call_time_id = $aryA[0];
|
||||
$after_hours_action = $aryA[1];
|
||||
$after_hours_message_filename = $aryA[2];
|
||||
$after_hours_exten = $aryA[3];
|
||||
$after_hours_voicemail = $aryA[4];
|
||||
$welcome_message_filename = $aryA[5];
|
||||
$moh_context = $aryA[6];
|
||||
$onhold_prompt_filename = $aryA[7];
|
||||
$prompt_interval = $aryA[8];
|
||||
$agent_alert_exten = $aryA[9];
|
||||
$agent_alert_delay = $aryA[10];
|
||||
$drop_call_seconds = $aryA[11];
|
||||
$DROP_TIME = $drop_call_seconds;
|
||||
$drop_action = "$aryA[12]";
|
||||
$drop_exten = "$aryA[13]";
|
||||
$CAMP_callorder = "$aryA[14]";
|
||||
$VDADvoicemail_ext = "$aryA[15]";
|
||||
$drop_action = $aryA[12];
|
||||
$drop_exten = $aryA[13];
|
||||
$CAMP_callorder = $aryA[14];
|
||||
$VDADvoicemail_ext = $aryA[15];
|
||||
$VDADvoicemail_ext =~ s/\D//gi;
|
||||
$queue_priority = "$aryA[16]";
|
||||
$drop_inbound_group = "$aryA[17]";
|
||||
$afterhours_xfer_group = "$aryA[18]";
|
||||
$queue_priority = $aryA[16];
|
||||
$drop_inbound_group = $aryA[17];
|
||||
$afterhours_xfer_group = $aryA[18];
|
||||
$cbc++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -335,10 +353,10 @@ $sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$ct_default_start = "$aryA[0]";
|
||||
$ct_default_stop = "$aryA[1]";
|
||||
$ct_day_start = "$aryA[2]";
|
||||
$ct_day_stop = "$aryA[3]";
|
||||
$ct_default_start = $aryA[0];
|
||||
$ct_default_stop = $aryA[1];
|
||||
$ct_day_start = $aryA[2];
|
||||
$ct_day_stop = $aryA[3];
|
||||
$sthA->finish();
|
||||
|
||||
if ( ($ct_day_start > 0) || ($ct_day_stop > 0) )
|
||||
@@ -400,6 +418,20 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
|
||||
$affected_rowsL = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- AH LIL : |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;}
|
||||
|
||||
### QueueMetrics logging if enabled
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$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 QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$context',serverid='$queuemetrics_log_id';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;}
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhB->disconnect();
|
||||
}
|
||||
|
||||
if ($after_hours_action =~ /HANGUP/)
|
||||
{
|
||||
### insert a NEW record to the vicidial_manager table to hangup the channel
|
||||
@@ -447,6 +479,21 @@ $affected_rowsL = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- LIL : |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;}
|
||||
|
||||
|
||||
### QueueMetrics logging if enabled
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
$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 QueueMetrics DATABASE: $queuemetrics_server_ip|$queuemetrics_dbname\n";}
|
||||
|
||||
$stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='$uniqueid',queue='NONE',agent='NONE',verb='INFO',data1='IVR',data2='$context',serverid='$queuemetrics_log_id';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtB|"; &agi_output;}
|
||||
$Baffected_rows = $dbhB->do($stmtB);
|
||||
$dbhB->disconnect();
|
||||
}
|
||||
|
||||
|
||||
$sthA->finish();
|
||||
$dbhA->disconnect();
|
||||
|
||||
|
||||
@@ -433,6 +433,7 @@ PHASE 6: ADDING CRONTAB ENTRIES FOR ASTGUICLIENT/VICIDIAL SCRIPTS
|
||||
50 0 * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --last-24hours
|
||||
## uncomment below if using QueueMetrics
|
||||
#*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check
|
||||
#1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet
|
||||
|
||||
### updater for VICIDIAL hopper
|
||||
* * * * * /usr/share/astguiclient/AST_VDhopper.pl -q
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
VICIDIAL and QueueMetrics
|
||||
|
||||
queue_log logging was added to VICIDIAL outbound auto calling as an option in the 2.0.3 release tree.
|
||||
queue_log logging was added to VICIDIAL outbound auto calling as an option in the 2.0.3 release, and for inbound in the 2.0.4 release.
|
||||
|
||||
This document goes over the features and needed changes made to VICIDIAL to enable it to insert activity records into the queue_log and other tables in MySQL that QueueMetrics uses for it's statistical analysis and reports. This document should not be taken as a HOWTO for proper installation steps to get QueueMetrics working.
|
||||
|
||||
@@ -15,11 +15,20 @@ Another very important issue to note is that just like with VICIDIAL on multi-se
|
||||
To be able to view stats for inbound and outbound calls properly you need to add each one individually in QueueMetrics "queues" and properly set whether each one is inbound or outbound. After that you can create a combined queue-alias with all of the campaigns and in-groups in it and it will tell you correctly the number of inbound and outbound calls.
|
||||
|
||||
As of 2008-10-30, several validation and correction functions were added to the AST_cleanup_agent_log.pl script that is supposed to run every hour. These functions should clean up any queue_log errors that appear and cause QueueMetrics to display incorrect call totals.
|
||||
|
||||
|
||||
As of 2009-05-30, live montoring and playback of archived recordings through the QueueMetrics interface was added. To use this you must have the audio.server, audio.liveserver and default.audioRpcServer variables set properly in the configuration.properties file as specified toward the bottom of this document. The live monitoring asks for an extension to send the call to, this is an extension dialed on the active voicemail server as defined in the system settings. If there is no active voicemail defined then the live monitor will place the call to the extension on the server that the agent is on.
|
||||
|
||||
As of 2009-11-23, DID and IVR logging through QueueMetrics queue_log is now part of the code. DID entries for the queue will be counted only for calls that actually enter the queue or are sent to an agent through a ViciDial in-group. For IVR entries, only the last Call Menu will be counted in the QueueMetrics reports.
|
||||
|
||||
|
||||
Entries you should have in your crontab on one server:
|
||||
### fix the vicidial_agent_log once every hour and the full day run at night
|
||||
33 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl
|
||||
50 0 * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --last-24hours
|
||||
*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check
|
||||
1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet
|
||||
|
||||
|
||||
Here is a short summary of the needed steps to install QueueMetrics on your system:
|
||||
|
||||
@@ -186,6 +195,7 @@ call actions before going to agent - used by agi-VDAD_ALL_inbound/outbound scrip
|
||||
EXITWITHTIMEOUT(position)
|
||||
EXITWITHKEY(key|position)
|
||||
TRANSFER(extension|context|holdtime|calltime)
|
||||
INFO([IVR or DID]|[context or DID])
|
||||
|
||||
call actions before going to agent - used by AST_VDauto_dial.pl
|
||||
ABANDON(position|origposition|waittime)
|
||||
@@ -203,7 +213,7 @@ not used in vicidial -
|
||||
|
||||
|
||||
|
||||
data1: call termination codes, TBD
|
||||
data1: call termination codes, DID, IVR context
|
||||
|
||||
data2: callerID or number called(sometimes prepended by DNIS) [3101-9015556189]
|
||||
NOTE: the queuemetrics_eq_prepend field allows you to specify what
|
||||
|
||||
@@ -2384,6 +2384,7 @@ SUBPHASE 6.5: setting up astguiclient scripts for continuous running
|
||||
50 0 * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --last-24hours
|
||||
## uncomment below if using QueueMetrics
|
||||
#*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check
|
||||
#1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet
|
||||
|
||||
### updater for VICIDIAL hopper
|
||||
* * * * * /usr/share/astguiclient/AST_VDhopper.pl -q
|
||||
|
||||
Reference in New Issue
Block a user