added vicidial_timeclock_audit_log for a non-editable log
fixed database inconsistencies in files. git-svn-id: svn://192.168.202.10@879 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -388,7 +388,7 @@ if ($log_to_vac == 'YES')
|
||||
if ($AGILOG) {$agi_string = "-- VAC : |$affected_rowsV|$uniqueid|$callerid|$extension|"; &agi_output;}
|
||||
}
|
||||
|
||||
$stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,start_time) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$SQLdate')";
|
||||
$stmtA = "INSERT INTO live_inbound_log (uniqueid,channel,server_ip,caller_id,extension,start_time,comment_a,comment_b) values('$uniqueid','$channel','$VARserver_ip','$callerid','$extension','$SQLdate','$channel_group','$phone_number')";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$affected_rowsL = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- LIL : |$affected_rowsL|$uniqueid|$callerid|$extension|"; &agi_output;}
|
||||
|
||||
@@ -4,6 +4,8 @@ This doc goes over the addition of the IVR status to the vicidial_auto_calls tab
|
||||
|
||||
The agi-VDAD_inbound_calltime_check.agi script does a check for the calltime scheme of the defined in-group(queue) as well as using the after-hours method for that in-group and the associated after-hours message if defined. Also, this script can place a record in the vicidial_auto_calls status in the IVR status. Calls in this status do not affect the dial ratios of blended campaigns, but they will display in the AST_timeonVDADall.php real-time status pages.
|
||||
|
||||
A log of the calls going into this agi-VDAD_inbound_calltime_check.agi script is also inserted into the live_inbound_log table.
|
||||
|
||||
|
||||
|
||||
The example below shows how to do a very simple IVR before sending to a queue asking if the caller wants English, Spanish, French or German language service.
|
||||
|
||||
@@ -81,3 +81,21 @@ ip_address VARCHAR(15),
|
||||
shift_id VARCHAR(20),
|
||||
index (user)
|
||||
);
|
||||
|
||||
# This table contains the audit log of timeclock activity(non-editable)
|
||||
CREATE TABLE vicidial_timeclock_audit_log (
|
||||
timeclock_id INT(9) UNSIGNED NOT NULL,
|
||||
event_epoch INT(10) UNSIGNED NOT NULL,
|
||||
event_date DATETIME NOT NULL,
|
||||
login_sec INT(10) UNSIGNED,
|
||||
event VARCHAR(50) NOT NULL,
|
||||
user VARCHAR(20) NOT NULL,
|
||||
user_group VARCHAR(20) NOT NULL,
|
||||
ip_address VARCHAR(15),
|
||||
shift_id VARCHAR(20),
|
||||
event_datestamp TIMESTAMP NOT NULL,
|
||||
tcid_link INT(9) UNSIGNED,
|
||||
index (timeclock_id),
|
||||
index (user)
|
||||
);
|
||||
|
||||
|
||||
@@ -1108,6 +1108,22 @@ status VARCHAR(50),
|
||||
ip_address VARCHAR(15),
|
||||
shift_id VARCHAR(20),
|
||||
index (user)
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_timeclock_audit_log (
|
||||
timeclock_id INT(9) UNSIGNED NOT NULL,
|
||||
event_epoch INT(10) UNSIGNED NOT NULL,
|
||||
event_date DATETIME NOT NULL,
|
||||
login_sec INT(10) UNSIGNED,
|
||||
event VARCHAR(50) NOT NULL,
|
||||
user VARCHAR(20) NOT NULL,
|
||||
user_group VARCHAR(20) NOT NULL,
|
||||
ip_address VARCHAR(15),
|
||||
shift_id VARCHAR(20),
|
||||
event_datestamp TIMESTAMP NOT NULL,
|
||||
tcid_link INT(9) UNSIGNED,
|
||||
index (timeclock_id),
|
||||
index (user)
|
||||
);
|
||||
|
||||
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
|
||||
@@ -1159,5 +1175,5 @@ INSERT INTO vicidial_state_call_times SET state_call_time_id='utah',state_call_t
|
||||
INSERT INTO vicidial_state_call_times SET state_call_time_id='washington',state_call_time_state='WA',state_call_time_name='Washington 8am',sct_default_start='800',sct_default_stop='2100';
|
||||
INSERT INTO vicidial_state_call_times SET state_call_time_id='wyoming',state_call_time_state='WY',state_call_time_name='Wyoming 8am-8pm',sct_default_start='800',sct_default_stop='2000';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1088';
|
||||
UPDATE system_settings SET db_schema_version='1089';
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ UPDATE system_settings SET db_schema_version='1085';
|
||||
CREATE TABLE vicidial_timeclock_log (
|
||||
timeclock_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
event_epoch INT(10) UNSIGNED NOT NULL,
|
||||
event_date TIMESTAMP NOT NULL,
|
||||
event_date DATETIME NOT NULL,
|
||||
login_sec INT(10) UNSIGNED,
|
||||
event VARCHAR(50) NOT NULL,
|
||||
user VARCHAR(20) NOT NULL,
|
||||
@@ -168,6 +168,8 @@ shift_id VARCHAR(20),
|
||||
notes VARCHAR(255),
|
||||
manager_user VARCHAR(20),
|
||||
manager_ip VARCHAR(15),
|
||||
event_datestamp TIMESTAMP NOT NULL,
|
||||
tcid_link INT(9) UNSIGNED,
|
||||
index (user)
|
||||
);
|
||||
|
||||
@@ -193,3 +195,21 @@ UPDATE system_settings SET db_schema_version='1087';
|
||||
ALTER TABLE vicidial_auto_calls MODIFY status ENUM('SENT','RINGING','LIVE','XFER','PAUSED','CLOSER','BUSY','DISCONNECT','IVR') default 'PAUSED';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1088';
|
||||
|
||||
CREATE TABLE vicidial_timeclock_audit_log (
|
||||
timeclock_id INT(9) UNSIGNED NOT NULL,
|
||||
event_epoch INT(10) UNSIGNED NOT NULL,
|
||||
event_date DATETIME NOT NULL,
|
||||
login_sec INT(10) UNSIGNED,
|
||||
event VARCHAR(50) NOT NULL,
|
||||
user VARCHAR(20) NOT NULL,
|
||||
user_group VARCHAR(20) NOT NULL,
|
||||
ip_address VARCHAR(15),
|
||||
shift_id VARCHAR(20),
|
||||
event_datestamp TIMESTAMP NOT NULL,
|
||||
tcid_link INT(9) UNSIGNED,
|
||||
index (timeclock_id),
|
||||
index (user)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1089';
|
||||
|
||||
+26
-3
@@ -6,10 +6,11 @@
|
||||
# CHANGELOG
|
||||
# 80523-0134 - First Build
|
||||
# 80524-0225 - Changed event_date to DATETIME, added timestamp field and tcid_link field
|
||||
# 80525-2351 - Added an audit log that is not to be editable
|
||||
#
|
||||
|
||||
$version = '2.0.5-2';
|
||||
$build = '80524-0225';
|
||||
$version = '2.0.5-3';
|
||||
$build = '80525-2351';
|
||||
|
||||
$StarTtimE = date("U");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -269,7 +270,8 @@ if ( ($stage == 'login') or ($stage == 'logout') )
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows| -->\n";
|
||||
$timeclock_id = mysql_insert_id($link);
|
||||
print "<!-- NEW vicidial_timeclock_log record inserted for $user: |$affected_rows|$timeclock_id| -->\n";
|
||||
|
||||
### Update the user's timeclock status record
|
||||
$stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';";
|
||||
@@ -277,6 +279,13 @@ if ( ($stage == 'login') or ($stage == 'logout') )
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the timeclock audit log
|
||||
$stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', event_date='$NOW_TIME';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
|
||||
}
|
||||
|
||||
if ( ($status=='LOGIN') and ($stage=='logout') )
|
||||
@@ -305,6 +314,20 @@ if ( ($stage == 'login') or ($stage == 'logout') )
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_status record updated for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Add a record to the timeclock audit log
|
||||
$stmt="INSERT INTO vicidial_timeclock_audit_log set timeclock_id='$timeclock_id', event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec', event_date='$NOW_TIME';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- NEW vicidial_timeclock_audit_log record inserted for $user: |$affected_rows| -->\n";
|
||||
|
||||
### Update last login record in the timeclock audit log
|
||||
$stmt="UPDATE vicidial_timeclock_audit_log set login_sec='$last_action_sec',tcid_link='$timeclock_id' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
print "<!-- vicidial_timeclock_audit_log record updated for $user: |$affected_rows| -->\n";
|
||||
}
|
||||
|
||||
if ( ( ( ($status=='AUTO_LOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) )
|
||||
|
||||
Reference in New Issue
Block a user