Added DAHDI channel compatibility

Added carrier hangup_cause and dialstatus logging for outbound list dialing calls

git-svn-id: svn://192.168.202.10@1144 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-06-05 07:13:55 +00:00
parent 675f0573de
commit c3fa8a760d
12 changed files with 200 additions and 124 deletions
+1
View File
@@ -81,6 +81,7 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
21. Added User Time-Clock Detail report to show agent login and logout times
along with totals, sortable and downloadable
22. Added DAHDI channel compatibility and carrier logging for outbound list calls
+12 -11
View File
@@ -5,13 +5,13 @@
# DESCRIPTION:
# uses the Asterisk Manager interface and Net::MySQL to update the live_channels
# tables and verify the parked_channels table in the asterisk MySQL database
# This "near-live-status of Zap/SIP/Local/IAX channels" list is used by clients
# This near-live-status of Zap/SIP/Local/IAX/DAHDI channels list is used by clients
#
# SUMMARY:
# This program was designed for people using the Asterisk PBX with Digium
# Zaptel telco cards and SIP VOIP hardphones or softphones as extensions, it
# could be adapted to other functions, but I designed it specifically for
# Zap/IAX2/SIP users. The program will run on UNIX or Win32 command line
# Zap/IAX2/SIP/DAHDI users. The program will run on UNIX or Win32 command line
# providing the following criteria are met:
#
# Win32 - ActiveState Perl 5.8.0
@@ -57,9 +57,10 @@
# 61227-1659 - added "core show channels concise" for Asterisk 1.4 compatibility
# 80111-1850 - fixed server_updater record missing bug
# 90307-1932 - Added servers table stats updating, reformatted code to match standard
# 90604-1127 - Added support for DAHDI channels
#
$build = '90307-1932';
$build = '90604-1127';
# constants
$SYSPERF=0; # system performance logging to MySQL server_performance table every 5 seconds
@@ -309,8 +310,8 @@ if ($SUrec < 1)
}
##### LOOK FOR ZAP CLIENTS AS DEFINED IN THE phones TABLE SO THEY ARE NOT MISLABELED AS TRUNKS
print STDERR "LOOKING FOR Zap clients assigned to this server:\n";
##### LOOK FOR ZAP/DAHDI CLIENTS AS DEFINED IN THE phones TABLE SO THEY ARE NOT MISLABELED AS TRUNKS
print STDERR "LOOKING FOR Zap/DAHDI clients assigned to this server:\n";
$Zap_client_count=0;
$Zap_client_list='|';
$stmtA = "SELECT extension FROM phones where protocol = 'Zap' and server_ip='$server_ip'";
@@ -476,7 +477,7 @@ while($one_day_interval > 0)
if (length($test_chan_12[6])<2) {$test_chan_12[6] = 'SIP/ring';}
$test_channels[$s] = "$test_chan_12[0] $test_chan_12[6]";
}
if ($test_channels[$s] =~ /^Zap|^IAX2|^SIP|^Local/)
if ($test_channels[$s] =~ /^Zap|^IAX2|^SIP|^Local|^DAHDI/)
{
if ($test_channels[$s] =~ /^(\S+)\s+.+\s+(\S+)$/)
{
@@ -499,7 +500,7 @@ while($one_day_interval > 0)
if ($Zap_client_count)
{
$channel_match=$channel;
$channel_match =~ s/^Zap\///gi;
$channel_match =~ s/^Zap\/|^DAHDI\///gi;
$channel_match =~ s/\*/\\\*/gi;
if ($Zap_client_list =~ /\|$channel_match\|/i) {$test_zap_count++;}
}
@@ -818,7 +819,7 @@ while($one_day_interval > 0)
if( ($DB) or ($UD_bad_grab) ){print "+|$c|$list_channels[$c]|\n\n";}
########## PARSE EACH LINE TO DETERMINE WHETHER IT IS TRUNK OR CLIENT AND PUT IN APPROPRIATE TABLE
if ($list_channels[$c] =~ /^Zap|^IAX2|^SIP|^Local/)
if ($list_channels[$c] =~ /^Zap|^IAX2|^SIP|^Local|^DAHDI/)
{
if ($list_channels[$c] =~ /^(\S+)\s+.+\s+(\S+)$/)
{
@@ -852,7 +853,7 @@ while($one_day_interval > 0)
if( ($DB) or ($UD_bad_grab) ){print "extension: |$extension|\n";}
if( ($DB) or ($UD_bad_grab) ){print "QRYchannel:|$QRYchannel|\n";}
if ($channel =~ /^SIP|^Zap|^IAX2/) {$line_type = 'TRUNK';}
if ($channel =~ /^SIP|^Zap|^IAX2|^DAHDI/) {$line_type = 'TRUNK';}
if ($channel =~ /^Local/) {$line_type = 'CLIENT';}
if ($IAX2_client_count)
{
@@ -866,7 +867,7 @@ while($one_day_interval > 0)
if ($Zap_client_count)
{
$channel_match=$channel;
$channel_match =~ s/^Zap\///gi;
$channel_match =~ s/^Zap\/|^DAHDI\///gi;
$channel_match =~ s/\*/\\\*/gi;
# print "checking for Zap client: |$channel_match|\n";
if ($Zap_client_list =~ /\|$channel_match\|/i) {$line_type = 'CLIENT';}
@@ -1107,7 +1108,7 @@ sub get_current_channels
if($DB){print STDERR $aryA[0],"|", $aryA[1],"\n";}
$DBsips[$sip_counter] = "$aryA[0]$US$aryA[1]";
if ($aryA[0] =~ /^Zap/) {$zap_client_counter++;}
if ($aryA[0] =~ /^Zap|^DAHDI/) {$zap_client_counter++;}
if ($aryA[0] =~ /^IAX/) {$iax_client_counter++;}
if ($aryA[0] =~ /^Local/) {$local_client_counter++;}
if ($aryA[0] =~ /^SIP/) {$sip_client_counter++;}
+134 -107
View File
@@ -40,10 +40,11 @@
# 80510-2058 - Fixed status override bug
# 80525-1040 - Added IVR vac status compatibility for inbound calls
# 80830-0035 - Added auto alt dialing for EXTERNAL leads for each lead
# 80909-0843 - Added support for campaign-speccific DNC lists
# 80909-0843 - Added support for campaign-specific DNC lists
# 81021-0306 - Added Local channel logging support and while-to-if changes
# 81026-1247 - Changed to allow for better remote agent calling
# 81029-0522 - Changed to disallow queue_log logging of IVR calls
# 90604-1044 - Fixed formatting, added DAHDI support, added carrier hangup code logging
#
@@ -124,9 +125,9 @@ $sthBrows=$sthB->rows;
$rec_count=0;
while ($sthBrows > $rec_count)
{
@aryB = $sthB->fetchrow_array;
$SERVERLOG = "$aryB[0]";
$rec_count++;
@aryB = $sthB->fetchrow_array;
$SERVERLOG = "$aryB[0]";
$rec_count++;
}
$sthB->finish();
$dbhB->disconnect();
@@ -149,7 +150,9 @@ use Net::Server::PreFork; # any personality will do
sub process_request {
sub process_request
{
$carrier_logging_active=0;
$process = 'begin';
$script = 'VDfastAGI';
########## Get current time, parse configs, get logging preferences ##########
@@ -219,18 +222,16 @@ sub process_request {
while ($sthArows > $rec_count)
{
$AGILOG = '0';
@aryA = $sthA->fetchrow_array;
$DBagi_output = "$aryA[0]";
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]";
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
$rec_count++;
}
$sthA->finish();
if ($AGILOG)
{
$agi_string = "+++++++++++++++++ FastAGI Start ++++++++++++++++++++++++++++++++++++++++";
@@ -241,7 +242,7 @@ sub process_request {
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
{
if ($AGILOG)
{
$agi_string = "Perl Environment Dump:";
@@ -249,7 +250,7 @@ sub process_request {
}
$i=0;
while ($#ARGV >= $i)
{
{
$args = "$args $ARGV[$i]";
if ($AGILOG)
{
@@ -257,23 +258,25 @@ sub process_request {
&agi_output;
}
$i++;
}
}
}
$HVcauses=0;
$fullCID=0;
$callerid='';
$calleridname='';
$|=1;
while(<STDIN>) {
while(<STDIN>)
{
chomp;
last unless length($_);
if ($AGILOG)
{
if (/^agi_(\w+)\:\s+(.*)$/)
{
$AGI{$1} = $2;
if (/^agi_(\w+)\:\s+(.*)$/)
{
$AGI{$1} = $2;
}
}
}
if (/^agi_uniqueid\:\s+(.*)$/) {$unique_id = $1; $uniqueid = $unique_id;}
if (/^agi_priority\:\s+(.*)$/) {$priority = $1;}
@@ -326,7 +329,7 @@ sub process_request {
}
$calleridname = $callerid;
}
}
}
if ($AGILOG)
{
@@ -335,13 +338,13 @@ sub process_request {
}
foreach $i (sort keys %AGI)
{
{
if ($AGILOG)
{
$agi_string = " -- $i = $AGI{$i}";
&agi_output;
}
}
}
if ($AGILOG)
@@ -377,10 +380,10 @@ sub process_request {
if ($channel =~ /^SIP/) {$channel =~ s/-.*//gi;}
if ($channel =~ /^IAX2/) {$channel =~ s/\/\d+$//gi;}
if ($channel =~ /^Zap\//)
if ($channel =~ /^Zap\/|^DAHDI\//)
{
$channel_line = $channel;
$channel_line =~ s/^Zap\///gi;
$channel_line =~ s/^Zap\/|^DAHDI\///gi;
$stmtA = "SELECT count(*) FROM phones where server_ip='$VARserver_ip' and extension='$channel_line' and protocol='Zap';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -443,7 +446,7 @@ sub process_request {
if ($is_client_phone > 0)
{$channel_group = 'Client Phone';}
$SIP_ext = $channel; $SIP_ext =~ s/SIP\/|IAX2\/|Zap\/|Local\///gi;
$SIP_ext = $channel; $SIP_ext =~ s/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\///gi;
$number_dialed = $extension;
$extension = $SIP_ext;
@@ -461,8 +464,8 @@ sub process_request {
@aryA = $sthA->fetchrow_array;
$cmd_line_b = "$aryA[0]";
$cmd_line_d = "$aryA[1]";
$cmd_line_b =~ s/Exten: //gi;
$cmd_line_d =~ s/Channel: Local\/|@.*//gi;
$cmd_line_b =~ s/Exten: //gi;
$cmd_line_d =~ s/Channel: Local\/|@.*//gi;
$rec_count++;
}
$sthA->finish();
@@ -484,6 +487,12 @@ sub process_request {
else
{
if ($AGILOG) {$agi_string = "|CALL HUNG UP|"; &agi_output;}
$callerid =~ s/\"//gi;
$CIDlead_id = $callerid;
$CIDlead_id = substr($CIDlead_id, 11, 9);
$CIDlead_id = ($CIDlead_id + 0);
if ($request =~ /--HVcauses--/i)
{
$HVcauses=1;
@@ -497,6 +506,32 @@ sub process_request {
$ring_time = $ARGV_vars[5];
$agi_string = "URL HVcauses: |$PRI|$DEBUG|$hangup_cause|$dialstatus|$dial_time|$ring_time|";
&agi_output;
if ( (length($dialstatus) > 0) && ($callerid =~ /^V|^M/) )
{
### Grab Server values from the database
$stmtA = "SELECT carrier_logging_active 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;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
if ($aryA[0] =~ /Y/)
{$carrier_logging_active = 1;}
else
{$carrier_logging_active = 0;}
}
$sthA->finish();
if ($carrier_logging_active > 0)
{
$stmtA = "INSERT IGNORE INTO vicidial_carrier_log set uniqueid='$uniqueid',call_date='$now_date',server_ip='$VARserver_ip',lead_id='$CIDlead_id',hangup_cause='$hangup_cause',dialstatus='$dialstatus',channel='$channel',dial_time='$dial_time';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$VCARaffected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- CARRIER LOG insert: |$VCARaffected_rows|$CIDlead_id|$hangup_cause"; &agi_output;}
}
}
}
### get uniqueid and start_epoch from the call_log table
@@ -548,23 +583,23 @@ sub process_request {
}
$sthA->finish();
if ($rec_count)
{
if ($AGILOG) {$agi_string = "*****Entry found for $unique_id-$VARserver_ip in park_log: $parked_time|$grab_time"; &agi_output;}
if ($parked_time > $grab_time)
{
$parked_sec=($now_date_epoch - $parked_time);
$talked_sec=0;
}
else
{
$talked_sec=($now_date_epoch - $parked_time);
$parked_sec=($grab_time - $parked_time);
}
if ($rec_count)
{
if ($AGILOG) {$agi_string = "*****Entry found for $unique_id-$VARserver_ip in park_log: $parked_time|$grab_time"; &agi_output;}
if ($parked_time > $grab_time)
{
$parked_sec=($now_date_epoch - $parked_time);
$talked_sec=0;
}
else
{
$talked_sec=($now_date_epoch - $parked_time);
$parked_sec=($grab_time - $parked_time);
}
$stmtA = "UPDATE park_log set status='HUNGUP',hangup_time='$now_date',parked_sec='$parked_sec',talked_sec='$talked_sec' where uniqueid='$unique_id' and server_ip='$VARserver_ip'";
$affected_rows = $dbhA->do($stmtA);
}
}
##### END Park Log entry check and update #####
# $dbhA->disconnect();
@@ -579,7 +614,7 @@ sub process_request {
$VDADphone_code='';
if ($DEBUG =~ /^DEBUG$/)
{
{
### open the hangup cause out file for writing ###
open(out, ">>$PATHlogs/HANGUP_cause-output.txt")
|| die "Can't open $PATHlogs/HANGUP_cause-output.txt: $!\n";
@@ -587,24 +622,18 @@ sub process_request {
print out "$now_date|$hangup_cause|$dialstatus|$dial_time|$ring_time|$unique_id|$channel|$extension|$type|$callerid|$calleridname|$priority|\n";
close(out);
}
}
else
{
if ($AGILOG) {$agi_string = "DEBUG: $DEBUG"; &agi_output;}
}
$callerid =~ s/\"//gi;
$CIDlead_id = $callerid;
$CIDlead_id = substr($CIDlead_id, 11, 9);
$CIDlead_id = ($CIDlead_id + 0);
{
if ($AGILOG) {$agi_string = "DEBUG: $DEBUG"; &agi_output;}
}
if ($AGILOG) {$agi_string = "VD_hangup : $callerid $channel $priority $CIDlead_id"; &agi_output;}
if ($channel =~ /^Local/)
{
if ( ($PRI =~ /^PRI$/) && ($callerid =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) && ( ($dialstatus =~ /BUSY/) || ( ($dialstatus =~ /CHANUNAVAIL/) && ($hangup_cause =~ /^1$|^28$/) ) ) )
{
if ( ($PRI =~ /^PRI$/) && ($callerid =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) && ( ($dialstatus =~ /BUSY/) || ( ($dialstatus =~ /CHANUNAVAIL/) && ($hangup_cause =~ /^1$|^28$/) ) ) )
{
if ($dialstatus =~ /BUSY/) {$VDL_status = 'B'; $VDAC_status = 'BUSY';}
if ($dialstatus =~ /CHANUNAVAIL/) {$VDL_status = 'DC'; $VDAC_status = 'DISCONNECT';}
@@ -628,18 +657,17 @@ sub process_request {
sleep(1);
$dbhA->disconnect();
}
}
else
{
{
if ($AGILOG) {$agi_string = "-- VD_hangup Local DEBUG: |$PRI|$callerid|$dialstatus|$hangup_cause|"; &agi_output;}
}
}
if ($AGILOG) {$agi_string = "+++++ VDAD START LOCAL CHANNEL: EXITING- $priority"; &agi_output;}
if ($priority > 2) {sleep(1);}
}
}
else
{
{
########## FIND AND DELETE vicidial_auto_calls ##########
$VD_alt_dial = 'NONE';
$stmtA = "SELECT lead_id,callerid,campaign_id,alt_dial,stage,UNIX_TIMESTAMP(call_time),uniqueid,status FROM vicidial_auto_calls where uniqueid = '$uniqueid' or callerid = '$callerid' limit 1;";
@@ -647,7 +675,7 @@ sub process_request {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_countCUSTDATA=0;
$rec_countCUSTDATA=0;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
@@ -659,7 +687,7 @@ sub process_request {
$VD_start_epoch = "$aryA[5]";
$VD_uniqueid = "$aryA[6]";
$VD_status = "$aryA[7]";
$rec_countCUSTDATA++;
$rec_countCUSTDATA++;
}
$sthA->finish();
@@ -682,14 +710,14 @@ sub process_request {
$rec_count=0;
while ($sthArows > $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]";
$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]";
$rec_count++;
}
$sthA->finish();
##### END QUEUEMETRICS LOGGING LOOKUP #####
@@ -904,7 +932,7 @@ sub process_request {
$VD_auto_alt_dial_statuses = "$aryA[1]";
$VD_use_internal_dnc = "$aryA[2]";
$VD_use_campaign_dnc = "$aryA[3]";
$epc_countCAMPDATA++;
$epc_countCAMPDATA++;
}
$sthA->finish();
if ($VD_auto_alt_dial_statuses =~ / $VD_status | $VDL_status /)
@@ -918,7 +946,7 @@ sub process_request {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$epc_countCAMPDATA=0;
$epc_countCAMPDATA=0;
while ($sthArows > $epc_countCAMPDATA)
{
@aryA = $sthA->fetchrow_array;
@@ -927,7 +955,7 @@ sub process_request {
$VD_gmt_offset_now = "$aryA[1]";
$VD_state = "$aryA[2]";
$VD_list_id = "$aryA[3]";
$epc_countCAMPDATA++;
$epc_countCAMPDATA++;
}
$sthA->finish();
if (length($VD_alt_phone)>5)
@@ -993,7 +1021,7 @@ sub process_request {
$VD_gmt_offset_now = "$aryA[1]";
$VD_state = "$aryA[2]";
$VD_list_id = "$aryA[3]";
$epc_countCAMPDATA++;
$epc_countCAMPDATA++;
}
$sthA->finish();
if (length($VD_address3)>5)
@@ -1055,14 +1083,14 @@ sub process_request {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$epc_countCAMPDATA=0;
$epc_countCAMPDATA=0;
while ($sthArows > $epc_countCAMPDATA)
{
@aryA = $sthA->fetchrow_array;
$VD_gmt_offset_now = "$aryA[1]";
$VD_state = "$aryA[2]";
$VD_list_id = "$aryA[3]";
$epc_countCAMPDATA++;
$epc_countCAMPDATA++;
}
$sthA->finish();
$alt_dial_phones_count=0;
@@ -1172,43 +1200,42 @@ sub process_request {
###################################################################
}
}
VDfastAGI->run(
port=>4577,
user=>'root',
group=>'root',
min_servers=>$VARfastagi_log_min_servers,
max_servers=>$VARfastagi_log_max_servers,
min_spare_servers=>$VARfastagi_log_min_spare_servers,
max_spare_servers=>$VARfastagi_log_max_spare_servers,
max_requests=>$VARfastagi_log_max_requests,
check_for_dead=>$VARfastagi_log_checkfordead,
check_for_waiting=>$VARfastagi_log_checkforwait,
log_file=>$childLOGfile,
log_level=>$log_level
);
port=>4577,
user=>'root',
group=>'root',
min_servers=>$VARfastagi_log_min_servers,
max_servers=>$VARfastagi_log_max_servers,
min_spare_servers=>$VARfastagi_log_min_spare_servers,
max_spare_servers=>$VARfastagi_log_max_spare_servers,
max_requests=>$VARfastagi_log_max_requests,
check_for_dead=>$VARfastagi_log_checkfordead,
check_for_waiting=>$VARfastagi_log_checkforwait,
log_file=>$childLOGfile,
log_level=>$log_level
);
exit;
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|$process|$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|$process|$agi_string\n";
close(Lout);
}
### send to STDERR writing ###
if ( ($AGILOG == '1') || ($AGILOG == '3') )
{
print STDERR "$now_date|$script|$process|$agi_string\n";
}
$agi_string='';
}
### send to STDERR writing ###
if ( ($AGILOG == '1') || ($AGILOG == '3') )
{
print STDERR "$now_date|$script|$process|$agi_string\n";
}
$agi_string='';
}
@@ -108,7 +108,8 @@ channels_total SMALLINT(4) UNSIGNED NOT NULL default '0',
cpu_idle_percent SMALLINT(3) UNSIGNED NOT NULL default '0',
disk_usage VARCHAR(255) default '1',
sounds_update ENUM('Y','N') default 'N',
vicidial_recording_limit MEDIUMINT(8) default '60'
vicidial_recording_limit MEDIUMINT(8) default '60',
carrier_logging_active ENUM('Y','N') default 'N'
);
CREATE UNIQUE INDEX server_id on servers (server_id);
@@ -1528,6 +1529,19 @@ active ENUM('0','1') default '1',
value INT(9) default '0'
);
CREATE TABLE vicidial_carrier_log (
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
call_date DATETIME,
server_ip VARCHAR(15) NOT NULL,
lead_id INT(9) UNSIGNED,
hangup_cause TINYINT(1) UNSIGNED default '0',
dialstatus VARCHAR(16),
channel VARCHAR(100),
dial_time SMALLINT(2) UNSIGNED default '0',
index (call_date)
);
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
ALTER TABLE live_channels ENGINE=HEAP;
@@ -1633,7 +1647,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='1147';
UPDATE system_settings SET db_schema_version='1148';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

+16
View File
@@ -146,3 +146,19 @@ INSERT INTO vicidial_override_ids(id_table,active,value) values('phones','0','10
ALTER TABLE vicidial_campaigns MODIFY disable_alter_custphone ENUM('Y','N','HIDE') default 'Y';
UPDATE system_settings SET db_schema_version='1147';
CREATE TABLE vicidial_carrier_log (
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
call_date DATETIME,
server_ip VARCHAR(15) NOT NULL,
lead_id INT(9) UNSIGNED,
hangup_cause TINYINT(1) UNSIGNED default '0',
dialstatus VARCHAR(16),
channel VARCHAR(100),
dial_time SMALLINT(2) UNSIGNED default '0',
index (call_date)
);
ALTER TABLE servers ADD carrier_logging_active ENUM('Y','N') default 'N';
UPDATE system_settings SET db_schema_version='1148';
@@ -161,6 +161,8 @@ Use the HIDE option to completely remove the customer phone number from the agen
Click here to see a traffic report for this DID||
Agent Time Detail||
User Timeclock Detail Report||
Carrier Logging Active||
This setting allows you to log all hangup return codes for any outbound list dialing calls that you are placing. Default is N.||
add-file: user_territories.php
+19 -4
View File
@@ -1030,6 +1030,10 @@ if (isset($_GET["vicidial_recording_limit"])) {$vicidial_recording_limit=$_GET
elseif (isset($_POST["vicidial_recording_limit"])) {$vicidial_recording_limit=$_POST["vicidial_recording_limit"];}
if (isset($_GET["phone_context"])) {$phone_context=$_GET["phone_context"];}
elseif (isset($_POST["phone_context"])) {$phone_context=$_POST["phone_context"];}
if (isset($_GET["carrier_logging_active"])) {$carrier_logging_active=$_GET["carrier_logging_active"];}
elseif (isset($_POST["carrier_logging_active"])) {$carrier_logging_active=$_POST["carrier_logging_active"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
@@ -1281,6 +1285,7 @@ if ($non_latin < 1)
$not_interested = ereg_replace("[^NY]","",$not_interested);
$unworkable = ereg_replace("[^NY]","",$unworkable);
$sounds_update = ereg_replace("[^NY]","",$sounds_update);
$carrier_logging_active = ereg_replace("[^NY]","",$carrier_logging_active);
$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled);
@@ -1786,11 +1791,12 @@ else
# 90530-1206 - Changed List Mix to allow for 40 mixes
# 90531-1802 - Added auto-generated options for users, campaigns, in-groups, etc..., added option to HIDE custphone
# 90531-2339 - Added Dynamic options for Call Menu
# 90605-0248 - Added carrier_logging_active servers option
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.2.0-191';
$build = '90531-2339';
$admin_version = '2.2.0-192';
$build = '90605-0248';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -5034,6 +5040,13 @@ if ($SSoutbound_autodial_active > 0)
<BR>
<B>ViciDial Recording Limit -</B> This field is where you set the maximum number of minutes that a call recording initiated by ViciDial can be. Default is 60 minutes.
<BR>
<A NAME="servers-carrier_logging_active">
<BR>
<B>Carrier Logging Active -</B> This setting allows you to log all hangup return codes for any outbound list dialing calls that you are placing. Default is N.
@@ -11851,7 +11864,7 @@ if ($ADD==411111111111)
{
echo "<br>SERVER MODIFIED: $server_ip\n";
$stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit' where server_id='$old_server_id';";
$stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit',carrier_logging_active='$carrier_logging_active' where server_id='$old_server_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';";
@@ -19046,7 +19059,7 @@ if ($ADD==311111111111)
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit from servers where server_id='$server_id' or server_ip='$server_ip';";
$stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active from servers where server_id='$server_id' or server_ip='$server_ip';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$server_id = $row[0];
@@ -19083,6 +19096,7 @@ if ($ADD==311111111111)
$disk_usage = $row[31];
$sounds_update = $row[32];
$vicidial_recording_limit = $row[33];
$carrier_logging_active = $row[34];
$cpu = (100 - $cpu_idle_percent);
$disk_usage = preg_replace("/ /"," - ",$disk_usage);
@@ -19121,6 +19135,7 @@ if ($ADD==311111111111)
echo "<tr bgcolor=#B6D3FC><td align=right>System Performance: </td><td align=left><select size=1 name=sys_perf_log><option>Y</option><option>N</option><option selected>$sys_perf_log</option></select>$NWB#servers-sys_perf_log$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Server Logs: </td><td align=left><select size=1 name=vd_server_logs><option>Y</option><option>N</option><option selected>$vd_server_logs</option></select>$NWB#servers-vd_server_logs$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>AGI Output: </td><td align=left><select size=1 name=agi_output><option>NONE</option><option>STDERR</option><option>FILE</option><option>BOTH</option><option selected>$agi_output</option></select>$NWB#servers-agi_output$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Logging Active: </td><td align=left><select size=1 name=carrier_logging_active><option>Y</option><option>N</option><option selected>$carrier_logging_active</option></select>$NWB#servers-carrier_logging_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Recording Web Link: </td><td align=left><select size=1 name=recording_web_link><option>SERVER_IP</option><option>ALT_IP</option><option selected>$recording_web_link</option></select>$NWB#servers-recording_web_link$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Alternate Recording Server IP: </td><td align=left><input type=text name=alt_server_ip size=30 maxlength=100 value=\"$alt_server_ip\">$NWB#servers-alt_server_ip$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active Asterisk Server: </td><td align=left><select size=1 name=active_asterisk_server><option>Y</option><option>N</option><option selected>$active_asterisk_server</option></select>$NWB#servers-active_asterisk_server$NWE</td></tr>\n";