Added Call Card minute balance feature set, see CALLCARD.txt for more info
git-svn-id: svn://192.168.202.10@1367 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -79,6 +79,11 @@ OTHER CHANGES:
|
|||||||
interface options in a separate file so that they can be preserved
|
interface options in a separate file so that they can be preserved
|
||||||
through an upgrade. See options-example.php for more information
|
through an upgrade. See options-example.php for more information
|
||||||
|
|
||||||
|
17. Added CallCard featureset to allow for pin-number entry before entering an
|
||||||
|
In-Group by a customer with minute balances and a basic admin interface.
|
||||||
|
See the CALLCARD.txt doc for more information.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
# user is prompted for their passcode then press #
|
# user is prompted for their passcode then press #
|
||||||
# then the user is forwarded to the active vicidial agent session
|
# then the user is forwarded to the active vicidial agent session
|
||||||
#
|
#
|
||||||
|
# can be added as an AGI to a Call Menu, or as below:
|
||||||
# ;agent dial-in:
|
# ;agent dial-in:
|
||||||
#exten => 2345,1,Answer ; Answer the line
|
#exten => 2345,1,Answer ; Answer the line
|
||||||
#exten => 2345,2,AGI(agi-AGENT_dial_in.agi)
|
#exten => 2345,2,AGI(agi-AGENT_dial_in.agi)
|
||||||
|
|||||||
@@ -0,0 +1,477 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# agi-CALLCARD_dial_in.agi version 0.1
|
||||||
|
#
|
||||||
|
# This script is designed to allow customers the ability to dial in to a DID and
|
||||||
|
# enter in a PIN number that would look up their account and send on to a
|
||||||
|
# specified in-group if pin is valid
|
||||||
|
#
|
||||||
|
# user is prompted for their PIN number only (no pound '#' required)
|
||||||
|
# then the user is forwarded to the active vicidial agent session
|
||||||
|
#
|
||||||
|
# can be added as an AGI to a Call Menu, or as below:
|
||||||
|
# Call Menu Entry: "agi-CALLCARD_dial_in.agi,en---3---callcard_pin_enter---callcard_pin_invalid---default"
|
||||||
|
# ;agent dial-in:
|
||||||
|
#exten => 2346,1,Answer ; Answer the line
|
||||||
|
#exten => 2346,2,AGI(agi-CALLCARD_dial_in.agi,en---3---callcard_pin_enter---callcard_pin_invalid---default)
|
||||||
|
#exten => 2346,3,Hangup
|
||||||
|
#
|
||||||
|
# ; Below are the parameters needed for the script to be run properly
|
||||||
|
# ; 1. language
|
||||||
|
# ; - en - English <default>
|
||||||
|
# ; - es - Spanish
|
||||||
|
# ; 2. maximum attempts before hangup:
|
||||||
|
# ; - 3 <default>
|
||||||
|
# ; 3. audio file enter pin number prompt:
|
||||||
|
# ; - callcard_pin_enter <default>
|
||||||
|
# ; 4. audio file invalid pin number prompt:
|
||||||
|
# ; - callcard_pin_invalid <default>
|
||||||
|
# ; 5. DID pattern to use for in-group forwarding settings:
|
||||||
|
# ; - default <default>
|
||||||
|
# ; - USE-ORIGINATING-DID - this option will look up the DID the customer dialed in on and use those settings
|
||||||
|
#
|
||||||
|
# other audio files used:
|
||||||
|
# - pin-number-accepted
|
||||||
|
# - vm-youhave
|
||||||
|
# - callcard_minutes_left
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
|
#
|
||||||
|
# CHANGELOG
|
||||||
|
# 100311-1135 - First build
|
||||||
|
#
|
||||||
|
|
||||||
|
&get_time_now;
|
||||||
|
$start_epoch = $now_date_epoch;
|
||||||
|
|
||||||
|
$script = 'agi-CALLCARD_dial_in.agi';
|
||||||
|
|
||||||
|
$now_date_epoch = time();
|
||||||
|
$now_date = "$year-$mon-$mday $hour:$min:$sec";
|
||||||
|
|
||||||
|
($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) {$hour = "0$hour";}
|
||||||
|
if ($min < 10) {$min = "0$min";}
|
||||||
|
if ($sec < 10) {$sec = "0$sec";}
|
||||||
|
|
||||||
|
$US='_';
|
||||||
|
|
||||||
|
|
||||||
|
# default path to astguiclient configuration file:
|
||||||
|
$PATHconf = '/etc/astguiclient.conf';
|
||||||
|
|
||||||
|
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
|
||||||
|
@conf = <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/ivrout.$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;
|
||||||
|
|
||||||
|
# defaults:
|
||||||
|
$language = 'en';
|
||||||
|
$maximum_attempts = '3';
|
||||||
|
$pin_enter_audio = 'callcard_pin_enter';
|
||||||
|
$pin_invalid_audio = 'callcard_pin_invalid';
|
||||||
|
$did_ingroup_settings = 'default';
|
||||||
|
|
||||||
|
### 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++;
|
||||||
|
}
|
||||||
|
|
||||||
|
### list of command-line array arguments:
|
||||||
|
@ARGV_vars = split(/---/, $ARGV[0]);
|
||||||
|
|
||||||
|
if (length($ARGV_vars[0]) > 0) {$language = $ARGV_vars[0];}
|
||||||
|
if (length($ARGV_vars[1]) > 0) {$maximum_attempts = $ARGV_vars[1];}
|
||||||
|
if (length($ARGV_vars[2]) > 0) {$pin_enter_audio = $ARGV_vars[2];}
|
||||||
|
if (length($ARGV_vars[3]) > 0) {$pin_invalid_audio = $ARGV_vars[3];}
|
||||||
|
if (length($ARGV_vars[4]) > 0) {$did_ingroup_settings = $ARGV_vars[4];}
|
||||||
|
}
|
||||||
|
if ($language =~ /es/) {$audio_suffix='_es';}
|
||||||
|
else {$audio_suffix='';}
|
||||||
|
|
||||||
|
|
||||||
|
$|=1;
|
||||||
|
while(<STDIN>)
|
||||||
|
{
|
||||||
|
chomp;
|
||||||
|
last unless length($_);
|
||||||
|
if ($V)
|
||||||
|
{
|
||||||
|
if (/^agi_(\w+)\:\s+(.*)$/)
|
||||||
|
{
|
||||||
|
$AGI{$1} = $2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (/^agi_uniqueid\:\s+(.*)$/) {$unique_id = $1; $uniqueid=$unique_id}
|
||||||
|
if (/^agi_extension\:\s+(.*)$/) {$extension = $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;}
|
||||||
|
$phone_number=$callerid;
|
||||||
|
|
||||||
|
### Grab Server values from the database
|
||||||
|
$stmtA = "SELECT ext_context,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)
|
||||||
|
{
|
||||||
|
@aryA = $sthA->fetchrow_array;
|
||||||
|
$DBext_context = "$aryA[0]";
|
||||||
|
$DBagi_output = "$aryA[1]";
|
||||||
|
if ($DBext_context) {$ext_context = $DBext_context;}
|
||||||
|
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||||
|
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||||
|
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||||
|
$rec_count++;
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$AGI->stream_file('sip-silence');
|
||||||
|
$AGI->stream_file('sip-silence');
|
||||||
|
$AGI->stream_file('sip-silence');
|
||||||
|
|
||||||
|
|
||||||
|
$entry_chances=0;
|
||||||
|
$VALID_login=0;
|
||||||
|
$ACTIVE_login=0;
|
||||||
|
$VDADremDIALstr='';
|
||||||
|
while ( ($entry_chances < $maximum_attempts) && ($VALID_login < 1) )
|
||||||
|
{
|
||||||
|
$entry_chances++;
|
||||||
|
|
||||||
|
|
||||||
|
&user_password_gather;
|
||||||
|
|
||||||
|
|
||||||
|
###### Check userID and password against vicidial_users table
|
||||||
|
$stmtA = "SELECT count(*) FROM callcard_accounts where pin='$PIN_number' and status IN('ACTIVE','USED') and balance_minutes > 0;";
|
||||||
|
$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;
|
||||||
|
$VALID_login = $aryA[0];
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
if ($AGILOG) {$agi_string = "validate PIN: |$VALID_login|$stmtA|"; &agi_output;}
|
||||||
|
|
||||||
|
|
||||||
|
if ($VALID_login > 0)
|
||||||
|
{
|
||||||
|
$AGI->stream_file("pin-number-accepted$audio_suffix");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$AGI->stream_file("$pin_invalid_audio$audio_suffix");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($VALID_login < 1)
|
||||||
|
{
|
||||||
|
if ($AGILOG) {$agi_string = "DIAL-IN END: Invalid Pin |$VALID_login|$PIN_number|"; &agi_output;}
|
||||||
|
|
||||||
|
$AGI->stream_file("vm-goodbye$audio_suffix");
|
||||||
|
|
||||||
|
$AGI->hangup();
|
||||||
|
|
||||||
|
$dbhA->disconnect();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$secX = time();
|
||||||
|
$PDtarget = ($secX - 30);
|
||||||
|
($Psec,$Pmin,$Phour,$Pmday,$Pmon,$Pyear,$Pwday,$Pyday,$Pisdst) = localtime($PDtarget);
|
||||||
|
$Pyear = ($Pyear + 1900);
|
||||||
|
$Pmon++;
|
||||||
|
if ($Pmon < 10) {$Pmon = "0$Pmon";}
|
||||||
|
if ($Pmday < 10) {$Pmday = "0$Pmday";}
|
||||||
|
if ($Phour < 10) {$Phour = "0$Phour";}
|
||||||
|
if ($Pmin < 10) {$Pmin = "0$Pmin";}
|
||||||
|
if ($Psec < 10) {$Psec = "0$Psec";}
|
||||||
|
$PDtsSQLdate = "$Pyear$Pmon$Pmday$Phour$Pmin$Psec";
|
||||||
|
|
||||||
|
|
||||||
|
###### Check for the current minute balance to play back to the customer in the callcard_accounts table
|
||||||
|
$stmtA = "SELECT card_id,balance_minutes,inbound_group_id FROM callcard_accounts where pin='$PIN_number';";
|
||||||
|
$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;
|
||||||
|
$card_id = $aryA[0];
|
||||||
|
$balance_minutes = $aryA[1];
|
||||||
|
$inbound_group_id = $aryA[2];
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
|
||||||
|
###### Check for the current minute balance to play back to the customer in the callcard_accounts table
|
||||||
|
$stmtA = "SELECT vdl.did_id,did_pattern FROM vicidial_did_log vdl, vicidial_inbound_dids vid where uniqueid='$uniqueid' and vdl.did_id=vid.did_id order by call_date desc limit 1;";
|
||||||
|
$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;
|
||||||
|
$original_did_pattern = $aryA[1];
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
|
||||||
|
if ($did_ingroup_settings =~ /USE-ORIGINATING-DID/)
|
||||||
|
{$did_id_search = $original_did_pattern;}
|
||||||
|
else
|
||||||
|
{$did_id_search = $did_ingroup_settings;}
|
||||||
|
$did_id=0;
|
||||||
|
###### find the in-group settings to use when forwarding this call
|
||||||
|
$stmtA = "SELECT did_id FROM vicidial_inbound_dids where did_pattern='$did_id_search';";
|
||||||
|
$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;
|
||||||
|
$did_id = $aryA[0];
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
|
||||||
|
##### play customer's balance to them before transferring
|
||||||
|
$AGI->stream_file("vm-youhave$audio_suffix");
|
||||||
|
if ($language=='es')
|
||||||
|
{$AGI->stream_file("$balance_minutes$audio_suffix");}
|
||||||
|
else
|
||||||
|
{$AGI->say_number("$balance_minutes");}
|
||||||
|
$AGI->stream_file("callcard_minutes_left$audio_suffix");
|
||||||
|
|
||||||
|
|
||||||
|
##### update callcard_accounts_detail record for this account
|
||||||
|
$stmtA = "UPDATE callcard_accounts_detail set used_time='$now_date' where card_id='$card_id';";
|
||||||
|
$affected_rows = $dbhA->do($stmtA);
|
||||||
|
if ($AGILOG) {$agi_string = "callcard_accounts_detail update: |$affected_rows|$now_date|$card_id|"; &agi_output;}
|
||||||
|
|
||||||
|
##### insert callcard_log record for this call
|
||||||
|
$stmtA = "INSERT INTO callcard_log set uniqueid='$uniqueid',card_id='$card_id',call_time='$now_date',phone_number='$phone_number',inbound_did='$original_did_pattern',balance_minutes_start='$balance_minutes';";
|
||||||
|
$affected_rows = $dbhA->do($stmtA);
|
||||||
|
if ($AGILOG) {$agi_string = "callcard_log INSERT: |$affected_rows|$stmtA|"; &agi_output;}
|
||||||
|
|
||||||
|
|
||||||
|
### format the remote server dialstring to get the call to the overflow agent meetme room
|
||||||
|
$forward_extension = "99909*$did_id*$inbound_group_id";
|
||||||
|
|
||||||
|
if ($AGILOG) {$agi_string = "Customer $PIN_number sent to $forward_extension"; &agi_output;}
|
||||||
|
|
||||||
|
print "SET CONTEXT $ext_context\n";
|
||||||
|
checkresult($result);
|
||||||
|
print "SET EXTENSION $forward_extension\n";
|
||||||
|
checkresult($result);
|
||||||
|
print "SET PRIORITY 1\n";
|
||||||
|
checkresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$dbhA->disconnect();
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
##### SUBROUTINES ##############################################################
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
##### BEGIN collect the pin number ######################################
|
||||||
|
sub user_password_gather
|
||||||
|
{
|
||||||
|
################################################################################
|
||||||
|
# please enter the pin number followed by the pound key
|
||||||
|
|
||||||
|
$interrupt_digit='';
|
||||||
|
|
||||||
|
$interrupt_digit = $AGI->stream_file("$pin_enter_audio$audio_suffix",'0123456789');
|
||||||
|
|
||||||
|
print STDERR "interrupt_digit |$interrupt_digit|\n";
|
||||||
|
|
||||||
|
$digits_being_entered=1;
|
||||||
|
$PIN_number='';
|
||||||
|
if ($interrupt_digit > 0)
|
||||||
|
{
|
||||||
|
# if ($interrupt_digit == 35) {$interrupt_digit='#';}
|
||||||
|
# if ($interrupt_digit == 42) {$interrupt_digit='*';}
|
||||||
|
if ($interrupt_digit == 48) {$interrupt_digit=0;}
|
||||||
|
if ($interrupt_digit == 49) {$interrupt_digit=1;}
|
||||||
|
if ($interrupt_digit == 50) {$interrupt_digit=2;}
|
||||||
|
if ($interrupt_digit == 51) {$interrupt_digit=3;}
|
||||||
|
if ($interrupt_digit == 52) {$interrupt_digit=4;}
|
||||||
|
if ($interrupt_digit == 53) {$interrupt_digit=5;}
|
||||||
|
if ($interrupt_digit == 54) {$interrupt_digit=6;}
|
||||||
|
if ($interrupt_digit == 55) {$interrupt_digit=7;}
|
||||||
|
if ($interrupt_digit == 56) {$interrupt_digit=8;}
|
||||||
|
if ($interrupt_digit == 57) {$interrupt_digit=9;}
|
||||||
|
|
||||||
|
$PIN_number=$interrupt_digit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$digit_loop_counter=0;
|
||||||
|
while ( ($digits_being_entered > 0) && ($digit_loop_counter < 8) )
|
||||||
|
{
|
||||||
|
$digit = chr($AGI->wait_for_digit('10000')); # wait 10 seconds for input, until the pound key is pressed or 8 digits
|
||||||
|
if ($digit =~ /\d/)
|
||||||
|
{
|
||||||
|
$PIN_number = "$PIN_number$digit";
|
||||||
|
print STDERR "digit |$digit| PIN_number |$PIN_number|\n";
|
||||||
|
# $AGI->say_digits("$digit");
|
||||||
|
undef $digit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$digits_being_entered=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$digit_loop_counter++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$PIN_number =~ s/\D//gi;
|
||||||
|
if ($PIN_number) {print STDERR "digit collection done|$digit| PIN_number |$PIN_number|\n";}
|
||||||
|
}
|
||||||
|
##### END collect the pin number ###############################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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) {$hour = "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 checkresult
|
||||||
|
{
|
||||||
|
my ($res) = @_;
|
||||||
|
my $retval;
|
||||||
|
$tests++;
|
||||||
|
chomp $res;
|
||||||
|
if ($res =~ /^200/) {
|
||||||
|
$res =~ /result=(-?\d+)/;
|
||||||
|
if (!length($1))
|
||||||
|
{
|
||||||
|
print STDERR "FAIL ($res)\n";
|
||||||
|
$fail++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print STDERR "PASS ($1)\n";
|
||||||
|
$pass++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print STDERR "FAIL (unexpected result '$res')\n";
|
||||||
|
$fail++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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='';
|
||||||
|
}
|
||||||
|
|
||||||
|
sub leading_zero($)
|
||||||
|
{
|
||||||
|
$_ = $_[0];
|
||||||
|
s/^(\d)$/0$1/;
|
||||||
|
s/^(\d\d)$/0$1/;
|
||||||
|
return $_;
|
||||||
|
} # End of the leading_zero() routine.
|
||||||
@@ -314,6 +314,7 @@ if ($extension =~ /^999\d\d\*/)
|
|||||||
|
|
||||||
$referring_extension = $EXT_vars[0]; # initial extension sent
|
$referring_extension = $EXT_vars[0]; # initial extension sent
|
||||||
$did_id = $EXT_vars[1]; # the DID ID to grab settings from
|
$did_id = $EXT_vars[1]; # the DID ID to grab settings from
|
||||||
|
$in_group_override = $EXT_vars[2]; # the in-group override, if set
|
||||||
|
|
||||||
### Grab DID values from the database
|
### Grab DID values from the database
|
||||||
$stmtA = "SELECT call_handle_method,agent_search_method,group_id,did_pattern,list_id,phone_code,campaign_id,user,user_unavailable_action,user_route_settings_ingroup,did_route,voicemail_ext,extension,exten_context,phone,server_ip FROM vicidial_inbound_dids where did_id = '$did_id';";
|
$stmtA = "SELECT call_handle_method,agent_search_method,group_id,did_pattern,list_id,phone_code,campaign_id,user,user_unavailable_action,user_route_settings_ingroup,did_route,voicemail_ext,extension,exten_context,phone,server_ip FROM vicidial_inbound_dids where did_id = '$did_id';";
|
||||||
@@ -346,6 +347,30 @@ if ($extension =~ /^999\d\d\*/)
|
|||||||
{$channel_group = $did_in_group;}
|
{$channel_group = $did_in_group;}
|
||||||
}
|
}
|
||||||
$sthA->finish();
|
$sthA->finish();
|
||||||
|
|
||||||
|
if (length($in_group_override) > 1)
|
||||||
|
{
|
||||||
|
$igo_valid=0;
|
||||||
|
### if in_group_override is set, make sure it's valid
|
||||||
|
$stmtA = "SELECT count(*) FROM vicidial_inbound_groups where group_id='$in_group_override' 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;
|
||||||
|
$igo_valid = $aryA[0];
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
|
||||||
|
if ($igo_valid > 0)
|
||||||
|
{
|
||||||
|
$channel_group = $in_group_override;
|
||||||
|
if ($AGILOG) {$agi_string = "In-Group Override: $in_group_override"; &agi_output;}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($call_handle_method =~ /^CLOSER/)
|
if ($call_handle_method =~ /^CLOSER/)
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
# 91205-2315 - Added delete_vm_after_email option to voicemail conf generation
|
# 91205-2315 - Added delete_vm_after_email option to voicemail conf generation
|
||||||
# 100220-1410 - Added System Settings and Servers custom dialplan entries
|
# 100220-1410 - Added System Settings and Servers custom dialplan entries
|
||||||
# 100225-2020 - Change voicemail configuration to use voicemail.conf
|
# 100225-2020 - Change voicemail configuration to use voicemail.conf
|
||||||
|
# 100312-1012 - Changed TIMEOUT Call Menu function to work with AGI routes
|
||||||
#
|
#
|
||||||
|
|
||||||
$DB=0; # Debug flag
|
$DB=0; # Debug flag
|
||||||
@@ -1656,6 +1657,15 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
|||||||
else
|
else
|
||||||
{$menu_prompt_ext .= "exten => s,n,Background($menu_prompt[$i])\n";}
|
{$menu_prompt_ext .= "exten => s,n,Background($menu_prompt[$i])\n";}
|
||||||
|
|
||||||
|
if ($time_check_route =~ /AGI/)
|
||||||
|
{
|
||||||
|
$call_menu_options_ext .= "; time check after hours AGI special extension\n";
|
||||||
|
$call_menu_options_ext .= "exten => 9999999999999999999988,1,AGI($time_check_route_value)\n";
|
||||||
|
|
||||||
|
$time_check_route = 'EXTENSION';
|
||||||
|
$time_check_route_value = '9999999999999999999988';
|
||||||
|
$time_check_route_context = $menu_id[$i];
|
||||||
|
}
|
||||||
$call_menu_ext .= "\n";
|
$call_menu_ext .= "\n";
|
||||||
$call_menu_ext .= "; $menu_name[$i]\n";
|
$call_menu_ext .= "; $menu_name[$i]\n";
|
||||||
$call_menu_ext .= "[$menu_id[$i]]\n";
|
$call_menu_ext .= "[$menu_id[$i]]\n";
|
||||||
|
|||||||
@@ -0,0 +1,620 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# AST_call_log_export.pl version: 2.4
|
||||||
|
#
|
||||||
|
# This script is designed to gather basic call logs for a VICIDIAL Outbound calling campaigns and
|
||||||
|
# post them to a directory. This script is a little different from other report
|
||||||
|
# scripts in that it will use the "processed" fields in the vicidial_log and
|
||||||
|
# vicidial_agent_log tables to keep track of the records that it has output.
|
||||||
|
#
|
||||||
|
# /usr/share/astguiclient/AST_call_log_export.pl --campaign=GOODB-GROUP1-GROUP3-GROUP4-SPECIALS-DNC_BEDS --output-format=tab-basic --debug --filename=BEDSsaleDATETIME.txt --email-list=test@gmail.com --email-sender=test@test.com
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
|
#
|
||||||
|
# CHANGES
|
||||||
|
# 100310-0112 - First version
|
||||||
|
#
|
||||||
|
|
||||||
|
$txt = '.txt';
|
||||||
|
$US = '_';
|
||||||
|
$MT[0] = '';
|
||||||
|
$Q=0;
|
||||||
|
$DB=0;
|
||||||
|
$uniqueidLIST='|';
|
||||||
|
$dateset=0;
|
||||||
|
|
||||||
|
# Default FTP account variables
|
||||||
|
$VARREPORT_host = '10.0.0.4';
|
||||||
|
$VARREPORT_user = 'cron';
|
||||||
|
$VARREPORT_pass = 'test';
|
||||||
|
$VARREPORT_port = '21';
|
||||||
|
$VARREPORT_dir = 'REPORTS';
|
||||||
|
|
||||||
|
# default CLI values
|
||||||
|
$campaign = 'TESTCAMP';
|
||||||
|
$output_format = 'tab-basic';
|
||||||
|
|
||||||
|
$secX = time();
|
||||||
|
$time = $secX;
|
||||||
|
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
||||||
|
$year = ($year + 1900);
|
||||||
|
$yy = ($year - 2000);
|
||||||
|
$mon++;
|
||||||
|
if ($mon < 10) {$mon = "0$mon";}
|
||||||
|
if ($mday < 10) {$mday = "0$mday";}
|
||||||
|
if ($hour < 10) {$hour = "0$hour";}
|
||||||
|
if ($min < 10) {$min = "0$min";}
|
||||||
|
if ($sec < 10) {$sec = "0$sec";}
|
||||||
|
$timestamp = "$year-$mon-$mday $hour:$min:$sec";
|
||||||
|
$filedate = "$year$mon$mday";
|
||||||
|
$filedatetime = "$year$mon$mday$hour$min$sec";
|
||||||
|
$ABIfiledate = "$mon-$mday-$year$us$hour$min$sec";
|
||||||
|
$shipdate = "$year-$mon-$mday";
|
||||||
|
$start_date = "$year$mon$mday";
|
||||||
|
$datestamp = "$year/$mon/$mday $hour:$min";
|
||||||
|
|
||||||
|
|
||||||
|
use Time::Local;
|
||||||
|
|
||||||
|
### find epoch of 2AM today
|
||||||
|
$TWOAMsec = ( ($secX - ($sec + ($min * 60) + ($hour * 3600) ) ) + 7200);
|
||||||
|
### find epoch of 2AM yesterday
|
||||||
|
$TWOAMsecY = ($TWOAMsec - 86400);
|
||||||
|
|
||||||
|
($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TWOAMsecY);
|
||||||
|
$Tyear = ($Tyear + 1900);
|
||||||
|
$Tmon++;
|
||||||
|
if ($Tmon < 10) {$Tmon = "0$Tmon";}
|
||||||
|
if ($Tmday < 10) {$Tmday = "0$Tmday";}
|
||||||
|
if ($Thour < 10) {$Thour = "0$Thour";}
|
||||||
|
if ($Tmin < 10) {$Tmin = "0$Tmin";}
|
||||||
|
if ($Tsec < 10) {$Tsec = "0$Tsec";}
|
||||||
|
|
||||||
|
|
||||||
|
### begin parsing run-time options ###
|
||||||
|
if (length($ARGV[0])>1)
|
||||||
|
{
|
||||||
|
$i=0;
|
||||||
|
while ($#ARGV >= $i)
|
||||||
|
{
|
||||||
|
$args = "$args $ARGV[$i]";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($args =~ /--help/i)
|
||||||
|
{
|
||||||
|
print "allowed run time options:\n";
|
||||||
|
print " [--date=YYYY-MM-DD] = date override, otherwise will use processed=N\n";
|
||||||
|
print " [--hour-offset=X] = print datetime strings with this hour offset\n";
|
||||||
|
print " [--filename=XXX] = Name to be used for file\n";
|
||||||
|
print " [--campaign=XXX] = Campaign that sales will be pulled from\n";
|
||||||
|
print " [--without-camp=XXX] = Campaign that will be excluded from ALL\n";
|
||||||
|
print " [--output-format=XXX] = Format of file. Default \"pipe-standard\"\n";
|
||||||
|
print " [--ftp-transfer] = Send results file by FTP to another server\n";
|
||||||
|
print " [--email-list=test@test.com:test2@test.com] = send email results to these addresses\n";
|
||||||
|
print " [--email-sender=vicidial@localhost] = sender for the email results\n";
|
||||||
|
print " [--quiet] = quiet\n";
|
||||||
|
print " [--test] = test\n";
|
||||||
|
print " [--debug] = debugging messages\n";
|
||||||
|
print " [--debugX] = Super debugging messages\n";
|
||||||
|
print "\n";
|
||||||
|
print " format options:\n";
|
||||||
|
print " tab-basic:\n";
|
||||||
|
print " call_date phone_number vendor_id status user first_name last_name lead_id list_id campaign_id length_in_sec source_id\n";
|
||||||
|
print " pipe-basic:\n";
|
||||||
|
print " call_date|phone_number|vendor_id|status|user|first_name|last_name|lead_id|list_id|campaign_id|length_in_sec|source_id|\n";
|
||||||
|
print "\n";
|
||||||
|
|
||||||
|
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($args =~ /--debug/i)
|
||||||
|
{
|
||||||
|
$DB=1;
|
||||||
|
print "\n----- DEBUG MODE -----\n\n";
|
||||||
|
}
|
||||||
|
if ($args =~ /--debugX/i)
|
||||||
|
{
|
||||||
|
$DBX=1;
|
||||||
|
print "\n----- SUPER DEBUG MODE -----\n\n";
|
||||||
|
}
|
||||||
|
if ($args =~ /-quiet/i)
|
||||||
|
{
|
||||||
|
$q=1; $Q=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($args =~ /--hour-offset=/i)
|
||||||
|
{
|
||||||
|
@data_in = split(/--hour-offset=/,$args);
|
||||||
|
$hour_offset = $data_in[1];
|
||||||
|
$hour_offset =~ s/ .*//gi;
|
||||||
|
if (!$Q) {print "\n----- HOUR OFFSET: $hour_offset -----\n\n";}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{$hour_offset=0;}
|
||||||
|
if ($args =~ /--date=/i)
|
||||||
|
{
|
||||||
|
@data_in = split(/--date=/,$args);
|
||||||
|
$shipdate = $data_in[1];
|
||||||
|
$shipdate =~ s/ .*//gi;
|
||||||
|
if ($shipdate =~ /today/)
|
||||||
|
{
|
||||||
|
$shipdate="$year-$mon-$mday";
|
||||||
|
$time = $TWOAMsec;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($shipdate =~ /yesterday/)
|
||||||
|
{
|
||||||
|
$shipdate="$Tyear-$Tmon-$Tmday";
|
||||||
|
$year = $Tyear;
|
||||||
|
$mon = $Tmon;
|
||||||
|
$mday = $Tmday;
|
||||||
|
$time=$TWOAMsecY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@cli_date = split("-",$shipdate);
|
||||||
|
$year = $cli_date[0];
|
||||||
|
$mon = $cli_date[1];
|
||||||
|
$mday = $cli_date[2];
|
||||||
|
$cli_date[1] = ($cli_date[1] - 1);
|
||||||
|
$time = timelocal(0,0,2,$cli_date[2],$cli_date[1],$cli_date[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$Q) {print "\n----- DATE OVERRIDE: $shipdate -----\n\n";}
|
||||||
|
$dateset=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$time=$TWOAMsec;
|
||||||
|
$dateset=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($args =~ /--campaign=/i)
|
||||||
|
{
|
||||||
|
# print "\n|$ARGS|\n\n";
|
||||||
|
@data_in = split(/--campaign=/,$args);
|
||||||
|
$campaign = $data_in[1];
|
||||||
|
$campaign =~ s/ .*$//gi;
|
||||||
|
$campaignSQL = $campaign;
|
||||||
|
if ($campaignSQL =~ /-/)
|
||||||
|
{
|
||||||
|
$campaignSQL =~ s/-/','/gi;
|
||||||
|
}
|
||||||
|
$campaignSQL = "'$campaignSQL'";
|
||||||
|
}
|
||||||
|
if ($args =~ /--without-camp=/i)
|
||||||
|
{
|
||||||
|
# print "\n|$ARGS|\n\n";
|
||||||
|
@data_in = split(/--without-camp=/,$args);
|
||||||
|
$NOTcampaign = $data_in[1];
|
||||||
|
$NOTcampaign =~ s/ .*$//gi;
|
||||||
|
$NOTcampaignSQL = $NOTcampaign;
|
||||||
|
if ($NOTcampaignSQL =~ /-/)
|
||||||
|
{
|
||||||
|
$NOTcampaignSQL =~ s/-/','/gi;
|
||||||
|
}
|
||||||
|
$NOTcampaignSQL = "'$NOTcampaignSQL'";
|
||||||
|
}
|
||||||
|
if ($args =~ /--filename=/i)
|
||||||
|
{
|
||||||
|
# print "\n|$ARGS|\n\n";
|
||||||
|
@data_in = split(/--filename=/,$args);
|
||||||
|
$yy = ($year - 2000);
|
||||||
|
$filename = $data_in[1];
|
||||||
|
$filename =~ s/ .*$//gi;
|
||||||
|
$filename =~ s/YYYY/$year/gi;
|
||||||
|
$filename =~ s/MM/$mon/gi;
|
||||||
|
$filename =~ s/DD/$mday/gi;
|
||||||
|
$filename =~ s/DATETIME/$year$mon$mday$hour$min$sec/gi;
|
||||||
|
$filename =~ s/DATESPEC/$yy$mon$mday-$hour$min$sec/gi;
|
||||||
|
$filename_override=1;
|
||||||
|
}
|
||||||
|
if ($args =~ /--output-format=/i)
|
||||||
|
{
|
||||||
|
@data_in = split(/--output-format=/,$args);
|
||||||
|
$output_format = $data_in[1];
|
||||||
|
$output_format =~ s/ .*$//gi;
|
||||||
|
}
|
||||||
|
if ($args =~ /-ftp-transfer/i)
|
||||||
|
{
|
||||||
|
if (!$Q)
|
||||||
|
{print "\n----- FTP TRANSFER MODE -----\n\n";}
|
||||||
|
$ftp_transfer=1;
|
||||||
|
}
|
||||||
|
if ($args =~ /--test/i)
|
||||||
|
{
|
||||||
|
$T=1; $TEST=1;
|
||||||
|
if (!$Q) {print "\n----- TESTING -----\n\n";}
|
||||||
|
}
|
||||||
|
if ($args =~ /--email-list=/i)
|
||||||
|
{
|
||||||
|
@data_in = split(/--email-list=/,$args);
|
||||||
|
$email_list = $data_in[1];
|
||||||
|
$email_list =~ s/ .*//gi;
|
||||||
|
$email_list =~ s/:/,/gi;
|
||||||
|
if (!$Q) {print "\n----- EMAIL NOTIFICATION: $email_list -----\n\n";}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{$email_list = '';}
|
||||||
|
|
||||||
|
if ($args =~ /--email-sender=/i)
|
||||||
|
{
|
||||||
|
@data_in = split(/--email-sender=/,$args);
|
||||||
|
$email_sender = $data_in[1];
|
||||||
|
$email_sender =~ s/ .*//gi;
|
||||||
|
$email_sender =~ s/:/,/gi;
|
||||||
|
if (!$Q) {print "\n----- EMAIL NOTIFICATION SENDER: $email_sender -----\n\n";}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{$email_sender = 'vicidial@localhost';}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "no command line options set, using defaults.\n";
|
||||||
|
}
|
||||||
|
### end parsing run-time options ###
|
||||||
|
|
||||||
|
# default path to astguiclient configuration file:
|
||||||
|
$PATHconf = '/etc/astguiclient.conf';
|
||||||
|
|
||||||
|
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
|
||||||
|
@conf = <conf>;
|
||||||
|
close(conf);
|
||||||
|
$i=0;
|
||||||
|
foreach(@conf)
|
||||||
|
{
|
||||||
|
$line = $conf[$i];
|
||||||
|
$line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi;
|
||||||
|
if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) )
|
||||||
|
{$PATHhome = $line; $PATHhome =~ s/.*=//gi;}
|
||||||
|
if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) )
|
||||||
|
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
|
||||||
|
if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) )
|
||||||
|
{$PATHagi = $line; $PATHagi =~ s/.*=//gi;}
|
||||||
|
if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) )
|
||||||
|
{$PATHweb = $line; $PATHweb =~ 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;}
|
||||||
|
if ( ($line =~ /^VARREPORT_host/) && ($CLIREPORT_host < 1) )
|
||||||
|
{$VARREPORT_host = $line; $VARREPORT_host =~ s/.*=//gi;}
|
||||||
|
if ( ($line =~ /^VARREPORT_user/) && ($CLIREPORT_user < 1) )
|
||||||
|
{$VARREPORT_user = $line; $VARREPORT_user =~ s/.*=//gi;}
|
||||||
|
if ( ($line =~ /^VARREPORT_pass/) && ($CLIREPORT_pass < 1) )
|
||||||
|
{$VARREPORT_pass = $line; $VARREPORT_pass =~ s/.*=//gi;}
|
||||||
|
if ( ($line =~ /^VARREPORT_port/) && ($CLIREPORT_port < 1) )
|
||||||
|
{$VARREPORT_port = $line; $VARREPORT_port =~ s/.*=//gi;}
|
||||||
|
if ( ($line =~ /^VARREPORT_dir/) && ($CLIREPORT_dir < 1) )
|
||||||
|
{$VARREPORT_dir = $line; $VARREPORT_dir =~ s/.*=//gi;}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Customized Variables
|
||||||
|
$server_ip = $VARserver_ip; # Asterisk server IP
|
||||||
|
|
||||||
|
if ($output_format =~ /^tab-basic$/)
|
||||||
|
{$DLT = "\t"; $txt='.txt'; if (!$Q) {print "---- tab-basic ----\n";}}
|
||||||
|
if ($output_format =~ /^pipe-basic$/)
|
||||||
|
{$DLT = "|"; $txt='.txt'; if (!$Q) {print "---- pipe-basic ----\n";}}
|
||||||
|
|
||||||
|
if (length($campaignSQL) < 2)
|
||||||
|
{
|
||||||
|
if (length($NOTcampaignSQL) < 2)
|
||||||
|
{
|
||||||
|
$VLcampaignSQL = "vicidial_log.campaign_id NOT IN('')";
|
||||||
|
$VLAcampaignSQL = "vicidial_agent_log.campaign_id NOT IN('')";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$VLcampaignSQL = "vicidial_log.campaign_id NOT IN($NOTcampaignSQL)";
|
||||||
|
$VLAcampaignSQL = "vicidial_agent_log.campaign_id NOT IN($NOTcampaignSQL)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$VLcampaignSQL = "vicidial_log.campaign_id IN($campaignSQL)";
|
||||||
|
$VLAcampaignSQL = "vicidial_agent_log.campaign_id IN($campaignSQL)";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dateset > 0)
|
||||||
|
{
|
||||||
|
$VLdateSQL = "call_date > '$shipdate 00:00:01' and call_date < '$shipdate 23:59:59'";
|
||||||
|
$VLAdateSQL = "event_time > '$shipdate 00:00:01' and event_time < '$shipdate 23:59:59'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$VLdateSQL = "processed='N'";
|
||||||
|
$VLAdateSQL = "processed='N'";
|
||||||
|
}
|
||||||
|
if (!$Q)
|
||||||
|
{
|
||||||
|
print "\n\n\n\n\n\n\n\n\n\n\n\n-- AST_call_log_export.pl --\n\n";
|
||||||
|
print "This program is designed to gather all outbound calls and post them to a file. \n";
|
||||||
|
print "\n";
|
||||||
|
print "Campaign: $campaign $VLcampaignSQL\n";
|
||||||
|
print "Output Format: $output_format\n";
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$outfile = "$campaign$US$filedatetime$txt";
|
||||||
|
if ($filename_override > 0) {$outfile = $filename;}
|
||||||
|
|
||||||
|
### open the X out file for writing ###
|
||||||
|
$PATHoutfile = "$PATHweb/vicidial/server_reports/$outfile";
|
||||||
|
open(out, ">$PATHoutfile")
|
||||||
|
|| die "Can't open $PATHoutfile: $!\n";
|
||||||
|
|
||||||
|
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||||
|
|
||||||
|
|
||||||
|
use DBI;
|
||||||
|
|
||||||
|
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||||
|
or die "Couldn't connect to database: " . DBI->errstr;
|
||||||
|
|
||||||
|
$dbhB = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||||
|
or die "Couldn't connect to database: " . DBI->errstr;
|
||||||
|
|
||||||
|
$TOTAL_SALES=0;
|
||||||
|
|
||||||
|
|
||||||
|
$timezone='-5';
|
||||||
|
$stmtA = "SELECT local_gmt FROM servers where server_ip='$server_ip';";
|
||||||
|
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
|
$sthArows=$sthA->rows;
|
||||||
|
if ($DBX) {print " $sthArows|$stmtA|\n";}
|
||||||
|
if ($sthArows > 0)
|
||||||
|
{
|
||||||
|
@aryA = $sthA->fetchrow_array;
|
||||||
|
$timezone = $aryA[0];
|
||||||
|
$sthA->finish();
|
||||||
|
}
|
||||||
|
$offset_timezone = ($timezone + $hour_offset);
|
||||||
|
$SQLtimezone = sprintf("%10.2f",$timezone);
|
||||||
|
$SQLtimezone =~ s/\./:/gi;
|
||||||
|
$SQLtimezone =~ s/:50/:30/gi;
|
||||||
|
$SQLtimezone =~ s/ //gi;
|
||||||
|
$SQLoffset_timezone = sprintf("%10.2f",$offset_timezone);
|
||||||
|
$SQLoffset_timezone =~ s/\./:/gi;
|
||||||
|
$SQLoffset_timezone =~ s/:50/:30/gi;
|
||||||
|
$SQLoffset_timezone =~ s/ //gi;
|
||||||
|
$convert_tz = "'$SQLtimezone','$SQLoffset_timezone'";
|
||||||
|
|
||||||
|
if (!$Q)
|
||||||
|
{print "\n----- SQL CONVERT_TZ: $SQLtimezone|$SQLoffset_timezone $convert_tz -----\n\n";}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
########### CURRENT DAY SALES GATHERING outbound-only non-agent handled calls: vicidial_log ######
|
||||||
|
###########################################################################
|
||||||
|
# call_date|phone_number|vendor_id|status|user|first_name|last_name|lead_id|list_id|campaign_id|length_in_sec|source_id|
|
||||||
|
|
||||||
|
$stmtA = "select CONVERT_TZ(call_date,$convert_tz),vicidial_log.phone_number,vendor_lead_code,vicidial_log.status,vicidial_log.user,first_name,last_name,vicidial_list.lead_id,vicidial_log.list_id,campaign_id,length_in_sec,vicidial_list.source_id,uniqueid from vicidial_list,vicidial_log where $VLcampaignSQL and $VLdateSQL and vicidial_log.lead_id=vicidial_list.lead_id and vicidial_log.status IN('DROP','XDROP','NA','AA','AM','AL','AB','ADC','PU','PM','SVYEXT','SVYVM','SVYHU','SVYREC','HXFER','HOLDTO','QVMAIL','RQXFER','CPDATB','CPDB','CPDNA','CPDREJ','CPDINV','CPDSUA','CPDSI','CPDSNC','CPDSR','CPDSUK','CPDSV','CPDUK','CPDERR','TIMEOT','AFTHRS','NANQUE') order by call_date;";
|
||||||
|
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
|
$sthArows=$sthA->rows;
|
||||||
|
$rec_count=0;
|
||||||
|
if ($DB) {print "$sthArows|$stmtA|\n";}
|
||||||
|
while ($sthArows > $rec_count)
|
||||||
|
{
|
||||||
|
@aryA = $sthA->fetchrow_array;
|
||||||
|
$call_date = $aryA[0];
|
||||||
|
$phone_number = $aryA[1];
|
||||||
|
$vendor_id = $aryA[2];
|
||||||
|
$status = $aryA[3];
|
||||||
|
$user = $aryA[4];
|
||||||
|
$first_name = $aryA[5];
|
||||||
|
$last_name = $aryA[6];
|
||||||
|
$lead_id = $aryA[7];
|
||||||
|
$list_id = $aryA[8];
|
||||||
|
$campaign_id = $aryA[9];
|
||||||
|
$length_in_sec = $aryA[10];
|
||||||
|
$source_id = $aryA[11];
|
||||||
|
$uniqueid = $aryA[12];
|
||||||
|
$VLupdateSQL .= "'$uniqueid',";
|
||||||
|
|
||||||
|
&select_format_loop;
|
||||||
|
|
||||||
|
$TOTAL_SALES++;
|
||||||
|
$rec_count++;
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
########### CURRENT DAY SALES GATHERING outbound-only agent handled calls: vicidial_agent_log ######
|
||||||
|
###########################################################################
|
||||||
|
# call_date|phone_number|vendor_id|status|user|first_name|last_name|lead_id|list_id|campaign_id|length_in_sec|source_id|
|
||||||
|
|
||||||
|
$stmtA = "select CONVERT_TZ(event_time,$convert_tz),vicidial_list.phone_number,vendor_lead_code,vicidial_agent_log.status,vicidial_agent_log.user,first_name,last_name,vicidial_list.lead_id,vicidial_list.list_id,campaign_id,talk_sec,vicidial_list.source_id,dead_sec,agent_log_id from vicidial_list,vicidial_agent_log where $VLAcampaignSQL and $VLAdateSQL and vicidial_agent_log.lead_id=vicidial_list.lead_id and vicidial_agent_log.status NOT IN('DROP','XDROP','NA','AA','AM','AL','AB','ADC','PU','PM','SVYEXT','SVYVM','SVYHU','SVYREC','HXFER','HOLDTO','QVMAIL','RQXFER','CPDATB','CPDB','CPDNA','CPDREJ','CPDINV','CPDSUA','CPDSI','CPDSNC','CPDSR','CPDSUK','CPDSV','CPDUK','CPDERR','TIMEOT','AFTHRS','NANQUE','INCALL','','QUEUE') order by event_time;";
|
||||||
|
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
|
$sthArows=$sthA->rows;
|
||||||
|
$rec_count=0;
|
||||||
|
if ($DB) {print "$sthArows|$stmtA|\n";}
|
||||||
|
while ($sthArows > $rec_count)
|
||||||
|
{
|
||||||
|
@aryA = $sthA->fetchrow_array;
|
||||||
|
$call_date = $aryA[0];
|
||||||
|
$phone_number = $aryA[1];
|
||||||
|
$vendor_id = $aryA[2];
|
||||||
|
$status = $aryA[3];
|
||||||
|
$user = $aryA[4];
|
||||||
|
$first_name = $aryA[5];
|
||||||
|
$last_name = $aryA[6];
|
||||||
|
$lead_id = $aryA[7];
|
||||||
|
$list_id = $aryA[8];
|
||||||
|
$campaign_id = $aryA[9];
|
||||||
|
$length_in_sec = ($aryA[10] - $aryA[12]);
|
||||||
|
$source_id = $aryA[11];
|
||||||
|
if ($length_in_sec < 0) {$length_in_sec=0;}
|
||||||
|
$agent_log_id = $aryA[13];
|
||||||
|
|
||||||
|
$VLAupdateSQL .= "'$agent_log_id',";
|
||||||
|
&select_format_loop;
|
||||||
|
|
||||||
|
$TOTAL_SALES++;
|
||||||
|
$rec_count++;
|
||||||
|
}
|
||||||
|
$sthA->finish();
|
||||||
|
|
||||||
|
|
||||||
|
if ($TEST < 1)
|
||||||
|
{
|
||||||
|
##### update records to processed=Y
|
||||||
|
$VLupdateSQL .= "''";
|
||||||
|
$stmtA = "UPDATE vicidial_log set processed='Y' where uniqueid IN($VLupdateSQL) and processed='N';";
|
||||||
|
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||||
|
$affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n";
|
||||||
|
if($DBX){print STDERR "\n|$affected_rows records updated|\n";}
|
||||||
|
|
||||||
|
$VLAupdateSQL .= "''";
|
||||||
|
$stmtA = "UPDATE vicidial_agent_log set processed='Y' where agent_log_id IN($VLAupdateSQL) and processed='N';";
|
||||||
|
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||||
|
$affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n";
|
||||||
|
if($DBX){print STDERR "\n|$affected_rows records updated|\n";}
|
||||||
|
}
|
||||||
|
close(out);
|
||||||
|
|
||||||
|
|
||||||
|
###### EMAIL SECTION
|
||||||
|
|
||||||
|
if ( (length($Ealert)>5) && (length($email_list) > 3) )
|
||||||
|
{
|
||||||
|
if (!$Q) {print "Sending email: $email_list\n";}
|
||||||
|
|
||||||
|
use MIME::QuotedPrint;
|
||||||
|
use MIME::Base64;
|
||||||
|
use Mail::Sendmail;
|
||||||
|
|
||||||
|
$mailsubject = "VICIDIAL Calls Export $outfile";
|
||||||
|
|
||||||
|
%mail = ( To => "$email_list",
|
||||||
|
From => "$email_sender",
|
||||||
|
Subject => "$mailsubject",
|
||||||
|
);
|
||||||
|
$boundary = "====" . time() . "====";
|
||||||
|
$mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";
|
||||||
|
|
||||||
|
$message = encode_qp( "VICIDIAL Calls Export:\n\n Attachment: $outfile\n Total Records: $TOTAL_SALES\n" );
|
||||||
|
|
||||||
|
$Zfile = "$PATHoutfile";
|
||||||
|
|
||||||
|
open (F, $Zfile) or die "Cannot read $Zfile: $!";
|
||||||
|
binmode F; undef $/;
|
||||||
|
$attachment = encode_base64(<F>);
|
||||||
|
close F;
|
||||||
|
|
||||||
|
$boundary = '--'.$boundary;
|
||||||
|
$mail{body} .= "$boundary\n";
|
||||||
|
$mail{body} .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
|
||||||
|
$mail{body} .= "Content-Transfer-Encoding: quoted-printable\n\n";
|
||||||
|
$mail{body} .= "$message\n";
|
||||||
|
$mail{body} .= "$boundary\n";
|
||||||
|
$mail{body} .= "Content-Type: application/octet-stream; name=\"$outfile\"\n";
|
||||||
|
$mail{body} .= "Content-Transfer-Encoding: base64\n";
|
||||||
|
$mail{body} .= "Content-Disposition: attachment; filename=\"$outfile\"\n\n";
|
||||||
|
$mail{body} .= "$attachment\n";
|
||||||
|
$mail{body} .= "$boundary";
|
||||||
|
$mail{body} .= "--\n";
|
||||||
|
|
||||||
|
sendmail(%mail) or die $mail::Sendmail::error;
|
||||||
|
if (!$Q) {print "ok. log says:\n", $mail::sendmail::log;} ### print mail log for status
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# FTP overrides-
|
||||||
|
# $VARREPORT_host = '10.0.0.4';
|
||||||
|
# $VARREPORT_port = '21';
|
||||||
|
# $VARREPORT_user = 'cron';
|
||||||
|
# $VARREPORT_pass = 'test';
|
||||||
|
# $VARREPORT_dir = '';
|
||||||
|
|
||||||
|
$NODATEDIR = 0; # Don't use dated directories for audio
|
||||||
|
$YEARDIR = 1; # put dated directories in a year directory first
|
||||||
|
|
||||||
|
if ($ftp_transfer > 0)
|
||||||
|
{
|
||||||
|
use Net::FTP;
|
||||||
|
|
||||||
|
if (!$Q) {print "Sending File Over FTP: $outfile\n";}
|
||||||
|
$ftp = Net::FTP->new("$VARREPORT_host", Port => $VARREPORT_port, Debug => $DB);
|
||||||
|
$ftp->login("$VARREPORT_user","$VARREPORT_pass");
|
||||||
|
$ftp->cwd("CALL_LOG");
|
||||||
|
$ftp->put("$PATHweb/vicidial/server_reports/$outfile", "$outfile");
|
||||||
|
$ftp->quit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
### calculate time to run script ###
|
||||||
|
$secY = time();
|
||||||
|
$secZ = ($secY - $secX);
|
||||||
|
$secZm = ($secZ /60);
|
||||||
|
|
||||||
|
if (!$Q) {print "CALLS EXPORT FOR $shipdate: $outfile\n";}
|
||||||
|
if (!$Q) {print "TOTAL CALLS: $TOTAL_SALES\n";}
|
||||||
|
if (!$Q) {print "script execution time in seconds: $secZ minutes: $secZm\n";}
|
||||||
|
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Subroutine for formatting of the output ###
|
||||||
|
sub select_format_loop
|
||||||
|
{
|
||||||
|
if ($output_format =~ /^pipe-basic$/)
|
||||||
|
{
|
||||||
|
$str = "$call_date|$phone_number|$vendor_id|$status|$user|$first_name|$last_name|$lead_id|$list_id|$campaign_id|$length_in_sec|$source_id|\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($output_format =~ /^tab-basic$/)
|
||||||
|
{
|
||||||
|
$str = "$call_date\t$phone_number\t$vendor_id\t$status\t$user\t$first_name\t$last_name\t$lead_id\t$list_id\t$campaign_id\t$length_in_sec\t$source_id\t\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$Ealert .= "$str";
|
||||||
|
|
||||||
|
print out "$str";
|
||||||
|
if ($DBX) {print "$str\n";}
|
||||||
|
|
||||||
|
if ($DB > 0)
|
||||||
|
{
|
||||||
|
if ($rec_count =~ /10$/i) {print STDERR "0 $rec_count\r";}
|
||||||
|
if ($rec_count =~ /20$/i) {print STDERR "+ $rec_count\r";}
|
||||||
|
if ($rec_count =~ /30$/i) {print STDERR "| $rec_count\r";}
|
||||||
|
if ($rec_count =~ /40$/i) {print STDERR "\\ $rec_count\r";}
|
||||||
|
if ($rec_count =~ /50$/i) {print STDERR "- $rec_count\r";}
|
||||||
|
if ($rec_count =~ /60$/i) {print STDERR "/ $rec_count\r";}
|
||||||
|
if ($rec_count =~ /70$/i) {print STDERR "| $rec_count\r";}
|
||||||
|
if ($rec_count =~ /80$/i) {print STDERR "+ $rec_count\r";}
|
||||||
|
if ($rec_count =~ /90$/i) {print STDERR "0 $rec_count\r";}
|
||||||
|
if ($rec_count =~ /00$/i) {print "$rec_count|$TOTAL_SALES| |$phone_number|$call_date|\n";}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
Call Card featureset 2010-03-11
|
||||||
|
|
||||||
|
*** THIS SECTION OUTLINES THE NEW CALLCARD FEATURES in the 2.4 version ***
|
||||||
|
|
||||||
|
|
||||||
|
As of the 2.4 version we have added an optional callcard system to allow calls from customers to agents with timers and balances associated with card pin numbers. This is a highly customized system so it will take some work to get it running, it is not designed to work out of the box, but the framework is in place.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Calling Cards feature is used for ID numbers to be used for agent talk time. There are several applications for this including: paid support queues, chat lines, advisor services, financial advice, legal services. The system consists of an AGI script that takes calls in, asks for and validates the pin/status/balance and sends them to a defined in-group, then the deduction of time from the customer's account starts once the agent receives the call. Also, there will be an option for an alert to low balance injected into the calling session.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Script involved in call card feature:
|
||||||
|
- agi-CALLCARD_dial_in.agi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
For the calls to be properly logged, use these settings(or add to existing URLs) in the in-group that is handling these calls:
|
||||||
|
- Start Call URL: "&minuteswarning=1&callcard=1"
|
||||||
|
- Dispo URL: "&callcard=--A--talk_time_min--B--"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Changes to database:
|
||||||
|
*** DO NOT MAKE THESE CHANGES, for documentation only ***
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE callcard_accounts (
|
||||||
|
card_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
pin VARCHAR(10) NOT NULL,
|
||||||
|
status ENUM('GENERATE','PRINT','SHIP','HOLD','ACTIVE','USED','EMPTY','CANCEL','VOID') default 'GENERATE',
|
||||||
|
balance_minutes SMALLINT(5) default '3',
|
||||||
|
inbound_group_id VARCHAR(20) default '',
|
||||||
|
index (pin)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE callcard_accounts_details (
|
||||||
|
card_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
run VARCHAR(4) default '',
|
||||||
|
batch VARCHAR(5) default '',
|
||||||
|
pack VARCHAR(5) default '',
|
||||||
|
sequence VARCHAR(5) default '',
|
||||||
|
status ENUM('GENERATE','PRINT','SHIP','HOLD','ACTIVE','USED','EMPTY','CANCEL','VOID') default 'GENERATE',
|
||||||
|
balance_minutes SMALLINT(5) default '3',
|
||||||
|
initial_value VARCHAR(6) default '0.00',
|
||||||
|
initial_minutes SMALLINT(5) default '3',
|
||||||
|
note_purchase_order VARCHAR(20) default '',
|
||||||
|
note_printer VARCHAR(20) default '',
|
||||||
|
note_did VARCHAR(18) default '',
|
||||||
|
inbound_group_id VARCHAR(20) default '',
|
||||||
|
note_language VARCHAR(10) default 'English',
|
||||||
|
note_name VARCHAR(20) default '',
|
||||||
|
note_comments VARCHAR(255) default '',
|
||||||
|
create_user VARCHAR(20) default '',
|
||||||
|
activate_user VARCHAR(20) default '',
|
||||||
|
used_user VARCHAR(20) default '',
|
||||||
|
void_user VARCHAR(20) default '',
|
||||||
|
create_time DATETIME,
|
||||||
|
activate_time DATETIME,
|
||||||
|
used_time DATETIME,
|
||||||
|
void_time DATETIME
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE callcard_log (
|
||||||
|
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
card_id VARCHAR(20),
|
||||||
|
balance_minutes_start SMALLINT(5) default '3',
|
||||||
|
call_time DATETIME,
|
||||||
|
agent_time DATETIME,
|
||||||
|
dispo_time DATETIME,
|
||||||
|
agent VARCHAR(20) default '',
|
||||||
|
agent_dispo VARCHAR(6) default '',
|
||||||
|
agent_talk_sec MEDIUMINT(8) default '0',
|
||||||
|
agent_talk_min MEDIUMINT(8) default '0',
|
||||||
|
phone_number VARCHAR(18),
|
||||||
|
inbound_did VARCHAR(18),
|
||||||
|
index (card_id),
|
||||||
|
index (call_time)
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE system_settings ADD callcard_enabled ENUM('1','0') default '0';
|
||||||
|
|
||||||
|
ALTER TABLE vicidial_users ADD callcard_admin ENUM('1','0') default '0';
|
||||||
@@ -543,10 +543,10 @@ custom_three VARCHAR(100) default '',
|
|||||||
custom_four VARCHAR(100) default '',
|
custom_four VARCHAR(100) default '',
|
||||||
custom_five VARCHAR(100) default '',
|
custom_five VARCHAR(100) default '',
|
||||||
voicemail_id VARCHAR(10),
|
voicemail_id VARCHAR(10),
|
||||||
agent_call_log_view_override ENUM('DISABLED','Y','N') default 'DISABLED'
|
agent_call_log_view_override ENUM('DISABLED','Y','N') default 'DISABLED',
|
||||||
|
callcard_admin ENUM('1','0') default '0'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX user ON vicidial_users (user);
|
CREATE UNIQUE INDEX user ON vicidial_users (user);
|
||||||
|
|
||||||
CREATE TABLE vicidial_user_log (
|
CREATE TABLE vicidial_user_log (
|
||||||
@@ -1214,7 +1214,8 @@ static_agent_url VARCHAR(255) default '',
|
|||||||
default_phone_code VARCHAR(8) default '1',
|
default_phone_code VARCHAR(8) default '1',
|
||||||
enable_agc_dispo_log ENUM('0','1') default '0',
|
enable_agc_dispo_log ENUM('0','1') default '0',
|
||||||
custom_dialplan_entry TEXT,
|
custom_dialplan_entry TEXT,
|
||||||
queuemetrics_loginout ENUM('STANDARD','CALLBACK') default 'STANDARD'
|
queuemetrics_loginout ENUM('STANDARD','CALLBACK') default 'STANDARD',
|
||||||
|
callcard_enabled ENUM('1','0') default '0'
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE vicidial_campaigns_list_mix (
|
CREATE TABLE vicidial_campaigns_list_mix (
|
||||||
@@ -1938,6 +1939,59 @@ index (state),
|
|||||||
index (areacode)
|
index (areacode)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE callcard_accounts (
|
||||||
|
card_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
pin VARCHAR(10) NOT NULL,
|
||||||
|
status ENUM('GENERATE','PRINT','SHIP','HOLD','ACTIVE','USED','EMPTY','CANCEL','VOID') default 'GENERATE',
|
||||||
|
balance_minutes SMALLINT(5) default '3',
|
||||||
|
inbound_group_id VARCHAR(20) default '',
|
||||||
|
index (pin)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE callcard_accounts_details (
|
||||||
|
card_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
run VARCHAR(4) default '',
|
||||||
|
batch VARCHAR(5) default '',
|
||||||
|
pack VARCHAR(5) default '',
|
||||||
|
sequence VARCHAR(5) default '',
|
||||||
|
status ENUM('GENERATE','PRINT','SHIP','HOLD','ACTIVE','USED','EMPTY','CANCEL','VOID') default 'GENERATE',
|
||||||
|
balance_minutes SMALLINT(5) default '3',
|
||||||
|
initial_value VARCHAR(6) default '0.00',
|
||||||
|
initial_minutes SMALLINT(5) default '3',
|
||||||
|
note_purchase_order VARCHAR(20) default '',
|
||||||
|
note_printer VARCHAR(20) default '',
|
||||||
|
note_did VARCHAR(18) default '',
|
||||||
|
inbound_group_id VARCHAR(20) default '',
|
||||||
|
note_language VARCHAR(10) default 'English',
|
||||||
|
note_name VARCHAR(20) default '',
|
||||||
|
note_comments VARCHAR(255) default '',
|
||||||
|
create_user VARCHAR(20) default '',
|
||||||
|
activate_user VARCHAR(20) default '',
|
||||||
|
used_user VARCHAR(20) default '',
|
||||||
|
void_user VARCHAR(20) default '',
|
||||||
|
create_time DATETIME,
|
||||||
|
activate_time DATETIME,
|
||||||
|
used_time DATETIME,
|
||||||
|
void_time DATETIME
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE callcard_log (
|
||||||
|
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
card_id VARCHAR(20),
|
||||||
|
balance_minutes_start SMALLINT(5) default '3',
|
||||||
|
call_time DATETIME,
|
||||||
|
agent_time DATETIME,
|
||||||
|
dispo_time DATETIME,
|
||||||
|
agent VARCHAR(20) default '',
|
||||||
|
agent_dispo VARCHAR(6) default '',
|
||||||
|
agent_talk_sec MEDIUMINT(8) default '0',
|
||||||
|
agent_talk_min MEDIUMINT(8) default '0',
|
||||||
|
phone_number VARCHAR(18),
|
||||||
|
inbound_did VARCHAR(18),
|
||||||
|
index (card_id),
|
||||||
|
index (call_time)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
|
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
|
||||||
|
|
||||||
@@ -2077,7 +2131,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N
|
|||||||
|
|
||||||
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
|
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
|
||||||
|
|
||||||
UPDATE system_settings SET db_schema_version='1205',db_schema_update_date=NOW();
|
UPDATE system_settings SET db_schema_version='1206',db_schema_update_date=NOW();
|
||||||
|
|
||||||
GRANT RELOAD ON *.* TO cron@'%';
|
GRANT RELOAD ON *.* TO cron@'%';
|
||||||
GRANT RELOAD ON *.* TO cron@localhost;
|
GRANT RELOAD ON *.* TO cron@localhost;
|
||||||
|
|||||||
@@ -98,3 +98,62 @@ UPDATE system_settings SET db_schema_version='1204',db_schema_update_date=NOW();
|
|||||||
ALTER TABLE system_settings ADD queuemetrics_loginout ENUM('STANDARD','CALLBACK') default 'STANDARD';
|
ALTER TABLE system_settings ADD queuemetrics_loginout ENUM('STANDARD','CALLBACK') default 'STANDARD';
|
||||||
|
|
||||||
UPDATE system_settings SET db_schema_version='1205',db_schema_update_date=NOW();
|
UPDATE system_settings SET db_schema_version='1205',db_schema_update_date=NOW();
|
||||||
|
|
||||||
|
CREATE TABLE callcard_accounts (
|
||||||
|
card_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
pin VARCHAR(10) NOT NULL,
|
||||||
|
status ENUM('GENERATE','PRINT','SHIP','HOLD','ACTIVE','USED','EMPTY','CANCEL','VOID') default 'GENERATE',
|
||||||
|
balance_minutes SMALLINT(5) default '3',
|
||||||
|
inbound_group_id VARCHAR(20) default '',
|
||||||
|
index (pin)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE callcard_accounts_details (
|
||||||
|
card_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
run VARCHAR(4) default '',
|
||||||
|
batch VARCHAR(5) default '',
|
||||||
|
pack VARCHAR(5) default '',
|
||||||
|
sequence VARCHAR(5) default '',
|
||||||
|
status ENUM('GENERATE','PRINT','SHIP','HOLD','ACTIVE','USED','EMPTY','CANCEL','VOID') default 'GENERATE',
|
||||||
|
balance_minutes SMALLINT(5) default '3',
|
||||||
|
initial_value VARCHAR(6) default '0.00',
|
||||||
|
initial_minutes SMALLINT(5) default '3',
|
||||||
|
note_purchase_order VARCHAR(20) default '',
|
||||||
|
note_printer VARCHAR(20) default '',
|
||||||
|
note_did VARCHAR(18) default '',
|
||||||
|
inbound_group_id VARCHAR(20) default '',
|
||||||
|
note_language VARCHAR(10) default 'English',
|
||||||
|
note_name VARCHAR(20) default '',
|
||||||
|
note_comments VARCHAR(255) default '',
|
||||||
|
create_user VARCHAR(20) default '',
|
||||||
|
activate_user VARCHAR(20) default '',
|
||||||
|
used_user VARCHAR(20) default '',
|
||||||
|
void_user VARCHAR(20) default '',
|
||||||
|
create_time DATETIME,
|
||||||
|
activate_time DATETIME,
|
||||||
|
used_time DATETIME,
|
||||||
|
void_time DATETIME
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE callcard_log (
|
||||||
|
uniqueid VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||||
|
card_id VARCHAR(20),
|
||||||
|
balance_minutes_start SMALLINT(5) default '3',
|
||||||
|
call_time DATETIME,
|
||||||
|
agent_time DATETIME,
|
||||||
|
dispo_time DATETIME,
|
||||||
|
agent VARCHAR(20) default '',
|
||||||
|
agent_dispo VARCHAR(6) default '',
|
||||||
|
agent_talk_sec MEDIUMINT(8) default '0',
|
||||||
|
agent_talk_min MEDIUMINT(8) default '0',
|
||||||
|
phone_number VARCHAR(18),
|
||||||
|
inbound_did VARCHAR(18),
|
||||||
|
index (card_id),
|
||||||
|
index (call_time)
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE system_settings ADD callcard_enabled ENUM('1','0') default '0';
|
||||||
|
|
||||||
|
ALTER TABLE vicidial_users ADD callcard_admin ENUM('1','0') default '0';
|
||||||
|
|
||||||
|
UPDATE system_settings SET db_schema_version='1206',db_schema_update_date=NOW();
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
|||||||
|
Ù*REPÿ3œÍ$Zá%S¶Š}®Á:,fÇa�AU£}Ó$ÙkZ„Ãs+hÕflŹS¯Š-ÒÂ6æO—£®�YnÊuØêS‚Ñaå]V-Eéa©ÅªÃ£n¡Y‘iUšÁå$nL4Ù+ZÉâÁ¹�$l¡ö£ªåláIÉ•ÈtDtR9 ØêcHƒ`ÁJá�)¡ë"FßgG#Z�ØôY¾ã–�é#õ[TÙk{M²Á<ëÊZyÆ¡jÝÁæ�Q!FÚÍÛÏæ©×µÙmœ™Š„á)œ’Ï�×aÏ$uÉgÇ!«cHÛTÁõ5»Ù,œ‘ŠP஽¼þÐ�I#·¶ôYÀ�Ù>¯‰A ÝmXÛÙ®µs@ؿќøÆ�c[ƒ9=Ê¡W$Z¦¡ö«•ÆtÙ¯”Òå!W¼Â§X¡&7¹w–áÇlÕ>’9§×¶ZSœ¡»l«¹,ÖÁç+y·'¾Á MŒ:˜_«‰m´“×ñ›†Sk‰´âq!ãXbÓ¨Ë:è¤+v“o/âI-ßÿ½ÖmlWSUI[nÞ&Ó�¬;¸q$\†Ìðâe©sËÊI¹ŒÕí|“É‹+6Ú’á\Ï*¶ã´G‰g·8m²šÍ;ƒ‰”ÍÕ,|_RÍé9Š&ú‹Šôän9#�f6Ÿ›"Óf®ö+�Ôç„ Ó'goíÞÞÔH]ì®Èã–B¸§²¶AÂ#œ‘¢�×äSIT\�€SŽ2€¤B‹+’Gè!.âøÎÕТFë¹t«Ù*SE`¨ÝEžÁb¡QVQÌ¡gŠDÞnÁ·©ØºØês ”ÁZû™÷dR¡O²Èù[èÞn³£‹a8Ϻ›Ù-Œ␍Bwa%]␍HdÄáÀÛe&Ä™`¬·Ñ\"9œ·=/Öâl
|
||||||
|
␍UAï6ÒÙlQa)#±vò“ª7m¶†VE0um]¼Óé¼GÝ—l8Ü¿ºãð«µ/RDÛ„ìL$…¨ƒ$âe¥ÒÓí›R²Ä̶Óo§…é9g.˃)Yy²Æäƒèõ$�É#Ôh´Ê:ƒäQHMÒ˜Ã*V“}&šƒ¥2èÌÒ¤ÃÄGYÁZþÓí£Nùà ©#R>d�El~IVêçÕÃHl£Š·ÓìƒZëƒÅáLt¥Úƒg&Ôk�ÆÓ’ÕežaŒjöAÔ¥lžÜäÅ8¢³uų=,\l‘¹¼X*I[S~¤ÕßTZ܇(Dçö␍Z̈ǼŠ:bŒ¥¨€–HÜ#
|
||||||
|
(–×èbÉ” ¦8É…ÄPE;b½/f’¥ÈýŠãPãU
|
||||||
|
`†CØ:Åh–Ë(;ì!ödZ7´ÂGÖ�'|ca·f4LyÚ,”ÍB‘Bºd�¹ÈÃ<Â;[ÈÁµÓ„²‚¨‹rñJÙí{…ñCÅ4qi UBêYÉ”ƒ«{Î+�"ÌÇoG¹Ùlk…CºÂé»p°\Âd7eÜ”\ÂñlqØê࢘ã5ˆÕØéKCÔ¢áG&MX�c‰Ã$GF…•XƒTŽDéÖ 4Sc¦â¦“.˜àÀ£rÓc8Û™d¸ÛRKïçe‹¡Jª×!,cÑ¡&/ã
|
||||||
|
ÖöT¤ä�8ç²ÅakLZ¤ZÄnœq¡S×àßµ"׬2][#Å5\>cXâÖõÛA©¸Â™¾Ná×ÒÞ]b6麸Ъ¢kn::X¢IDQ³ÜŠÂEÅ‚6ÜÙ$+ Œº�úô–’¶ÁÆþò3YhÁ¸cÆó\bÂ7¢HªÙ®t�Š‚áöÚU¢b¡Xö_VÁh¤yýsÚÁI¬Êw_Ù±Œ•Ë… ŸF®.ªñ@Ç–ikÐáÖ¥2EWPÁÆíI.Ùm”ÙÄq!¬rjÖ‘A)Ô«§‡vᮥ•élÁcp¶¸¦Ù±ŒÕ‹SÁI^ÎK8æ¡y;tîÔ ¡'!¡HEÊ¡–hU$›Ùp•&T†ÁmRS-Ü�!•d¡)XV(Ù²áF䌮rÙq¤ÝÒÀ¡¥q(¼� åŸq8qÄ¡3ˆÀP¢¶Ãr&cØiZÉCZ¡*]±ÕŸÎ�VÕn£Ç$6ÛT H,’Q
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
اRÅ‚P#w+–7%`à�`²Ã4°à¸k›/âÁ4òãC+تZÅAR¡IQZ—¾àªt|ºÖˆ¡µÛ‘Wd\ÁW£Uê%Ù,Z‰¾¡5>Jäýé!Ʋ¼ªã£A5SŠJà’ÁÚ¥SšíÙnƒ‰BAºã�W”†Á5=†«šzáÅ[™¸ºÚáK̶EéØìsEzÁÇ3]ÆÀå,‘Zuì�9»Æk@Çs¢õ-ÙkjÅ�hÁ4¶UµÜ[A-¢ª»Á!dð›§\¡Gj²VrÙ*¤Qá`ÞQ«�ÞÁ:Õ¡¬œá”Ä©E,Í!¨»yÉ+تr€ÈÜáÉ3“V¼cAÅ“–<#X¡K#ªcÛ¤ÁX§ XߨéKâá*ãuU�À Î<–¾ºV�=Õ©êÁ‡u¬#Ùmzá)V¨Ó¤Át’œ£%îÁ•¢ëÏAÕ¤ªØîƒ‘‹Rá‰1'Y¢áDÑp8%¸¡#Š’4§‚Â:å‘KÙ0¤ZŽ¡;põé+ˆ¡Ë¬šw,o É:Ê¥¶¡gSP&aØí¤Ú P¡C/¨�Èá:…*£"è¡IZ»ÖSaë'êé$Ù®”ÍC]a.«®®®²¡7²Ñ5eåA5¸=ÄÁÅ’uİÙ1´ÚL¼ÁYÎᲡdá�&!ä¡·+—Kîj�_mÙØŸÙ°¥V�!Ë�\ªÝ^á¹5␍Åªá²ØiFâ`¡7Ëb%Ùª¬ÚMÃé9$rF{YRíÂ7#j"¹bÏKo¬DÛíÒí·Ø":EƒoIc²ÜxB˜Ñš¶ºÈ4®ç$èÍc¸H-×\ÚmR¢ZŒMs䤂*Ó�P¢Ù(A$:wbÙ�IÙcrÚ{DnU}G4äи}FzÞd©ésF|Èw‹©Ú'¶Ztæ‹«Ø�¶s_º ½·w%€ŽËbsDNü lÙ"¶S«JOÅtåcÝXÓ%zså$mئƒQ“‘®—×Þ%2ÊçãÜ;c© u„ô9¨™t…Ávs¤\¯ójI?OÕ\TïEæÃ°GÍÄËTí)1®ã^J» áè¤'¥3°ÝÔàTgS¯c+ ޼v"Ñ"�6�s"‹bÆ4µâ¢½GäóÔ_\§\æ£$µk–ÜqÂpìv(å©A—"éöa«B¾eJ+’Ôdgdq!¬š�—šââ�ƒ�9uq¡c=ȯÀÄ&íN±›×áSÜqBfÛOáv‚"Ú©t¥É$ŽÆÏЃjr«$Ù¨{‚˜á¹Š¸±¾ÃÈ$+5#T⵨H¦‚¨¦©ØåZ�ê¢e,ve_Öƒ�®g%|â¡F4{bhNŸÙ«s‰J×£E&DÝÛC(ײSÕT¢Ç‡¶×2P¤xçS;=Øè[Ê|ÃIßaWJ¢£¶ë␍—I…*DH҂ºÁrÞÕbTcÔÄ‚K1XXîÜzº€UÈ7uáÆˆmi븹�%Ö¤K£Ì“(Ó¸¶H\˜É?Ä‘´dæ¨Ïı¤£�}ËÎ&[×eC#“íF~lµ4âï'}Å–8%S'¹ŒŽ©§d+Š’4‡× 4#ª†§µD‘WD©m+¸ ¬¦ç'¸iXÄ•×ÙÖœ3ß␍²ãÁT¶Ô½´Â‚ßyæà´Âö‚•Lê^‚Á¡␍ÕÞØáR–°£w„Ç,QbÜ3’ÕÄÂuj2Bêo"ÕÛŠWÚkR…„ÔÁ¦ÝÛ<Ò¢Ú-Fô\¡é'*B“æâÅj²
|
||||||
|
ãÚmŒÍŠä‚SN¶dx‚(ëE\|¡ÄôÉø²Ä¡{“Ù+Ù¯¤Ú[Tá␍&*¸j€áÔ¥�šûÒ¡Gã$?B¾Á>ÞqèÙm×”á(Ý89\b¡ç>WL›PÀµ
|
||||||
|
¤Î”�ª™iîÑÙµ_äáhÞ\ž·A°ânµ[‚ÁË{Ž$Kî¡÷Sy%Ùmœ‘ËrÁÄ„4á°¡ùQ–"R Ò¢-„Ãð¡˜4*ÂaÙm¤ÖKãa–Œf&%[!˜yÑèÔ`á·q³pê"Næv<«Ùm¤ÚK’¡õ^�Jô¢á>×¶SzÁâ…”ZÁ‘Š!£Ùmœ␍Cš¡&²¡át¸Õ«aDûMÃêaÖ,r+Ù0¥Zð€šyŠ¥ÛØ�J”r0ÔT¡8£"eb¬¡6ðö Ø“‰‚™!0ÝÑ+k¸�ºåoÅU®Áöíº,�¡Úï6½W×#BÑwãUÊ“¦£Ç+AÆÛX@"‰J¢Òˆ %QI$’
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -40,6 +40,9 @@ Scheduled Callbacks Alert||
|
|||||||
This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line||
|
This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line||
|
||||||
QueueMetrics Login-Out||
|
QueueMetrics Login-Out||
|
||||||
This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently||
|
This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently||
|
||||||
|
Enable CallCard||
|
||||||
|
This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled||
|
||||||
|
CallCard Access||
|
||||||
|
|
||||||
|
|
||||||
############################################################ CLIENT
|
############################################################ CLIENT
|
||||||
|
|||||||
@@ -240,12 +240,13 @@
|
|||||||
# 100221-1105 - Added custom CID use compatibility
|
# 100221-1105 - Added custom CID use compatibility
|
||||||
# 100301-1342 - Changed Available agents output for AGENTDIRECT selection
|
# 100301-1342 - Changed Available agents output for AGENTDIRECT selection
|
||||||
# 100309-0535 - Added queuemetrics_loginout option
|
# 100309-0535 - Added queuemetrics_loginout option
|
||||||
|
# 100311-1559 - Added callcard logging to startcallurl and dispourl functions
|
||||||
#
|
#
|
||||||
|
|
||||||
$version = '2.4-147';
|
$version = '2.4-148';
|
||||||
$build = '100309-0535';
|
$build = '100311-1559';
|
||||||
$mel=1; # Mysql Error Log enabled = 1
|
$mel=1; # Mysql Error Log enabled = 1
|
||||||
$mysql_log_count=314;
|
$mysql_log_count=321;
|
||||||
$one_mysql_log=0;
|
$one_mysql_log=0;
|
||||||
|
|
||||||
require("dbconnect.php");
|
require("dbconnect.php");
|
||||||
@@ -4501,6 +4502,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
|||||||
if ($DB > 0) {echo "$SCUfile[0]<BR>\n";}
|
if ($DB > 0) {echo "$SCUfile[0]<BR>\n";}
|
||||||
|
|
||||||
##### BEGIN special filtering and response for Vtiger account balance function #####
|
##### BEGIN special filtering and response for Vtiger account balance function #####
|
||||||
|
# http://vtiger/vicidial/api.php?mode=callxfer&contactwsid=--A--vendor_lead_code--B--&minuteswarning=3
|
||||||
$stmt = "SELECT enable_vtiger_integration FROM system_settings;";
|
$stmt = "SELECT enable_vtiger_integration FROM system_settings;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00294',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00294',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
@@ -4510,27 +4512,57 @@ if ($ACTION == 'VDADcheckINCOMING')
|
|||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$enable_vtiger_integration = $row[0];
|
$enable_vtiger_integration = $row[0];
|
||||||
}
|
}
|
||||||
if ( ($enable_vtiger_integration > 0) and (ereg('callxfer',$VDCL_start_call_url)) and (ereg('contactwsid',$VDCL_start_call_url)) )
|
if ( ( ($enable_vtiger_integration > 0) and (ereg('callxfer',$VDCL_start_call_url)) and (ereg('contactwsid',$VDCL_start_call_url)) ) or (preg_match("/minuteswarning/",$VDCL_start_call_url)) )
|
||||||
{
|
{
|
||||||
$SCUoutput='';
|
$SCUoutput='';
|
||||||
foreach ($SCUfile as $SCUline)
|
foreach ($SCUfile as $SCUline)
|
||||||
{$SCUoutput .= "$SCUline";}
|
{$SCUoutput .= "$SCUline";}
|
||||||
# {"result":true,"durationLimit":3071}
|
# {"result":true,"durationLimit":3071}
|
||||||
if (strlen($SCUoutput) > 4)
|
if ( (strlen($SCUoutput) > 4) or (preg_match("/minuteswarning/",$VDCL_start_call_url)) )
|
||||||
{
|
{
|
||||||
$SCUresponse = explode('durationLimit',$SCUoutput);
|
$minuteswarning=3; # default to 3
|
||||||
$durationLimit = preg_replace('/\D/','',$SCUresponse[1]);
|
if (preg_match("/minuteswarning/",$VDCL_start_call_url))
|
||||||
$durationLimitSEC = ( ( ($durationLimit + 0) - 3) * 60); # minutes - 3 for 3-minute-warning
|
{
|
||||||
|
$minuteswarningARY = explode('minuteswarning=',$VDCL_start_call_url);
|
||||||
|
$minuteswarning = preg_replace('/&.*/','',$minuteswarningARY[1]);
|
||||||
|
}
|
||||||
|
### add this to the Start Call URL for callcard calls to be logged "&minuteswarning=1&callcard=1"
|
||||||
|
if (preg_match("/callcard=/",$VDCL_start_call_url))
|
||||||
|
{
|
||||||
|
$stmt="SELECT balance_minutes_start FROM callcard_log where uniqueid='$uniqueid' order by call_time desc LIMIT 1;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00315',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$bms_ct = mysql_num_rows($rslt);
|
||||||
|
if ($bms_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$durationLimit = $row[0];
|
||||||
|
|
||||||
|
$stmt="UPDATE callcard_log set agent_time='$NOW_TIME',agent='$user' where uniqueid='$uniqueid' order by call_time desc LIMIT 1;";
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00316',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$ccl_update = mysql_affected_rows($link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$SCUresponse = explode('durationLimit',$SCUoutput);
|
||||||
|
$durationLimit = preg_replace('/\D/','',$SCUresponse[1]);
|
||||||
|
}
|
||||||
|
if (strlen($durationLimit) < 1) {$durationLimit = 0;}
|
||||||
|
$durationLimitSEC = ( ( ($durationLimit + 0) - $minuteswarning) * 60); # minutes - 3 for 3-minute-warning
|
||||||
if ($durationLimitSEC < 5) {$durationLimitSEC = 5;}
|
if ($durationLimitSEC < 5) {$durationLimitSEC = 5;}
|
||||||
|
|
||||||
$stmt="UPDATE vicidial_live_agents set external_timer_action='D1_DIAL',external_timer_action_message='3 minute warning for customer',external_timer_action_seconds='$durationLimitSEC' where user='$user';";
|
$stmt="UPDATE vicidial_live_agents set external_timer_action='D1_DIAL',external_timer_action_message='$minuteswarning minute warning for customer',external_timer_action_seconds='$durationLimitSEC' where user='$user';";
|
||||||
if ($DB) {echo "$stmt\n";}
|
if ($DB) {echo "$stmt\n";}
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00295',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00295',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
$vla_update_timer = mysql_affected_rows($link);
|
$vla_update_timer = mysql_affected_rows($link);
|
||||||
|
|
||||||
$fp = fopen ("./call_url_log.txt", "a");
|
$fp = fopen ("./call_url_log.txt", "a");
|
||||||
fwrite ($fp, "$VDCL_start_call_url\n$SCUoutput\n$durationLimit|$durationLimitSEC|$vla_update_timer\n");
|
fwrite ($fp, "$VDCL_start_call_url\n$SCUoutput\n$durationLimit|$durationLimitSEC|$vla_update_timer|$minuteswarning|$uniqueid|\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5626,8 +5658,10 @@ if ($ACTION == 'updateDISPO')
|
|||||||
|
|
||||||
mysql_close($linkB);
|
mysql_close($linkB);
|
||||||
}
|
}
|
||||||
|
|
||||||
### Issue Dispo Call URL if defined
|
############################################
|
||||||
|
### BEGIN Issue Dispo Call URL if defined
|
||||||
|
############################################
|
||||||
if (strlen($dispo_call_url) > 7)
|
if (strlen($dispo_call_url) > 7)
|
||||||
{
|
{
|
||||||
$talk_time=0;
|
$talk_time=0;
|
||||||
@@ -5837,7 +5871,51 @@ if ($ACTION == 'updateDISPO')
|
|||||||
fwrite ($fp, "$dispo_call_url\n$SCUoutput\n");
|
fwrite ($fp, "$dispo_call_url\n$SCUoutput\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
### add this to the Dispo URL for callcard calls to be logged "&callcard=--A--talk_time_min--B--"
|
||||||
|
if (preg_match("/callcard/",$dispo_call_url))
|
||||||
|
{
|
||||||
|
$stmt="SELECT balance_minutes_start,card_id FROM callcard_log where uniqueid='$uniqueid' order by call_time desc LIMIT 1;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00317',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$bms_ct = mysql_num_rows($rslt);
|
||||||
|
$fp = fopen ("./call_url_log.txt", "a");
|
||||||
|
fwrite ($fp, "$dispo_call_url\n$stmt|$bms_ct\n");
|
||||||
|
fclose($fp);
|
||||||
|
|
||||||
|
if ($bms_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$balance_minutes_start = $row[0];
|
||||||
|
$card_id = $row[1];
|
||||||
|
|
||||||
|
$current_minutes = ($balance_minutes_start - $talk_time_min);
|
||||||
|
|
||||||
|
$stmt="UPDATE callcard_log set agent_talk_sec='$talk_time',agent_talk_min='$talk_time_min',dispo_time='$NOW_TIME',agent_dispo='$dispo' where uniqueid='$uniqueid' order by call_time desc LIMIT 1;";
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00318',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$ccl_update = mysql_affected_rows($link);
|
||||||
|
|
||||||
|
$stmt="UPDATE callcard_accounts set balance_minutes='$current_minutes' where card_id='$card_id';";
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00319',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$cca_update = mysql_affected_rows($link);
|
||||||
|
|
||||||
|
$stmt="UPDATE callcard_accounts_details set balance_minutes='$current_minutes' where card_id='$card_id';";
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00320',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
|
$ccad_update = mysql_affected_rows($link);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
############################################
|
||||||
|
### END Issue Dispo Call URL if defined
|
||||||
|
############################################
|
||||||
|
|
||||||
|
|
||||||
##### check if system is set to generate logfile for dispos
|
##### check if system is set to generate logfile for dispos
|
||||||
$stmt="SELECT enable_agc_dispo_log FROM system_settings;";
|
$stmt="SELECT enable_agc_dispo_log FROM system_settings;";
|
||||||
@@ -6981,7 +7059,7 @@ if ($ACTION == 'CALLSINQUEUEgrab')
|
|||||||
|
|
||||||
$stmtD="SELECT * from vicidial_auto_calls where auto_call_id='$stage';";
|
$stmtD="SELECT * from vicidial_auto_calls where auto_call_id='$stage';";
|
||||||
$rslt=mysql_query($stmtD, $link);
|
$rslt=mysql_query($stmtD, $link);
|
||||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00321',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||||
if ($rslt) {$DEBUGvac_count = mysql_num_rows($rslt);}
|
if ($rslt) {$DEBUGvac_count = mysql_num_rows($rslt);}
|
||||||
if ($DEBUGvac_count > 0)
|
if ($DEBUGvac_count > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2837,6 +2837,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
|||||||
var pause_code_counter=1;
|
var pause_code_counter=1;
|
||||||
var agent_call_log_view='<?php echo $agent_call_log_view ?>';
|
var agent_call_log_view='<?php echo $agent_call_log_view ?>';
|
||||||
var scheduled_callbacks_alert='<?php echo $scheduled_callbacks_alert ?>';
|
var scheduled_callbacks_alert='<?php echo $scheduled_callbacks_alert ?>';
|
||||||
|
var last_uniqueid='';
|
||||||
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
|
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
|
||||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\" Pause \"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\" Pause \"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||||
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||||
@@ -4777,6 +4778,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
|||||||
custchannellive=1;
|
custchannellive=1;
|
||||||
|
|
||||||
document.vicidial_form.uniqueid.value = MDlookResponse_array[0];
|
document.vicidial_form.uniqueid.value = MDlookResponse_array[0];
|
||||||
|
last_uniqueid = MDlookResponse_array[0];
|
||||||
document.vicidial_form.callchannel.value = MDlookResponse_array[1];
|
document.vicidial_form.callchannel.value = MDlookResponse_array[1];
|
||||||
lastcustchannel = MDlookResponse_array[1];
|
lastcustchannel = MDlookResponse_array[1];
|
||||||
if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;}
|
if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;}
|
||||||
@@ -6553,6 +6555,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
|||||||
|
|
||||||
document.vicidial_form.lead_id.value = VDIC_data_VDAC[0];
|
document.vicidial_form.lead_id.value = VDIC_data_VDAC[0];
|
||||||
document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1];
|
document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1];
|
||||||
|
last_uniqueid = VDIC_data_VDAC[1];
|
||||||
CIDcheck = VDIC_data_VDAC[2];
|
CIDcheck = VDIC_data_VDAC[2];
|
||||||
CalLCID = VDIC_data_VDAC[2];
|
CalLCID = VDIC_data_VDAC[2];
|
||||||
document.vicidial_form.callchannel.value = VDIC_data_VDAC[3];
|
document.vicidial_form.callchannel.value = VDIC_data_VDAC[3];
|
||||||
@@ -8087,7 +8090,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
|||||||
}
|
}
|
||||||
if (xmlhttp)
|
if (xmlhttp)
|
||||||
{
|
{
|
||||||
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&comments=" + CallBackCommenTs;
|
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&uniqueid=" + last_uniqueid + "&comments=" + CallBackCommenTs;
|
||||||
xmlhttp.open('POST', 'vdc_db_query.php');
|
xmlhttp.open('POST', 'vdc_db_query.php');
|
||||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||||
xmlhttp.send(DSupdate_query);
|
xmlhttp.send(DSupdate_query);
|
||||||
|
|||||||
@@ -1195,6 +1195,10 @@ if (isset($_GET["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_G
|
|||||||
elseif (isset($_POST["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_POST["scheduled_callbacks_alert"];}
|
elseif (isset($_POST["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_POST["scheduled_callbacks_alert"];}
|
||||||
if (isset($_GET["queuemetrics_loginout"])) {$queuemetrics_loginout=$_GET["queuemetrics_loginout"];}
|
if (isset($_GET["queuemetrics_loginout"])) {$queuemetrics_loginout=$_GET["queuemetrics_loginout"];}
|
||||||
elseif (isset($_POST["queuemetrics_loginout"])) {$queuemetrics_loginout=$_POST["queuemetrics_loginout"];}
|
elseif (isset($_POST["queuemetrics_loginout"])) {$queuemetrics_loginout=$_POST["queuemetrics_loginout"];}
|
||||||
|
if (isset($_GET["callcard_enabled"])) {$callcard_enabled=$_GET["callcard_enabled"];}
|
||||||
|
elseif (isset($_POST["callcard_enabled"])) {$callcard_enabled=$_POST["callcard_enabled"];}
|
||||||
|
if (isset($_GET["callcard_admin"])) {$callcard_admin=$_GET["callcard_admin"];}
|
||||||
|
elseif (isset($_POST["callcard_admin"])) {$callcard_admin=$_POST["callcard_admin"];}
|
||||||
|
|
||||||
|
|
||||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||||
@@ -1398,6 +1402,8 @@ if ($non_latin < 1)
|
|||||||
$default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip);
|
$default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip);
|
||||||
$enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log);
|
$enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log);
|
||||||
$enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log);
|
$enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log);
|
||||||
|
$callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled);
|
||||||
|
$callcard_admin = ereg_replace("[^0-9]","",$callcard_admin);
|
||||||
|
|
||||||
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
|
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
|
||||||
|
|
||||||
@@ -2098,11 +2104,12 @@ else
|
|||||||
# 100221-0924 - Added Custom CallerID capability in Campaign settings
|
# 100221-0924 - Added Custom CallerID capability in Campaign settings
|
||||||
# 100302-2133 - Added Scheduled Callbacks Alert option
|
# 100302-2133 - Added Scheduled Callbacks Alert option
|
||||||
# 100309-0510 - Added queuemetrics_loginout option
|
# 100309-0510 - Added queuemetrics_loginout option
|
||||||
|
# 100311-2348 - Added CallCard links and settings
|
||||||
#
|
#
|
||||||
# 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
|
# 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.4-243';
|
$admin_version = '2.4-244';
|
||||||
$build = '100309-0510';
|
$build = '100311-2348';
|
||||||
|
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
$SQLdate = date("Y-m-d H:i:s");
|
$SQLdate = date("Y-m-d H:i:s");
|
||||||
@@ -2192,7 +2199,7 @@ else
|
|||||||
{
|
{
|
||||||
$office_no=strtoupper($PHP_AUTH_USER);
|
$office_no=strtoupper($PHP_AUTH_USER);
|
||||||
$password=strtoupper($PHP_AUTH_PW);
|
$password=strtoupper($PHP_AUTH_PW);
|
||||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
|
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$LOGfull_name =$row[3];
|
$LOGfull_name =$row[3];
|
||||||
@@ -2228,6 +2235,7 @@ else
|
|||||||
$LOGmanager_shift_enforcement_override=$row[61];
|
$LOGmanager_shift_enforcement_override=$row[61];
|
||||||
$LOGexport_reports =$row[64];
|
$LOGexport_reports =$row[64];
|
||||||
$LOGdelete_from_dnc =$row[65];
|
$LOGdelete_from_dnc =$row[65];
|
||||||
|
$LOGcallcard_admin =$row[66];
|
||||||
|
|
||||||
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';";
|
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
@@ -6040,6 +6048,11 @@ if ($ADD==99999)
|
|||||||
<BR>
|
<BR>
|
||||||
<B>Enable TTS Integration -</B> This setting allows you to enable Text To Speech integration with Cepstral. This is currently only available for outbound Survey type campaigns. Default is 0 for disabled.
|
<B>Enable TTS Integration -</B> This setting allows you to enable Text To Speech integration with Cepstral. This is currently only available for outbound Survey type campaigns. Default is 0 for disabled.
|
||||||
|
|
||||||
|
<BR>
|
||||||
|
<A NAME="settings-callcard_enabled">
|
||||||
|
<BR>
|
||||||
|
<B>Enable CallCard -</B> This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled.
|
||||||
|
|
||||||
<BR>
|
<BR>
|
||||||
<A NAME="settings-qc_features_active">
|
<A NAME="settings-qc_features_active">
|
||||||
<BR>
|
<BR>
|
||||||
@@ -8491,7 +8504,7 @@ if ($ADD=="2A")
|
|||||||
$stmt="UPDATE system_settings SET auto_user_add_value='$user';";
|
$stmt="UPDATE system_settings SET auto_user_add_value='$user';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
}
|
}
|
||||||
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override from vicidial_users where user=\"$source_user_id\";";
|
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin from vicidial_users where user=\"$source_user_id\";";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
$stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";";
|
$stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";";
|
||||||
@@ -10620,7 +10633,7 @@ if ($ADD=="4A")
|
|||||||
}
|
}
|
||||||
echo "<br><B>USER MODIFIED - ADMIN: $user</B>\n";
|
echo "<br><B>USER MODIFIED - ADMIN: $user</B>\n";
|
||||||
|
|
||||||
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override' where user='$user';";
|
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin' where user='$user';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
### LOG INSERTION Admin Log Table ###
|
### LOG INSERTION Admin Log Table ###
|
||||||
@@ -13541,7 +13554,7 @@ if ($ADD==411111111111111)
|
|||||||
|
|
||||||
echo "<br>VICIDIAL SYSTEM SETTINGS MODIFIED\n";
|
echo "<br>VICIDIAL SYSTEM SETTINGS MODIFIED\n";
|
||||||
|
|
||||||
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='$webphone_url',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout';";
|
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='$webphone_url',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
### LOG INSERTION Admin Log Table ###
|
### LOG INSERTION Admin Log Table ###
|
||||||
@@ -15801,7 +15814,7 @@ if ($ADD==3)
|
|||||||
echo "<TABLE><TR><TD>\n";
|
echo "<TABLE><TR><TD>\n";
|
||||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override from vicidial_users where user='$user';";
|
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin from vicidial_users where user='$user';";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$user_id = $row[0];
|
$user_id = $row[0];
|
||||||
@@ -15880,6 +15893,7 @@ if ($ADD==3)
|
|||||||
$user_custom_five = $row[75];
|
$user_custom_five = $row[75];
|
||||||
$voicemail_id = $row[76];
|
$voicemail_id = $row[76];
|
||||||
$agent_call_log_view_override = $row[77];
|
$agent_call_log_view_override = $row[77];
|
||||||
|
$callcard_admin = $row[78];
|
||||||
|
|
||||||
if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) )
|
if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) )
|
||||||
{
|
{
|
||||||
@@ -16054,6 +16068,7 @@ if ($ADD==3)
|
|||||||
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Call Times: </td><td align=left><select size=1 name=modify_call_times><option>0</option><option>1</option><option SELECTED>$modify_call_times</option></select>$NWB#vicidial_users-modify_call_times$NWE</td></tr>\n";
|
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Call Times: </td><td align=left><select size=1 name=modify_call_times><option>0</option><option>1</option><option SELECTED>$modify_call_times</option></select>$NWB#vicidial_users-modify_call_times$NWE</td></tr>\n";
|
||||||
echo "<tr bgcolor=#B9CBFD><td align=right>Delete Call Times: </td><td align=left><select size=1 name=delete_call_times><option>0</option><option>1</option><option SELECTED>$delete_call_times</option></select>$NWB#vicidial_users-delete_call_times$NWE</td></tr>\n";
|
echo "<tr bgcolor=#B9CBFD><td align=right>Delete Call Times: </td><td align=left><select size=1 name=delete_call_times><option>0</option><option>1</option><option SELECTED>$delete_call_times</option></select>$NWB#vicidial_users-delete_call_times$NWE</td></tr>\n";
|
||||||
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Servers: </td><td align=left><select size=1 name=modify_servers><option>0</option><option>1</option><option SELECTED>$modify_servers</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
|
echo "<tr bgcolor=#B9CBFD><td align=right>Modify Servers: </td><td align=left><select size=1 name=modify_servers><option>0</option><option>1</option><option SELECTED>$modify_servers</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B9CBFD><td align=right>CallCard Access: </td><td align=left><select size=1 name=callcard_admin><option>0</option><option>1</option><option SELECTED>$callcard_admin</option></select>$NWB#vicidial_users-modify_sections$NWE</td></tr>\n";
|
||||||
echo "<tr bgcolor=#B9CBFD><td align=right>Agent API Access: </td><td align=left><select size=1 name=vdc_agent_api_access><option>0</option><option>1</option><option SELECTED>$vdc_agent_api_access</option></select>$NWB#vicidial_users-vdc_agent_api_access$NWE</td></tr>\n";
|
echo "<tr bgcolor=#B9CBFD><td align=right>Agent API Access: </td><td align=left><select size=1 name=vdc_agent_api_access><option>0</option><option>1</option><option SELECTED>$vdc_agent_api_access</option></select>$NWB#vicidial_users-vdc_agent_api_access$NWE</td></tr>\n";
|
||||||
|
|
||||||
echo "<tr bgcolor=#9BB9FB><td align=right>Add Timeclock Log Record: </td><td align=left><select size=1 name=add_timeclock_log><option>0</option><option>1</option><option SELECTED>$add_timeclock_log</option></select>$NWB#vicidial_users-add_timeclock_log$NWE</td></tr>\n";
|
echo "<tr bgcolor=#9BB9FB><td align=right>Add Timeclock Log Record: </td><td align=left><select size=1 name=add_timeclock_log><option>0</option><option>1</option><option SELECTED>$add_timeclock_log</option></select>$NWB#vicidial_users-add_timeclock_log$NWE</td></tr>\n";
|
||||||
@@ -22498,7 +22513,7 @@ if ($ADD==311111111111111)
|
|||||||
echo "<TABLE><TR><TD>\n";
|
echo "<TABLE><TR><TD>\n";
|
||||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout from system_settings;";
|
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled from system_settings;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$version = $row[0];
|
$version = $row[0];
|
||||||
@@ -22552,6 +22567,7 @@ if ($ADD==311111111111111)
|
|||||||
$enable_agc_dispo_log = $row[48];
|
$enable_agc_dispo_log = $row[48];
|
||||||
$custom_dialplan_entry = $row[49];
|
$custom_dialplan_entry = $row[49];
|
||||||
$queuemetrics_loginout = $row[50];
|
$queuemetrics_loginout = $row[50];
|
||||||
|
$callcard_enabled = $row[51];
|
||||||
|
|
||||||
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
|
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
|
||||||
echo "<input type=hidden name=ADD value=411111111111111>\n";
|
echo "<input type=hidden name=ADD value=411111111111111>\n";
|
||||||
@@ -22699,6 +22715,8 @@ if ($ADD==311111111111111)
|
|||||||
|
|
||||||
echo "<tr bgcolor=#B6D3FC><td align=right>Enable TTS Integration: </td><td align=left><select size=1 name=enable_tts_integration><option>1</option><option>0</option><option selected>$enable_tts_integration</option></select>$NWB#settings-enable_tts_integration$NWE</td></tr>\n";
|
echo "<tr bgcolor=#B6D3FC><td align=right>Enable TTS Integration: </td><td align=left><select size=1 name=enable_tts_integration><option>1</option><option>0</option><option selected>$enable_tts_integration</option></select>$NWB#settings-enable_tts_integration$NWE</td></tr>\n";
|
||||||
|
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Enable CallCard: </td><td align=left><select size=1 name=callcard_enabled><option>1</option><option>0</option><option selected>$callcard_enabled</option></select>$NWB#settings-callcard_enabled$NWE</td></tr>\n";
|
||||||
|
|
||||||
if ($SSallow_custom_dialplan > 0)
|
if ($SSallow_custom_dialplan > 0)
|
||||||
{
|
{
|
||||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Custom Dialplan Entry: $NWB#settings-custom_dialplan_entry$NWE <TEXTAREA NAME=custom_dialplan_entry ROWS=5 COLS=80>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
|
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Custom Dialplan Entry: $NWB#settings-custom_dialplan_entry$NWE <TEXTAREA NAME=custom_dialplan_entry ROWS=5 COLS=80>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
# admin_header.php - VICIDIAL administration header
|
# admin_header.php - VICIDIAL administration header
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
|
|
||||||
# CHANGES
|
# CHANGES
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
# 90904-1534 - Added launch_moh_chooser
|
# 90904-1534 - Added launch_moh_chooser
|
||||||
# 90916-2334 - Added Voicemail options
|
# 90916-2334 - Added Voicemail options
|
||||||
# 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus
|
# 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus
|
||||||
|
# 100311-2210 - Added callcard_enabled Admin element
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
@@ -896,11 +897,12 @@ echo "</head>\n";
|
|||||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||||
echo "<!-- INTERNATIONALIZATION-LINKS-PLACEHOLDER-VICIDIAL -->\n";
|
echo "<!-- INTERNATIONALIZATION-LINKS-PLACEHOLDER-VICIDIAL -->\n";
|
||||||
|
|
||||||
$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;";
|
$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled from system_settings;";
|
||||||
$rslt=mysql_query($stmt, $link);
|
$rslt=mysql_query($stmt, $link);
|
||||||
$row=mysql_fetch_row($rslt);
|
$row=mysql_fetch_row($rslt);
|
||||||
$admin_home_url_LU = $row[0];
|
$admin_home_url_LU = $row[0];
|
||||||
$SSenable_tts_integration = $row[1];
|
$SSenable_tts_integration = $row[1];
|
||||||
|
$SScallcard_enabled = $row[2];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<CENTER>
|
<CENTER>
|
||||||
@@ -1145,6 +1147,8 @@ $SSenable_tts_integration = $row[1];
|
|||||||
else {$vm_sh=''; $vm_fc='BLACK';}
|
else {$vm_sh=''; $vm_fc='BLACK';}
|
||||||
if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";}
|
if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";}
|
||||||
else {$tts_sh=''; $tts_fc='BLACK';}
|
else {$tts_sh=''; $tts_fc='BLACK';}
|
||||||
|
if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";}
|
||||||
|
else {$cc_sh=''; $cc_fc='BLACK';}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<TR BGCOLOR=<?php echo $admin_color ?>>
|
<TR BGCOLOR=<?php echo $admin_color ?>>
|
||||||
@@ -1185,6 +1189,13 @@ $SSenable_tts_integration = $row[1];
|
|||||||
<a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $tts_fc ?> SIZE=<?php echo $header_font_size ?>> Text To Speech </a></TD>
|
<a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $tts_fc ?> SIZE=<?php echo $header_font_size ?>> Text To Speech </a></TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
|
<?php }
|
||||||
|
if ($SScallcard_enabled > 0)
|
||||||
|
{ ?>
|
||||||
|
<TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $cc_sh ?>>
|
||||||
|
<a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $cc_fc ?> SIZE=<?php echo $header_font_size ?>> CallCard Admin </a></TD>
|
||||||
|
</TR>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1251,6 +1262,10 @@ $SSenable_tts_integration = $row[1];
|
|||||||
?>
|
?>
|
||||||
<TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show TTS Entries </a> | <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New TTS Entry </a></TD></TR>
|
<TR BGCOLOR=<?php echo $tts_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=150000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show TTS Entries </a> | <a href="<?php echo $ADMIN ?>?ADD=151111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New TTS Entry </a></TD></TR>
|
||||||
<?php }
|
<?php }
|
||||||
|
if ( (strlen($cc_sh) > 1) and (strlen($admin_hh) > 1) ) {
|
||||||
|
?>
|
||||||
|
<TR BGCOLOR=<?php echo $cc_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="callcard_admin.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Summary </a> | <a href="callcard_admin.php?action=CALLCARD_BATCHES"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Batches </a> | <a href="callcard_admin.php?action=SEARCH"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> CallCard Search </a></TD></TR>
|
||||||
|
<?php }
|
||||||
if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) {
|
if ( (strlen($moh_sh) > 1) and (strlen($admin_hh) > 1) ) {
|
||||||
?>
|
?>
|
||||||
<TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show MOH Entries </a> | <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New MOH Entry </a></TD></TR>
|
<TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show MOH Entries </a> | <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New MOH Entry </a></TD></TR>
|
||||||
|
|||||||
@@ -0,0 +1,898 @@
|
|||||||
|
<?php
|
||||||
|
# callcard_admin.php
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
|
#
|
||||||
|
# This callcard script is to administer the callcard accounts in ViciDial
|
||||||
|
# it is separate from the standard admin.php script. callcard_enabled in
|
||||||
|
# the system_settings table must be active for this script to work.
|
||||||
|
#
|
||||||
|
# CHANGES
|
||||||
|
# 100311-2325 - first build
|
||||||
|
#
|
||||||
|
|
||||||
|
$version = '2.4-1';
|
||||||
|
$build = '100311-2325';
|
||||||
|
|
||||||
|
$MT[0]='';
|
||||||
|
|
||||||
|
require("dbconnect.php");
|
||||||
|
|
||||||
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||||
|
if (isset($_GET["action"])) {$action=$_GET["action"];}
|
||||||
|
elseif (isset($_POST["action"])) {$action=$_POST["action"];}
|
||||||
|
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||||
|
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||||
|
if (isset($_GET["run"])) {$run=$_GET["run"];}
|
||||||
|
elseif (isset($_POST["run"])) {$run=$_POST["run"];}
|
||||||
|
if (isset($_GET["batch"])) {$batch=$_GET["batch"];}
|
||||||
|
elseif (isset($_POST["batch"])) {$batch=$_POST["batch"];}
|
||||||
|
if (isset($_GET["pack"])) {$pack=$_GET["pack"];}
|
||||||
|
elseif (isset($_POST["pack"])) {$pack=$_POST["pack"];}
|
||||||
|
if (isset($_GET["sequence"])) {$sequence=$_GET["sequence"];}
|
||||||
|
elseif (isset($_POST["sequence"])) {$sequence=$_POST["sequence"];}
|
||||||
|
if (isset($_GET["card_id"])) {$card_id=$_GET["card_id"];}
|
||||||
|
elseif (isset($_POST["card_id"])) {$card_id=$_POST["card_id"];}
|
||||||
|
if (isset($_GET["status"])) {$status=$_GET["status"];}
|
||||||
|
elseif (isset($_POST["status"])) {$status=$_POST["status"];}
|
||||||
|
|
||||||
|
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||||
|
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||||
|
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||||
|
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||||
|
|
||||||
|
|
||||||
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
|
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||||
|
header ("Pragma: no-cache"); // HTTP/1.0
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||||
|
$stmt = "SELECT use_non_latin,callcard_enabled FROM system_settings;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$ss_conf_ct = mysql_num_rows($rslt);
|
||||||
|
if ($ss_conf_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$non_latin = $row[0];
|
||||||
|
$callcard_enabled = $row[1];
|
||||||
|
}
|
||||||
|
##### END SETTINGS LOOKUP #####
|
||||||
|
###########################################
|
||||||
|
|
||||||
|
|
||||||
|
if ($callcard_enabled < 1)
|
||||||
|
{
|
||||||
|
echo "ERROR: CallCard is not active on this system\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($non_latin < 1)
|
||||||
|
{
|
||||||
|
### Clean Variable Values ###
|
||||||
|
$DB = ereg_replace("[^0-9]","",$DB);
|
||||||
|
$action = ereg_replace("[^\_0-9a-zA-Z]","",$action);
|
||||||
|
$card_id = ereg_replace("[^-\_0-9]","",$card_id);
|
||||||
|
$run = ereg_replace("[^0-9]","",$run);
|
||||||
|
$batch = ereg_replace("[^0-9]","",$batch);
|
||||||
|
$pack = ereg_replace("[^0-9]","",$pack);
|
||||||
|
$sequence = ereg_replace("[^0-9]","",$sequence);
|
||||||
|
$territory_description = ereg_replace("[^ -\_\.\,0-9a-zA-Z]","",$territory_description);
|
||||||
|
$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user);
|
||||||
|
$old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory);
|
||||||
|
$old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user);
|
||||||
|
$accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eregi("YES",$batch))
|
||||||
|
{
|
||||||
|
$USER='batch';
|
||||||
|
$PASS='batch';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
|
$PASS=$_SERVER['PHP_AUTH_PW'];
|
||||||
|
$USER = ereg_replace("[^0-9a-zA-Z]","",$USER);
|
||||||
|
$PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS);
|
||||||
|
|
||||||
|
$stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1'";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$auth=$row[0];
|
||||||
|
|
||||||
|
if( (strlen($USER)<2) or (strlen($PASS)<2) or (!$auth))
|
||||||
|
{
|
||||||
|
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||||
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
|
echo "Invalid Username/Password: |$USER|$PASS|\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (strlen($action) < 1)
|
||||||
|
{$action = 'CALLCARD_SUMMARY';}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||||
|
<!-- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> -->
|
||||||
|
<title>ADMINISTRATION: CallCard Admin
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN change territory owner for one account
|
||||||
|
if ( ($action == "CHANGE_TERRITORY_OWNER_ACCOUNT") and ($enable_vtiger_integration > 0) )
|
||||||
|
{
|
||||||
|
echo "</TITLE></HEAD><BODY BGCOLOR=white>\n";
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n";
|
||||||
|
echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER_ACCOUNT>\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Account ID: </td><td align=left><input type=text name=accountid value=\"$accountid\"></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n";
|
||||||
|
|
||||||
|
$stmt="SELECT user,full_name from vicidial_users where active='Y' order by user";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$users_to_print = mysql_num_rows($rslt);
|
||||||
|
$users_list='';
|
||||||
|
|
||||||
|
$o=0;
|
||||||
|
while ($users_to_print > $o)
|
||||||
|
{
|
||||||
|
$rowx=mysql_fetch_row($rslt);
|
||||||
|
$users_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
echo "$users_list";
|
||||||
|
echo "</select></td></tr>\n";
|
||||||
|
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n";
|
||||||
|
echo "<option SELECTED>YES</option>\n";
|
||||||
|
echo "<option>NO</option>\n";
|
||||||
|
echo "</select></td></tr>\n";
|
||||||
|
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||||
|
echo "</TABLE></center>\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
### END change territory owner for one account
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### BEGIN Set variables to make header show properly #####
|
||||||
|
$ADD = '0';
|
||||||
|
$hh = 'admin';
|
||||||
|
$sh = 'cc';
|
||||||
|
$LOGast_admin_access = '1';
|
||||||
|
$ADMIN = 'admin.php';
|
||||||
|
$page_width='770';
|
||||||
|
$section_width='750';
|
||||||
|
$header_font_size='3';
|
||||||
|
$subheader_font_size='2';
|
||||||
|
$subcamp_font_size='2';
|
||||||
|
$header_selected_bold='<b>';
|
||||||
|
$header_nonselected_bold='';
|
||||||
|
$admin_color = '#FFFF99';
|
||||||
|
$admin_font = 'BLACK';
|
||||||
|
$admin_color = '#E6E6E6';
|
||||||
|
$cc_color = '#FFFF99';
|
||||||
|
$cc_font = 'BLACK';
|
||||||
|
$cc_color = '#C6C6C6';
|
||||||
|
$subcamp_color = '#C6C6C6';
|
||||||
|
##### END Set variables to make header show properly #####
|
||||||
|
;
|
||||||
|
require("admin_header.php");
|
||||||
|
|
||||||
|
$colspan='3';
|
||||||
|
|
||||||
|
?>
|
||||||
|
<TABLE WIDTH=<?php echo $page_width ?> BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=$colspan><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B> \n";
|
||||||
|
|
||||||
|
$STARTtime = date("U");
|
||||||
|
$TODAY = date("Y-m-d");
|
||||||
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
|
$FILE_datetime = $STARTtime;
|
||||||
|
|
||||||
|
$ip = getenv("REMOTE_ADDR");
|
||||||
|
$date = date("r");
|
||||||
|
$browser = getenv("HTTP_USER_AGENT");
|
||||||
|
$script_name = getenv("SCRIPT_NAME");
|
||||||
|
$server_name = getenv("SERVER_NAME");
|
||||||
|
$server_port = getenv("SERVER_PORT");
|
||||||
|
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
|
||||||
|
else {$HTTPprotocol = 'http://';}
|
||||||
|
$admDIR = "$HTTPprotocol$server_name:$server_port$script_name";
|
||||||
|
$admDIR = eregi_replace('audio_store.php','',$admDIR);
|
||||||
|
$admSCR = 'admin.php';
|
||||||
|
$NWB = " <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
|
||||||
|
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
|
||||||
|
|
||||||
|
$secX = date("U");
|
||||||
|
$pulldate0 = "$year-$mon-$mday $hour:$min:$sec";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN change territory owner in the system
|
||||||
|
if ( ($action == "CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integration > 0) )
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
echo "<br>Vtiger Change Territory Owner<form action=$PHP_SELF method=POST>\n";
|
||||||
|
echo "<input type=hidden name=action value=PROCESS_CHANGE_TERRITORY_OWNER>\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><select size=1 name=territory>\n";
|
||||||
|
|
||||||
|
$stmt="SELECT territory,territory_description from vicidial_territories order by territory";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$territories_to_print = mysql_num_rows($rslt);
|
||||||
|
$territories_list='';
|
||||||
|
|
||||||
|
$o=0;
|
||||||
|
while ($territories_to_print > $o)
|
||||||
|
{
|
||||||
|
$rowx=mysql_fetch_row($rslt);
|
||||||
|
$territories_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
echo "$territories_list";
|
||||||
|
echo "</select></td></tr>\n";
|
||||||
|
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>New Owner: </td><td align=left><select size=1 name=user>\n";
|
||||||
|
|
||||||
|
$stmt="SELECT user,full_name from vicidial_users where active='Y' order by user";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$users_to_print = mysql_num_rows($rslt);
|
||||||
|
$users_list='';
|
||||||
|
|
||||||
|
$o=0;
|
||||||
|
while ($users_to_print > $o)
|
||||||
|
{
|
||||||
|
$rowx=mysql_fetch_row($rslt);
|
||||||
|
$users_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
echo "$users_list";
|
||||||
|
echo "</select></td></tr>\n";
|
||||||
|
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Update ViciDial List Owner: </td><td align=left><select size=1 name=vl_owner>\n";
|
||||||
|
echo "<option SELECTED>YES</option>\n";
|
||||||
|
echo "<option>NO</option>\n";
|
||||||
|
echo "</select></td></tr>\n";
|
||||||
|
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||||
|
echo "</TABLE></center>\n";
|
||||||
|
}
|
||||||
|
### END change territory owner in the system
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN delete user territory page
|
||||||
|
if ($action == "DELETE_USER_TERRITORY")
|
||||||
|
{
|
||||||
|
if ( (strlen($territory)<1) or (strlen($user)<1) )
|
||||||
|
{
|
||||||
|
echo "ERROR: Territory and User must be filled in<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$stmt="SELECT count(*) from vicidial_user_territories where territory='$territory' and user='$user';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
if ($row[0] < 0)
|
||||||
|
{
|
||||||
|
echo "ERROR: this territory user is not in the system<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$stmt="DELETE from vicidial_user_territories where territory='$territory' and user='$user';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
|
echo "User Territory Deleted: $user $territory<BR>\n";
|
||||||
|
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|$stmtB|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE USER TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$action = "MODIFY_TERRITORY";
|
||||||
|
}
|
||||||
|
### END delete user territory page
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN add territory page
|
||||||
|
if ($action == "ADD_TERRITORY")
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
echo "<br>Add Territory<form action=$PHP_SELF method=POST>\n";
|
||||||
|
echo "<input type=hidden name=action value=PROCESS_ADD_TERRITORY>\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=30 maxlength=100></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Territory Description: </td><td align=left><input type=text name=territory_description size=50 maxlength=255></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||||
|
echo "</TABLE></center>\n";
|
||||||
|
}
|
||||||
|
### END add territory page
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN process add territory page
|
||||||
|
if ($action == "PROCESS_ADD_TERRITORY")
|
||||||
|
{
|
||||||
|
if ( (strlen($territory)<1) or (strlen($territory_description)<1) )
|
||||||
|
{
|
||||||
|
echo "ERROR: Territory and Territory Description must be filled in<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$stmt="SELECT count(*) from vicidial_territories where territory='$territory';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
if ($row[0] > 0)
|
||||||
|
{
|
||||||
|
echo "ERROR: there is already a territory in the system with this name<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$stmt="INSERT INTO vicidial_territories SET territory='$territory',territory_description='$territory_description';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
|
echo "Territory Added: $territory<BR>\n";
|
||||||
|
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='ADD', record_id='$territory', event_code='ADMIN ADD TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$action = "CALLCARD_SUMMARY";
|
||||||
|
}
|
||||||
|
### END process add territory page
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN delete territory page
|
||||||
|
if ($action == "DELETE_TERRITORY")
|
||||||
|
{
|
||||||
|
if (strlen($territory)<1)
|
||||||
|
{
|
||||||
|
echo "ERROR: Territory must be filled in<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$stmt="SELECT count(*) from vicidial_territories where territory='$territory';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
if ($row[0] < 0)
|
||||||
|
{
|
||||||
|
echo "ERROR: This territory is not in the system with this name<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$stmt="DELETE from vicidial_territories where territory='$territory';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
|
||||||
|
echo "Territory Deleted: $territory<BR>\n";
|
||||||
|
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='TERRITORIES', event_type='DELETE', record_id='$territory', event_code='ADMIN DELETE TERRITORY', event_sql=\"$SQL_log\", event_notes='';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$action = "CALLCARD_SUMMARY";
|
||||||
|
}
|
||||||
|
### END delete territory page
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN modify card status page
|
||||||
|
if ($action == "CALLCARD_STATUS")
|
||||||
|
{
|
||||||
|
if ( (strlen($card_id)<1) or (strlen($status)<1) )
|
||||||
|
{
|
||||||
|
echo "ERROR: Card ID and Status must be filled in<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$stmt="SELECT count(*) from callcard_accounts_details where card_id='$card_id';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
if ($row[0] < 1)
|
||||||
|
{
|
||||||
|
echo "ERROR: This card_id is not in the system<BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($status == 'RESET')
|
||||||
|
{
|
||||||
|
$initial_minutes=1;
|
||||||
|
$stmt="SELECT initial_minutes FROM callcard_accounts_details where card_id='$card_id';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$im_ct = mysql_num_rows($rslt);
|
||||||
|
if ($im_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$initial_minutes = $row[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt="UPDATE callcard_accounts_details SET status='ACTIVE',balance_minutes='$initial_minutes',used_time=NOW(),used_user='$USER' where card_id='$card_id';";
|
||||||
|
$stmtB="UPDATE callcard_accounts SET status='ACTIVE',balance_minutes='$initial_minutes' where card_id='$card_id';";
|
||||||
|
}
|
||||||
|
if ($status == 'VOID')
|
||||||
|
{
|
||||||
|
$stmt="UPDATE callcard_accounts_details SET status='VOID',void_time=NOW(),void_user='$USER' where card_id='$card_id';";
|
||||||
|
$stmtB="UPDATE callcard_accounts SET status='VOID' where card_id='$card_id';";
|
||||||
|
}
|
||||||
|
if ($status == 'ACTIVE')
|
||||||
|
{
|
||||||
|
$stmt="UPDATE callcard_accounts_details SET status='ACTIVE',activate_time=NOW(),activate_user='$USER' where card_id='$card_id';";
|
||||||
|
$stmtB="UPDATE callcard_accounts SET status='ACTIVE' where card_id='$card_id';";
|
||||||
|
}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$rslt=mysql_query($stmtB, $link);
|
||||||
|
if ($DB) {echo "|$stmt|$stmtB|\n";}
|
||||||
|
|
||||||
|
echo "Card ID Status Modified: $card_id - $status<BR>\n";
|
||||||
|
|
||||||
|
### LOG INSERTION Admin Log Table ###
|
||||||
|
$SQL_log = "$stmt|";
|
||||||
|
$SQL_log = ereg_replace(';','',$SQL_log);
|
||||||
|
$SQL_log = addslashes($SQL_log);
|
||||||
|
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$action = "CALLCARD_DETAIL";
|
||||||
|
}
|
||||||
|
### END process modify territory page
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN CallCard record Detail page
|
||||||
|
if ($action == "CALLCARD_DETAIL")
|
||||||
|
{
|
||||||
|
|
||||||
|
$stmt="SELECT card_id,run,batch,pack,sequence,status,balance_minutes,initial_value,initial_minutes,note_purchase_order,note_printer,note_did,inbound_group_id,note_language,note_name,note_comments,create_user,activate_user,used_user,void_user,create_time,activate_time,used_time,void_time from callcard_accounts_details where card_id='$card_id';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$details_to_print = mysql_num_rows($rslt);
|
||||||
|
if ($details_to_print > 0)
|
||||||
|
{
|
||||||
|
$rowx=mysql_fetch_row($rslt);
|
||||||
|
$card_id = $rowx[0];
|
||||||
|
$run = $rowx[1];
|
||||||
|
$batch = $rowx[2];
|
||||||
|
$pack = $rowx[3];
|
||||||
|
$sequence = $rowx[4];
|
||||||
|
$status = $rowx[5];
|
||||||
|
$balance_minutes = $rowx[6];
|
||||||
|
$initial_value = $rowx[7];
|
||||||
|
$initial_minutes = $rowx[8];
|
||||||
|
$note_purchase_order = $rowx[9];
|
||||||
|
$note_printer = $rowx[10];
|
||||||
|
$note_did = $rowx[11];
|
||||||
|
$inbound_group_id = $rowx[12];
|
||||||
|
$note_language = $rowx[13];
|
||||||
|
$note_name = $rowx[14];
|
||||||
|
$note_comments = $rowx[15];
|
||||||
|
$create_user = $rowx[16];
|
||||||
|
$activate_user = $rowx[17];
|
||||||
|
$used_user = $rowx[18];
|
||||||
|
$void_user = $rowx[19];
|
||||||
|
$create_time = $rowx[20];
|
||||||
|
$activate_time = $rowx[21];
|
||||||
|
$used_time = $rowx[22];
|
||||||
|
$void_time = $rowx[23];
|
||||||
|
|
||||||
|
$stmt="SELECT pin from callcard_accounts where card_id='$card_id';";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
$pin_to_print = mysql_num_rows($rslt);
|
||||||
|
if ($pin_to_print > 0)
|
||||||
|
{
|
||||||
|
$rowx=mysql_fetch_row($rslt);
|
||||||
|
$pin = $rowx[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
echo "<br>CallCard Detail<form action=$PHP_SELF method=POST>\n";
|
||||||
|
echo "<input type=hidden name=action value=PROCESS_MODIFY_CALLCARD>\n";
|
||||||
|
echo "<input type=hidden name=card_id value=\"$card_id\">\n";
|
||||||
|
echo "<input type=hidden name=DB value=\"$DB\">\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><B>$card_id</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>PIN: </td><td align=left><B>$pin</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Status: </td><td align=left><B>$status</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><B>$run</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><B>$batch</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Pack: </td><td align=left><B>$pack</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><B>$sequence</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Balance Minutes: </td><td align=left><B>$balance_minutes</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Initial Minutes: </td><td align=left><B>$initial_minutes</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Initial Value: </td><td align=left><B>$initial_value</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Purchase Order: </td><td align=left><B>$note_purchase_order</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Printer: </td><td align=left><B>$note_printer</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>DID: </td><td align=left><B>$note_did</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group: </td><td align=left><B>$inbound_group_id</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Language: </td><td align=left><B>$note_language</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Name: </td><td align=left><B>$note_name</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Comments: </td><td align=left><B>$note_comments</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Create User/Date: </td><td align=left><B>$create_user / $create_time</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Activate User/Date: </td><td align=left><B>$activate_user / $activate_time</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Used User/Date: </td><td align=left><B>$used_user / $used_time</B></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Void User/Date: </td><td align=left><B>$void_user / $void_time</B></td></tr>\n";
|
||||||
|
echo "</TABLE>\n";
|
||||||
|
echo "<BR><BR><BR>\n";
|
||||||
|
|
||||||
|
echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=VOID&card_id=$card_id&DB=$DB\">Void This Card ID</a><BR><BR>\n";
|
||||||
|
echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=ACTIVE&card_id=$card_id&DB=$DB\">Activate This Card ID</a><BR><BR>\n";
|
||||||
|
echo "<a href=\"$PHP_SELF?action=CALLCARD_STATUS&status=RESET&card_id=$card_id&DB=$DB\">Reset Minutes on This Card ID</a>\n";
|
||||||
|
echo "<BR><BR>\n";
|
||||||
|
|
||||||
|
### call log
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
echo "<br>Call Log for this Card ID:\n";
|
||||||
|
echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DATE</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DISPO</B></TD>";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
$stmt = "SELECT call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log where card_id='$card_id' order by call_time;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$vt_ct = mysql_num_rows($rslt);
|
||||||
|
$i=0;
|
||||||
|
while ($vt_ct > $i)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $i))
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
echo "<tr $bgcolor>\n";
|
||||||
|
echo "<td><font size=1> $i </td>";
|
||||||
|
echo "<td><font size=1> $row[0] </td>";
|
||||||
|
echo "<td><font size=1> $row[1] </td>";
|
||||||
|
echo "<td><font size=1> $row[2] </td>";
|
||||||
|
echo "<td><font size=1> $row[3] </td>";
|
||||||
|
echo "<td><font size=1> $row[4] </td>";
|
||||||
|
echo "<td><font size=1> $row[5] </td>";
|
||||||
|
echo "<td><font size=1> $row[6] </td>";
|
||||||
|
echo "<td><font size=1> $row[7] </td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
|
||||||
|
echo "<a href=\"admin.php?ADD=720000000000000&category=CALLCARD&stage=$card_id&DB=$DB\">Admin Log for this Card ID</a><BR><BR>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo "ERROR: Card ID not found: $card_id<BR>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
### END card id detail page
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN callcard summary
|
||||||
|
if ($action == "CALLCARD_SUMMARY")
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
echo "<br>CallCard Summary:\n";
|
||||||
|
echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>STATUS</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>COUNT</B></TD>";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
$stmt = "SELECT count(*),status FROM callcard_accounts_details group by status order by status;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$vt_ct = mysql_num_rows($rslt);
|
||||||
|
$i=0;
|
||||||
|
while ($vt_ct > $i)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$Lcount[$i] = $row[0];
|
||||||
|
$Lstatus[$i] = $row[1];
|
||||||
|
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $i))
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
echo "<tr $bgcolor>\n";
|
||||||
|
echo "<td><font size=1> $Lstatus[$i] </td>";
|
||||||
|
echo "<td><font size=1> $Lcount[$i] </td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
|
||||||
|
$stmt = "SELECT count(distinct batch) FROM callcard_accounts_details;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$db_ct = mysql_num_rows($rslt);
|
||||||
|
if ($db_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$DBcount = $row[0];
|
||||||
|
|
||||||
|
echo "<b>There are $DBcount batches in the system\n";
|
||||||
|
}
|
||||||
|
echo "<BR><BR>\n";
|
||||||
|
|
||||||
|
### call log
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
echo "<br>Last 10 Calls:\n";
|
||||||
|
echo "<center><TABLE width=740 cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>#</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CARD ID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DATE</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>CallerID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>START MIN</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>TALK MIN</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>AGENT DATE</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=2 color=white>DISPO</B></TD>";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
$stmt = "SELECT card_id,call_time,phone_number,inbound_did,balance_minutes_start,agent_talk_min,agent,agent_time,agent_dispo FROM callcard_log order by call_time desc limit 10;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$vt_ct = mysql_num_rows($rslt);
|
||||||
|
$i=0;
|
||||||
|
while ($vt_ct > $i)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $i))
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
echo "<tr $bgcolor>\n";
|
||||||
|
echo "<td><font size=1> $i </td>";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$row[0]&DB=$DB\"><font color=black>$row[0]</font></a> </td>";
|
||||||
|
echo "<td><font size=1> $row[1] </td>";
|
||||||
|
echo "<td><font size=1> $row[2] </td>";
|
||||||
|
echo "<td><font size=1> $row[3] </td>";
|
||||||
|
echo "<td><font size=1> $row[4] </td>";
|
||||||
|
echo "<td><font size=1> $row[5] </td>";
|
||||||
|
echo "<td><font size=1> $row[6] </td>";
|
||||||
|
echo "<td><font size=1> $row[7] </td>";
|
||||||
|
echo "<td><font size=1> $row[8] </td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
echo "</center>\n";
|
||||||
|
}
|
||||||
|
### END callcard summary
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN list batches
|
||||||
|
if ($action == "CALLCARD_BATCHES")
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
echo "<br>CallCard Batches:\n";
|
||||||
|
echo "<center><TABLE width=400 cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BATCH</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>COUNT</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LIST</B></TD>";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
$stmt = "SELECT count(*),batch FROM callcard_accounts_details group by batch order by batch;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$vt_ct = mysql_num_rows($rslt);
|
||||||
|
$i=0;
|
||||||
|
while ($vt_ct > $i)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$Lcount[$i] = $row[0];
|
||||||
|
$Lbatch[$i] = $row[1];
|
||||||
|
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $i))
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
echo "<tr $bgcolor>\n";
|
||||||
|
echo "<td><font size=1> $Lbatch[$i] </td>";
|
||||||
|
echo "<td><font size=1> $Lcount[$i] </td>";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?action=SEARCH_RESULTS&batch=$Lbatch[$i]&DB=$DB\">LIST</a> </td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
echo "</center>\n";
|
||||||
|
}
|
||||||
|
### END list batches
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN search results
|
||||||
|
if ($action == "SEARCH_RESULTS")
|
||||||
|
{
|
||||||
|
if (strlen($card_id) > 1)
|
||||||
|
{$searchSQL = "card_id='$card_id'";}
|
||||||
|
if (strlen($run) > 1)
|
||||||
|
{
|
||||||
|
$and='';
|
||||||
|
if (strlen($searchSQL) > 1) {$and=' and';}
|
||||||
|
$searchSQL .= "$and run='$run'";
|
||||||
|
}
|
||||||
|
if (strlen($batch) > 1)
|
||||||
|
{
|
||||||
|
$and='';
|
||||||
|
if (strlen($searchSQL) > 1) {$and=' and';}
|
||||||
|
$searchSQL .= "$and batch='$batch'";
|
||||||
|
}
|
||||||
|
if (strlen($pack) > 1)
|
||||||
|
{
|
||||||
|
$and='';
|
||||||
|
if (strlen($searchSQL) > 1) {$and=' and';}
|
||||||
|
$searchSQL .= "$and pack='$pack'";
|
||||||
|
}
|
||||||
|
if (strlen($sequence) > 1)
|
||||||
|
{
|
||||||
|
$and='';
|
||||||
|
if (strlen($searchSQL) > 1) {$and=' and';}
|
||||||
|
$searchSQL .= "$and sequence='$sequence'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($searchSQL) < 5)
|
||||||
|
{
|
||||||
|
echo "you must enter something to search for<BR><BR>\n";
|
||||||
|
$action = 'SEARCH';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
echo "<br>CallCard Batches:\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=0 cellpadding=1>\n";
|
||||||
|
echo "<TR BGCOLOR=BLACK>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CARD ID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>STATUS</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>BALANCE</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>CREATE</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>ACTIVATE</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>LAST USED</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>VOID</B></TD>";
|
||||||
|
echo "<TD><B><FONT FACE=\"Arial,Helvetica\" size=1 color=white>DETAIL</B></TD>";
|
||||||
|
echo "</TR>\n";
|
||||||
|
|
||||||
|
$stmt = "SELECT card_id,status,balance_minutes,create_time,activate_time,used_time,void_time FROM callcard_accounts_details where $searchSQL;";
|
||||||
|
$rslt=mysql_query($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$vt_ct = mysql_num_rows($rslt);
|
||||||
|
$i=0;
|
||||||
|
while ($vt_ct > $i)
|
||||||
|
{
|
||||||
|
$row=mysql_fetch_row($rslt);
|
||||||
|
$Lcard_id[$i] = $row[0];
|
||||||
|
$Lstatus[$i] = $row[1];
|
||||||
|
$Lbalance_minutes[$i] = $row[2];
|
||||||
|
$Lcreate_time[$i] = $row[3];
|
||||||
|
$Lactivate_time[$i] = $row[4];
|
||||||
|
$Lused_time[$i] = $row[5];
|
||||||
|
$Lvoid_time[$i] = $row[6];
|
||||||
|
|
||||||
|
if (eregi("1$|3$|5$|7$|9$", $i))
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||||
|
echo "<tr $bgcolor>\n";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\"><font color=black>$Lcard_id[$i]</font></a> </td>";
|
||||||
|
echo "<td><font size=1> $Lstatus[$i] </td>";
|
||||||
|
echo "<td><font size=1> $Lbalance_minutes[$i] </td>";
|
||||||
|
echo "<td><font size=1> $Lcreate_time[$i] </td>";
|
||||||
|
echo "<td><font size=1> $Lactivate_time[$i] </td>";
|
||||||
|
echo "<td><font size=1> $Lused_time[$i] </td>";
|
||||||
|
echo "<td><font size=1> $Lvoid_time[$i] </td>";
|
||||||
|
echo "<td><font size=1> <a href=\"$PHP_SELF?action=CALLCARD_DETAIL&card_id=$Lcard_id[$i]&DB=$DB\">DETAILS</a> </td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo "</TABLE><BR><BR>\n";
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
echo "</center>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
### END search results
|
||||||
|
|
||||||
|
|
||||||
|
### BEGIN search
|
||||||
|
if ($action == "SEARCH")
|
||||||
|
{
|
||||||
|
echo "<TABLE><TR><TD>\n";
|
||||||
|
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
|
||||||
|
echo "<br>CallCard Search<form action=$PHP_SELF method=POST>\n";
|
||||||
|
echo "<input type=hidden name=action value=SEARCH_RESULTS>\n";
|
||||||
|
echo "<input type=hidden name=DB value=$DB>\n";
|
||||||
|
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Card ID: </td><td align=left><input type=text name=card_id size=20 maxlength=20></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Run: </td><td align=left><input type=text name=run size=5 maxlength=4></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Batch: </td><td align=left><input type=text name=batch size=6 maxlength=5></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=right>Sequence: </td><td align=left><input type=text name=sequence size=6 maxlength=5></td></tr>\n";
|
||||||
|
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||||
|
echo "</TABLE></center>\n";
|
||||||
|
echo "\n";
|
||||||
|
echo "</center>\n";
|
||||||
|
}
|
||||||
|
### END search
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<BR><font size=1>CallCard VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> </td></tr>
|
||||||
|
</TD></TR></TABLE>
|
||||||
Reference in New Issue
Block a user