Added check of reserved_extensions against dialplan numbers when creating/modifying phones

Fixes for non-agent API, agent_stats_export
Added CRM_log_manage.pl script in extras

git-svn-id: svn://192.168.202.10@3967 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2026-01-26 19:53:03 +00:00
parent e5aa3ea5bc
commit 8151d9a444
6 changed files with 1051 additions and 627 deletions
+137 -65
View File
@@ -15,7 +15,7 @@
# - Auto reset lists at defined times # - Auto reset lists at defined times
# - Auto restarts Asterisk process if enabled in servers settings # - Auto restarts Asterisk process if enabled in servers settings
# #
# Copyright (C) 2025 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# 61011-1348 - First build # 61011-1348 - First build
@@ -178,9 +178,10 @@
# 251006-0832 - Added truncating of vicidial_dtmf_log older than 24 hours & If recording_dtmf_muting enabled, force use of MixMonitor for recording # 251006-0832 - Added truncating of vicidial_dtmf_log older than 24 hours & If recording_dtmf_muting enabled, force use of MixMonitor for recording
# 251011-1000 - Added archiving of recording_dtmf_muting_log, disabled purging of recording_live_log after 7 days # 251011-1000 - Added archiving of recording_dtmf_muting_log, disabled purging of recording_live_log after 7 days
# 251024-2222 - Added crashed table detection # 251024-2222 - Added crashed table detection
# 260126-1334 - Added check of reserved_extensions against dialplan numbers when building conf files
# #
$build = '251024-2222'; $build = '260126-1334';
$DB=0; # Debug flag $DB=0; # Debug flag
$teodDB=0; # flag to log Timeclock End of Day processes to log file $teodDB=0; # flag to log Timeclock End of Day processes to log file
@@ -194,6 +195,10 @@ $autodial_delay='';
$adfill_delay=''; $adfill_delay='';
$fill_staggered=''; $fill_staggered='';
$recmon=0; $recmon=0;
$reserved_exten_skip=0;
$reserved_exten_message='';
$reserved_extensions = '8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8320,8352,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8500,8501,138300,138301,138302,138303,138304,138305,138306,138307,138308,138309,138310,138311,138312,138313,138314,138315,138316,138317,138318,138319,138320,138321,138322,138323,138324,138325,138326,138327,138328,138329,138330,138331,138332,138333,138334,138335,138336,138337,138338,138339,138340,138341,138342,138343,138344,138345,138346,138347,138348,138349,138350,138351,138352,138353,138354,138355,138356,138357,138358,138359,138360,138361,138362,138363,138364,138365,138366,138367,138368,138369,138370,138371,138372,138373,138374,138375,138376,138377,138378,138379,138380,138381,138382,138383,138384,138385,138386,138387,138388,138389,138390,138391,138392,138393,138394,138395,138396,138397,138398,138399';
$reserved_extensions = ",$reserved_extensions,";
# time variable definitions # time variable definitions
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
@@ -3916,35 +3921,48 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
if (length($mohsuggest[$i]) > 0) if (length($mohsuggest[$i]) > 0)
{$Piax .= "mohsuggest=$mohsuggest[$i]\n";} {$Piax .= "mohsuggest=$mohsuggest[$i]\n";}
} }
%ast_ver_str = parse_asterisk_version($asterisk_version); ### check against $reserved_extensions before building dialplan entry for this phone
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)) $tempdp = $dialplan[$i];
if ($reserved_extensions =~ /,$tempdp,/)
{ {
$Pext .= "exten => $dialplan[$i],1,Dial(IAX2/$extension[$i]|$phone_ring_timeout[$i]|)\n"; # reserved_extensions match, do not build dialplan, collect data for error to populate in admin log
$reserved_exten_skip++;
$reserved_exten_message .= "RESERVED MATCH IAX SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";
if ($DBX) {print "RESERVED MATCH IAX SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";}
$Pext .= "; RESERVED MATCH IAX SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";
} }
else else
{ {
$Pext .= "exten => $dialplan[$i],1,Dial(IAX2/$extension[$i],$phone_ring_timeout[$i],)\n"; %ast_ver_str = parse_asterisk_version($asterisk_version);
} if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
if (length($unavail_dialplan_fwd_exten[$i]) > 0)
{
if (length($unavail_dialplan_fwd_context[$i]) < 1)
{$unavail_dialplan_fwd_context[$i] = 'default';}
$Pext .= "exten => $dialplan[$i],2,Goto($unavail_dialplan_fwd_context[$i],$unavail_dialplan_fwd_exten[$i],1)\n";
}
else
{
if ($voicemail_instructions[$i] =~ /Y/)
{ {
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n"; $Pext .= "exten => $dialplan[$i],1,Dial(IAX2/$extension[$i]|$phone_ring_timeout[$i]|)\n";
} }
else else
{ {
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666667$voicemail[$i],1)\n"; $Pext .= "exten => $dialplan[$i],1,Dial(IAX2/$extension[$i],$phone_ring_timeout[$i],)\n";
}
if (length($unavail_dialplan_fwd_exten[$i]) > 0)
{
if (length($unavail_dialplan_fwd_context[$i]) < 1)
{$unavail_dialplan_fwd_context[$i] = 'default';}
$Pext .= "exten => $dialplan[$i],2,Goto($unavail_dialplan_fwd_context[$i],$unavail_dialplan_fwd_exten[$i],1)\n";
}
else
{
if ($voicemail_instructions[$i] =~ /Y/)
{
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n";
}
else
{
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666667$voicemail[$i],1)\n";
}
}
if (!(( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)))
{
$Pext .= "exten => $dialplan[$i],3,Hangup()\n";
} }
}
if (!(( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)))
{
$Pext .= "exten => $dialplan[$i],3,Hangup()\n";
} }
if ($delete_vm_after_email[$i] =~ /Y/) if ($delete_vm_after_email[$i] =~ /Y/)
@@ -4081,35 +4099,48 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
if (length($mohsuggest[$i]) > 0) if (length($mohsuggest[$i]) > 0)
{$Psip .= "mohsuggest=$mohsuggest[$i]\n";} {$Psip .= "mohsuggest=$mohsuggest[$i]\n";}
} }
%ast_ver_str = parse_asterisk_version($asterisk_version); ### check against $reserved_extensions before building dialplan entry for this phone
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)) $tempdp = $dialplan[$i];
if ($reserved_extensions =~ /,$tempdp,/)
{ {
$Pext .= "exten => $dialplan[$i],1,Dial(SIP/$extension[$i]|$phone_ring_timeout[$i]|)\n"; # $reserved_extensions match, do not build dialplan, collect data for error to populate in admin log
$reserved_exten_skip++;
$reserved_exten_message .= "RESERVED MATCH SIP SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";
if ($DBX) {print "RESERVED MATCH SIP SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";}
$Pext .= "; RESERVED MATCH SIP SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";
} }
else else
{ {
$Pext .= "exten => $dialplan[$i],1,Dial(SIP/$extension[$i],$phone_ring_timeout[$i],)\n"; %ast_ver_str = parse_asterisk_version($asterisk_version);
} if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
if (length($unavail_dialplan_fwd_exten[$i]) > 0)
{
if (length($unavail_dialplan_fwd_context[$i]) < 1)
{$unavail_dialplan_fwd_context[$i] = 'default';}
$Pext .= "exten => $dialplan[$i],2,Goto($unavail_dialplan_fwd_context[$i],$unavail_dialplan_fwd_exten[$i],1)\n";
}
else
{
if ($voicemail_instructions[$i] =~ /Y/)
{ {
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n"; $Pext .= "exten => $dialplan[$i],1,Dial(SIP/$extension[$i]|$phone_ring_timeout[$i]|)\n";
} }
else else
{ {
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666667$voicemail[$i],1)\n"; $Pext .= "exten => $dialplan[$i],1,Dial(SIP/$extension[$i],$phone_ring_timeout[$i],)\n";
}
if (length($unavail_dialplan_fwd_exten[$i]) > 0)
{
if (length($unavail_dialplan_fwd_context[$i]) < 1)
{$unavail_dialplan_fwd_context[$i] = 'default';}
$Pext .= "exten => $dialplan[$i],2,Goto($unavail_dialplan_fwd_context[$i],$unavail_dialplan_fwd_exten[$i],1)\n";
}
else
{
if ($voicemail_instructions[$i] =~ /Y/)
{
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n";
}
else
{
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666667$voicemail[$i],1)\n";
}
}
if (!(( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)))
{
$Pext .= "exten => $dialplan[$i],3,Hangup()\n";
} }
}
if (!(( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)))
{
$Pext .= "exten => $dialplan[$i],3,Hangup()\n";
} }
if ($delete_vm_after_email[$i] =~ /Y/) if ($delete_vm_after_email[$i] =~ /Y/)
@@ -4273,35 +4304,48 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
} }
### Dialplan generation : ### Dialplan generation :
%ast_ver_str = parse_asterisk_version($asterisk_version); ### check against $reserved_extensions before building dialplan entry for this phone
if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)) $tempdp = $dialplan[$i];
if ($reserved_extensions =~ /,$tempdp,/)
{ {
$Pext .= "exten => $dialplan[$i],1,Dial(PJSIP/$extension[$i]|$phone_ring_timeout[$i]|)\n"; # $reserved_extensions match, do not build dialplan, collect data for error to populate in admin log
$reserved_exten_skip++;
$reserved_exten_message .= "RESERVED MATCH PJSIP SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";
if ($DBX) {print "RESERVED MATCH PJSIP SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";}
$Pext .= "; RESERVED MATCH PJSIP SKIP! dialplan: $dialplan[$i] phone: $extension[$i] server: $server_ip\n";
} }
else else
{ {
$Pext .= "exten => $dialplan[$i],1,Dial(PJSIP/$extension[$i],$phone_ring_timeout[$i],)\n"; %ast_ver_str = parse_asterisk_version($asterisk_version);
} if (( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6))
if (length($unavail_dialplan_fwd_exten[$i]) > 0)
{
if (length($unavail_dialplan_fwd_context[$i]) < 1)
{$unavail_dialplan_fwd_context[$i] = 'default';}
$Pext .= "exten => $dialplan[$i],2,Goto($unavail_dialplan_fwd_context[$i],$unavail_dialplan_fwd_exten[$i],1)\n";
}
else
{
if ($voicemail_instructions[$i] =~ /Y/)
{ {
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n"; $Pext .= "exten => $dialplan[$i],1,Dial(PJSIP/$extension[$i]|$phone_ring_timeout[$i]|)\n";
} }
else else
{ {
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666667$voicemail[$i],1)\n"; $Pext .= "exten => $dialplan[$i],1,Dial(PJSIP/$extension[$i],$phone_ring_timeout[$i],)\n";
}
if (length($unavail_dialplan_fwd_exten[$i]) > 0)
{
if (length($unavail_dialplan_fwd_context[$i]) < 1)
{$unavail_dialplan_fwd_context[$i] = 'default';}
$Pext .= "exten => $dialplan[$i],2,Goto($unavail_dialplan_fwd_context[$i],$unavail_dialplan_fwd_exten[$i],1)\n";
}
else
{
if ($voicemail_instructions[$i] =~ /Y/)
{
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666666$voicemail[$i],1)\n";
}
else
{
$Pext .= "exten => $dialplan[$i],2,Goto(default,85026666666667$voicemail[$i],1)\n";
}
}
if (!(( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)))
{
$Pext .= "exten => $dialplan[$i],3,Hangup()\n";
} }
}
if (!(( $ast_ver_str{major} = 1 ) && ($ast_ver_str{minor} < 6)))
{
$Pext .= "exten => $dialplan[$i],3,Hangup()\n";
} }
### VM generation ### VM generation
@@ -4349,9 +4393,21 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$d = leading_zero($4); $d = leading_zero($4);
$CXVARremDIALstr = "$a$S$b$S$c$S$d$S"; $CXVARremDIALstr = "$a$S$b$S$c$S$d$S";
} }
$Pext .= "; Remote Phone Entry $i: $CXextension[$i] $CXserver_ip[$i] $CXfullname[$i]\n"; ### check against $reserved_extensions before building dialplan entry for this phone
$Pext .= "exten => $CXdialplan[$i],1,Goto(default,$CXVARremDIALstr$CXdialplan[$i],1)\n"; $tempdp = $CXdialplan[$i];
if ($reserved_extensions =~ /,$tempdp,/)
{
# $reserved_extensions match, do not build dialplan, collect data for error to populate in admin log
$reserved_exten_skip++;
$reserved_exten_message .= "RESERVED MATCH CX SKIP! dialplan: $CXdialplan[$i] phone: $CXextension[$i] server: $CXserver_ip[$i]\n";
if ($DBX) {print "RESERVED MATCH CX SKIP! dialplan: $CXdialplan[$i] phone: $CXextension[$i] server: $CXserver_ip[$i]\n";}
$Pext .= "; RESERVED MATCH CX SKIP! dialplan: $CXdialplan[$i] phone: $CXextension[$i] server: $CXserver_ip[$i]\n";
}
else
{
$Pext .= "; Remote Phone Entry $i: $CXextension[$i] $CXserver_ip[$i] $CXfullname[$i]\n";
$Pext .= "exten => $CXdialplan[$i],1,Goto(default,$CXVARremDIALstr$CXdialplan[$i],1)\n";
}
$i++; $i++;
} }
##### END Generate the CROSS SERVER IAX and SIP phone entries ##### ##### END Generate the CROSS SERVER IAX and SIP phone entries #####
@@ -5500,6 +5556,14 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
`screen -XS asterisk eval 'stuff "extensions reload\015"'`; `screen -XS asterisk eval 'stuff "extensions reload\015"'`;
if ($DB) {print "extensions reload\n";} if ($DB) {print "extensions reload\n";}
sleep(1); sleep(1);
if ($reserved_exten_skip > 0)
{
# log reserved_extensions skips to the admin log
if ($DB) {print "reserved_extensions skips being logged...\n";}
$stmtA="INSERT INTO vicidial_admin_log set event_date=NOW(), user='VDAD', ip_address='1.1.1.1', event_section='SERVERS', event_type='OTHER', record_id='$server_ip', event_code='RESTRICTED DIALPLAN SKIPS', event_sql='', event_notes='$reserved_exten_skip skips: $reserved_exten_message';";
$Iaffected_rows = $dbhA->do($stmtA);
if ($DBX) {print "reserved_extensions skips debug 1: |$reserved_exten_skip skips: $reserved_exten_message|\n";}
}
} }
if ($sipCMP > 0) if ($sipCMP > 0)
{ {
@@ -5545,6 +5609,14 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
`screen -XS asterisk eval 'stuff "dialplan reload\015"'`; `screen -XS asterisk eval 'stuff "dialplan reload\015"'`;
if ($DB) {print "dialplan reload\n";} if ($DB) {print "dialplan reload\n";}
sleep(1); sleep(1);
if ($reserved_exten_skip > 0)
{
# log reserved_extensions skips to the admin log
if ($DB) {print "reserved_extensions skips being logged...\n";}
$stmtA="INSERT INTO vicidial_admin_log set event_date=NOW(), user='VDAD', ip_address='1.1.1.1', event_section='SERVERS', event_type='OTHER', record_id='$server_ip', event_code='RESTRICTED DIALPLAN SKIPS', event_sql='', event_notes='$reserved_exten_skip skips: $reserved_exten_message';";
$Iaffected_rows = $dbhA->do($stmtA);
if ($DBX) {print "reserved_extensions skips debug 1: |$reserved_exten_skip skips: $reserved_exten_message|\n";}
}
} }
if ($sipCMP > 0) if ($sipCMP > 0)
{ {
+339
View File
@@ -0,0 +1,339 @@
#!/usr/bin/perl
#
# CRM_log_manage.pl version 2.14
#
# This script is designed to manage the multiple crm_..._log table records, with
# options to fill them and/or purge them at specific intevals, keeping a set
# number of minimum days of records within them.
#
# To customize this script, edit the "POP_table" and "POP_date" entries below to
# include the database tables and their date fields you want to be managed by
# this script. You will need to make sure that a "crm_..." table exists for each:
#
# CREATE TABLE crm_call_log LIKE call_log;
# CREATE TABLE crm_vicidial_log LIKE vicidial_log;
# CREATE TABLE crm_vicidial_agent_log LIKE vicidial_agent_log;
# ALTER TABLE crm_vicidial_agent_log MODIFY agent_log_id INT(9) UNSIGNED NOT NULL;
# CREATE TABLE crm_vicidial_closer_log LIKE vicidial_closer_log;
# ALTER TABLE crm_vicidial_closer_log MODIFY closecallid INT(9) UNSIGNED NOT NULL;
# CREATE TABLE crm_vicidial_xfer_log LIKE vicidial_xfer_log;
# ALTER TABLE crm_vicidial_xfer_log MODIFY xfercallid INT(9) UNSIGNED NOT NULL;
# CREATE TABLE crm_recording_log LIKE recording_log;
# ALTER TABLE crm_recording_log MODIFY recording_id INT(10) UNSIGNED UNIQUE NOT NULL;
# ALTER TABLE crm_recording_log DROP PRIMARY KEY;
# CREATE TABLE crm_vicidial_user_log LIKE vicidial_user_log;
# ALTER TABLE crm_vicidial_user_log MODIFY user_log_id INT(9) UNSIGNED NOT NULL;
#
# Place in the crontab and run every day/week after one in the morning, or whenever
# your server is not busy with other tasks:
# 10 0 * * * /usr/share/astguiclient/CRM_log_manage.pl --populate-crm-only --days=2
# 30 1 * * 0 /usr/share/astguiclient/CRM_log_manage.pl --purge-crm-only --days=91
#
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 260117-0756 - First version, based on parts of VCA_log_manage script
#
$CALC_TEST=0;
$T=0; $TEST=0;
$DB=0; $DBX=0;
$populate_crm_only=0;
$archive_tables=0;
$purge_crm_only=0;
$POP_table[0] = 'vicidial_agent_log';
$POP_table[1] = 'vicidial_log';
$POP_table[2] = 'vicidial_closer_log';
$POP_table[3] = 'recording_log';
$POP_table[4] = 'vicidial_xfer_log';
$POP_table[5] = 'vicidial_user_log';
$POP_table[6] = 'call_log';
$POP_date[0] = 'event_time';
$POP_date[1] = 'call_date';
$POP_date[2] = 'call_date';
$POP_date[3] = 'start_time';
$POP_date[4] = 'call_date';
$POP_date[5] = 'event_date';
$POP_date[6] = 'start_time';
### 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 " [--days=XX] = number of days to populate or purge crm_ tables, default is 90\n";
print " [--populate-crm-only] = OPTIONAL, only populates crm_..._log tables then exits\n";
print " [--archive-tables] = OPTIONAL with --populate-crm-only only, use _archive tables for populate\n";
print " [--purge-crm-only] = OPTIONAL, only deletes crm_..._log tables records past number of days then exit\n";
print " [--quiet] = quiet\n";
print " [--calc-test] = date calculation test only\n";
print " [--test] = test\n";
print " [--debug] = debug output for some options\n";
print " [--debugX] = extra debug output for some options\n\n";
exit;
}
else
{
if ($args =~ /-quiet/i)
{
$q=1; $Q=1;
}
if ($args =~ /--test/i)
{
$T=1; $TEST=1;
print "\n-----TESTING-----\n\n";
}
if ($args =~ /--debug/i)
{
$DB=1;
print "\n-----DEBUG-----\n\n";
}
if ($args =~ /--debugX/i)
{
$DBX=1;
print "\n-----DEBUG X-----\n\n";
}
if ($args =~ /--calc-test/i)
{
$CALC_TEST=1;
print "\n-----DATE CALCULATION TESTING ONLY-----\n\n";
}
if ($args =~ /--days=/i)
{
@data_in = split(/--days=/,$args);
$CLIdays = $data_in[1];
$CLIdays =~ s/ .*$//gi;
$CLIdays =~ s/\D//gi;
if ($CLIdays > 999999)
{$CLIdays=730;}
if ($Q < 1)
{print "\n----- DAYS OVERRIDE: $CLIdays -----\n\n";}
}
if ($args =~ /--populate-crm-only/i)
{
$populate_crm_only++;
if ($Q < 1)
{print "\n----- POPULATE CRM LOG TABLES ONLY: |$populate_crm_only| -----\n\n";}
}
if ($args =~ /--purge-crm-only/i)
{
$purge_crm_only++;
if ($Q < 1)
{print "\n----- PURGE CRM LOG TABLES ONLY: |$purge_crm_only| -----\n\n";}
}
if ($args =~ /--archive-tables/i)
{
$archive_tables++;
if ($Q < 1)
{print "\n----- USE ARCHIVE TABLES ONLY: |$archive_tables| -----\n\n";}
}
}
}
else
{
print "no command line options set\n";
}
### end parsing run-time options ###
if (length($CLIdays)<1)
{
$CLIdays = 90;
}
$secX = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$del_epoch = ($secX - (86400 * $CLIdays)); # X days ago
($RMsec,$RMmin,$RMhour,$RMmday,$RMmon,$RMyear,$RMwday,$RMyday,$RMisdst) = localtime($del_epoch);
$RMyear = ($RMyear + 1900);
$RMmon++;
if ($RMmon < 10) {$RMmon = "0$RMmon";}
if ($RMmday < 10) {$RMmday = "0$RMmday";}
if ($RMhour < 10) {$RMhour = "0$RMhour";}
if ($RMmin < 10) {$RMmin = "0$RMmin";}
if ($RMsec < 10) {$RMsec = "0$RMsec";}
$del_time = "$RMyear-$RMmon-$RMmday $RMhour:$RMmin:$RMsec";
$del_date = "$RMyear-$RMmon-$RMmday";
if (!$Q) {print "\n\n-- CRM_log_manage.pl --\n\n";}
if (!$Q) {print "This program is designed manage the crm_..._log tables records, with \n";}
if (!$Q) {print "options to populate them and/or purge them at specific intevals.\n";}
if (!$Q) {print "$CLIdays days ( $del_time [$del_date]|$del_epoch ) from current date \n\n";}
if ($CALC_TEST > 0)
{
exit;
}
# 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;}
$i++;
}
# Customized Variables
$server_ip = $VARserver_ip; # Asterisk server IP
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;
if (!$T)
{
########## BEGIN --populate-crm-only flag processing ##########
if ($populate_crm_only > 0)
{
$i=0;
foreach(@POP_table)
{
$source_table = $POP_table[$i];
if ($archive_tables > 0)
{$source_table = $POP_table[$i]."_archive";}
if (!$Q) {print "Starting processing of populating $source_table table... $i\n";}
$stmtA = "SELECT count(*) from $source_table;";
$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;
$live_table_log_count = $aryA[0];
}
$sthA->finish();
$stmtA = "SELECT count(*) from crm_$POP_table[$i];";
$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;
$crm_table_log_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing population from $source_table table... ($live_table_log_count|$crm_table_log_count)\n";}
$stmtA = "INSERT IGNORE INTO crm_$POP_table[$i] SELECT * from $source_table where $POP_date[$i] > \"$del_time\";";
if ($DBX > 0) {print " DEBUG: |$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows inserted into crm_$POP_table[$i] table \n";}
$rv = $sthA->err();
if (!$rv)
{
$stmtA = "optimize table crm_$POP_table[$i];";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
if (!$Q) {print "\nProcessing $source_table table finished: ($sthArows rows inserted into crm_$POP_table[$i]) \n";}
$i++;
}
exit;
}
########## END --populate-crm-only flag processing ##########
########## BEGIN --purge-crm-only flag processing ##########
if ($purge_crm_only > 0)
{
$i=0;
foreach(@POP_table)
{
if (!$Q) {print "Starting processing purging of $POP_table[$i] table... $i\n";}
$stmtA = "SELECT count(*) from crm_$POP_table[$i];";
$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;
$crm_table_log_count = $aryA[0];
}
$sthA->finish();
if (!$Q) {print "\nProcessing purge of crm_$POP_table[$i] table... ($crm_table_log_count)\n";}
$stmtA = "DELETE FROM crm_$POP_table[$i] where $POP_date[$i] < \"$del_time\";";
if ($DBX > 0) {print " DEBUG: |$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows = $sthA->rows;
if (!$Q) {print "$sthArows rows deleted from crm_$POP_table[$i] table \n";}
$rv = $sthA->err();
if (!$rv)
{
$stmtA = "optimize table crm_$POP_table[$i];";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
}
if (!$Q) {print "\nProcessing $POP_table[$i] table finished: ($sthArows rows deleted from crm_$POP_table[$i]) \n";}
$i++;
}
exit;
}
########## END --purge-crm-only flag processing ##########
}
### calculate time to run script ###
$secY = time();
$secZ = ($secY - $secX);
$secZm = ($secZ /60);
if (!$Q) {print "\nscript execution time in seconds: $secZ minutes: $secZm\n";}
exit;
+12 -3
View File
@@ -137,6 +137,9 @@ $browser_alert_sounds_list = 'bark_dog,beep_double,beep_five,beep_up,bell_double
$HTMLcolors = 'IndianRed,CD5C5C|LightCoral,F08080|Salmon,FA8072|DarkSalmon,E9967A|LightSalmon,FFA07A|Crimson,DC143C|Red,FF0000|FireBrick,B22222|DarkRed,8B0000|Pink,FFC0CB|LightPink,FFB6C1|HotPink,FF69B4|DeepPink,FF1493|MediumVioletRed,C71585|PaleVioletRed,DB7093|LightSalmon,FFA07A|Coral,FF7F50|Tomato,FF6347|OrangeRed,FF4500|DarkOrange,FF8C00|Orange,FFA500|Gold,FFD700|Yellow,FFFF00|LightYellow,FFFFE0|LemonChiffon,FFFACD|LightGoldenrodYellow,FAFAD2|PapayaWhip,FFEFD5|Moccasin,FFE4B5|PeachPuff,FFDAB9|PaleGoldenrod,EEE8AA|Khaki,F0E68C|DarkKhaki,BDB76B|Lavender,E6E6FA|Thistle,D8BFD8|Plum,DDA0DD|Violet,EE82EE|Orchid,DA70D6|Fuchsia,FF00FF|Magenta,FF00FF|MediumOrchid,BA55D3|MediumPurple,9370DB|RebeccaPurple,663399|BlueViolet,8A2BE2|DarkViolet,9400D3|DarkOrchid,9932CC|DarkMagenta,8B008B|Purple,800080|Indigo,4B0082|SlateBlue,6A5ACD|DarkSlateBlue,483D8B|MediumSlateBlue,7B68EE|GreenYellow,ADFF2F|Chartreuse,7FFF00|LawnGreen,7CFC00|Lime,00FF00|LimeGreen,32CD32|PaleGreen,98FB98|LightGreen,90EE90|MediumSpringGreen,00FA9A|SpringGreen,00FF7F|MediumSeaGreen,3CB371|SeaGreen,2E8B57|ForestGreen,228B22|Green,008000|DarkGreen,006400|YellowGreen,9ACD32|OliveDrab,6B8E23|Olive,808000|DarkOliveGreen,556B2F|MediumAquamarine,66CDAA|DarkSeaGreen,8FBC8B|LightSeaGreen,20B2AA|DarkCyan,008B8B|Teal,008080|Aqua,00FFFF|Cyan,00FFFF|LightCyan,E0FFFF|PaleTurquoise,AFEEEE|Aquamarine,7FFFD4|Turquoise,40E0D0|MediumTurquoise,48D1CC|DarkTurquoise,00CED1|CadetBlue,5F9EA0|SteelBlue,4682B4|LightSteelBlue,B0C4DE|PowderBlue,B0E0E6|LightBlue,ADD8E6|SkyBlue,87CEEB|LightSkyBlue,87CEFA|DeepSkyBlue,00BFFF|DodgerBlue,1E90FF|CornflowerBlue,6495ED|MediumSlateBlue,7B68EE|RoyalBlue,4169E1|Blue,0000FF|MediumBlue,0000CD|DarkBlue,00008B|Navy,000080|MidnightBlue,191970|Cornsilk,FFF8DC|BlanchedAlmond,FFEBCD|Bisque,FFE4C4|NavajoWhite,FFDEAD|Wheat,F5DEB3|BurlyWood,DEB887|Tan,D2B48C|RosyBrown,BC8F8F|SandyBrown,F4A460|Goldenrod,DAA520|DarkGoldenrod,B8860B|Peru,CD853F|Chocolate,D2691E|SaddleBrown,8B4513|Sienna,A0522D|Brown,A52A2A|Maroon,800000|White,FFFFFF|Snow,FFFAFA|HoneyDew,F0FFF0|MintCream,F5FFFA|Azure,F0FFFF|AliceBlue,F0F8FF|GhostWhite,F8F8FF|WhiteSmoke,F5F5F5|SeaShell,FFF5EE|Beige,F5F5DC|OldLace,FDF5E6|FloralWhite,FFFAF0|Ivory,FFFFF0|AntiqueWhite,FAEBD7|Linen,FAF0E6|LavenderBlush,FFF0F5|MistyRose,FFE4E1|Gainsboro,DCDCDC|LightGray,D3D3D3|Silver,C0C0C0|DarkGray,A9A9A9|Gray,808080|DimGray,696969|LightSlateGray,778899|SlateGray,708090|DarkSlateGray,2F4F4F|Black,000000'; $HTMLcolors = 'IndianRed,CD5C5C|LightCoral,F08080|Salmon,FA8072|DarkSalmon,E9967A|LightSalmon,FFA07A|Crimson,DC143C|Red,FF0000|FireBrick,B22222|DarkRed,8B0000|Pink,FFC0CB|LightPink,FFB6C1|HotPink,FF69B4|DeepPink,FF1493|MediumVioletRed,C71585|PaleVioletRed,DB7093|LightSalmon,FFA07A|Coral,FF7F50|Tomato,FF6347|OrangeRed,FF4500|DarkOrange,FF8C00|Orange,FFA500|Gold,FFD700|Yellow,FFFF00|LightYellow,FFFFE0|LemonChiffon,FFFACD|LightGoldenrodYellow,FAFAD2|PapayaWhip,FFEFD5|Moccasin,FFE4B5|PeachPuff,FFDAB9|PaleGoldenrod,EEE8AA|Khaki,F0E68C|DarkKhaki,BDB76B|Lavender,E6E6FA|Thistle,D8BFD8|Plum,DDA0DD|Violet,EE82EE|Orchid,DA70D6|Fuchsia,FF00FF|Magenta,FF00FF|MediumOrchid,BA55D3|MediumPurple,9370DB|RebeccaPurple,663399|BlueViolet,8A2BE2|DarkViolet,9400D3|DarkOrchid,9932CC|DarkMagenta,8B008B|Purple,800080|Indigo,4B0082|SlateBlue,6A5ACD|DarkSlateBlue,483D8B|MediumSlateBlue,7B68EE|GreenYellow,ADFF2F|Chartreuse,7FFF00|LawnGreen,7CFC00|Lime,00FF00|LimeGreen,32CD32|PaleGreen,98FB98|LightGreen,90EE90|MediumSpringGreen,00FA9A|SpringGreen,00FF7F|MediumSeaGreen,3CB371|SeaGreen,2E8B57|ForestGreen,228B22|Green,008000|DarkGreen,006400|YellowGreen,9ACD32|OliveDrab,6B8E23|Olive,808000|DarkOliveGreen,556B2F|MediumAquamarine,66CDAA|DarkSeaGreen,8FBC8B|LightSeaGreen,20B2AA|DarkCyan,008B8B|Teal,008080|Aqua,00FFFF|Cyan,00FFFF|LightCyan,E0FFFF|PaleTurquoise,AFEEEE|Aquamarine,7FFFD4|Turquoise,40E0D0|MediumTurquoise,48D1CC|DarkTurquoise,00CED1|CadetBlue,5F9EA0|SteelBlue,4682B4|LightSteelBlue,B0C4DE|PowderBlue,B0E0E6|LightBlue,ADD8E6|SkyBlue,87CEEB|LightSkyBlue,87CEFA|DeepSkyBlue,00BFFF|DodgerBlue,1E90FF|CornflowerBlue,6495ED|MediumSlateBlue,7B68EE|RoyalBlue,4169E1|Blue,0000FF|MediumBlue,0000CD|DarkBlue,00008B|Navy,000080|MidnightBlue,191970|Cornsilk,FFF8DC|BlanchedAlmond,FFEBCD|Bisque,FFE4C4|NavajoWhite,FFDEAD|Wheat,F5DEB3|BurlyWood,DEB887|Tan,D2B48C|RosyBrown,BC8F8F|SandyBrown,F4A460|Goldenrod,DAA520|DarkGoldenrod,B8860B|Peru,CD853F|Chocolate,D2691E|SaddleBrown,8B4513|Sienna,A0522D|Brown,A52A2A|Maroon,800000|White,FFFFFF|Snow,FFFAFA|HoneyDew,F0FFF0|MintCream,F5FFFA|Azure,F0FFFF|AliceBlue,F0F8FF|GhostWhite,F8F8FF|WhiteSmoke,F5F5F5|SeaShell,FFF5EE|Beige,F5F5DC|OldLace,FDF5E6|FloralWhite,FFFAF0|Ivory,FFFFF0|AntiqueWhite,FAEBD7|Linen,FAF0E6|LavenderBlush,FFF0F5|MistyRose,FFE4E1|Gainsboro,DCDCDC|LightGray,D3D3D3|Silver,C0C0C0|DarkGray,A9A9A9|Gray,808080|DimGray,696969|LightSlateGray,778899|SlateGray,708090|DarkSlateGray,2F4F4F|Black,000000';
$reserved_extensions = '8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8320,8352,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8500,8501,138300,138301,138302,138303,138304,138305,138306,138307,138308,138309,138310,138311,138312,138313,138314,138315,138316,138317,138318,138319,138320,138321,138322,138323,138324,138325,138326,138327,138328,138329,138330,138331,138332,138333,138334,138335,138336,138337,138338,138339,138340,138341,138342,138343,138344,138345,138346,138347,138348,138349,138350,138351,138352,138353,138354,138355,138356,138357,138358,138359,138360,138361,138362,138363,138364,138365,138366,138367,138368,138369,138370,138371,138372,138373,138374,138375,138376,138377,138378,138379,138380,138381,138382,138383,138384,138385,138386,138387,138388,138389,138390,138391,138392,138393,138394,138395,138396,138397,138398,138399';
$reserved_extensions = ",$reserved_extensions,";
### BEGIN housecleaning of old static report files, if not done before ### ### BEGIN housecleaning of old static report files, if not done before ###
if (!file_exists('old_clear')) if (!file_exists('old_clear'))
{ {
@@ -6305,12 +6308,13 @@ if ($SSscript_remove_js > 0)
# 251204-0757 - Added SERVER DRIVE PARTITIONS display # 251204-0757 - Added SERVER DRIVE PARTITIONS display
# 251211-1134 - Added ADAPT_PERCENTMAX dial_method and adaptive_percentmax_percentage campaign setting # 251211-1134 - Added ADAPT_PERCENTMAX dial_method and adaptive_percentmax_percentage campaign setting
# 260106-1438 - Fixes for PHP8, 2026 date change # 260106-1438 - Fixes for PHP8, 2026 date change
# 260126-1335 - Added check of reserved_extensions against dialplan numbers when creating/modifying phones
# #
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 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 9 to access this page the first time
$admin_version = '2.14-951a'; $admin_version = '2.14-952a';
$build = '260106-1438'; $build = '260126-1335';
$STARTtime = date("U"); $STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s"); $SQLdate = date("Y-m-d H:i:s");
@@ -41413,6 +41417,11 @@ if ($ADD==31111111111)
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$tempdp = $row[1];
$reserved_dialplan_warning='';
if (preg_match("/,$tempdp,/",$reserved_extensions))
{$reserved_dialplan_warning="<font color=red><b> &nbsp; "._QXZ("WARNING: Reserved Dialplan Number")."!</b></font>\n";}
echo "<br>"._QXZ("MODIFY A PHONE RECORD").": $row[1]<form action=$PHP_SELF method=POST>\n"; echo "<br>"._QXZ("MODIFY A PHONE RECORD").": $row[1]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41111111111>\n"; echo "<input type=hidden name=ADD value=41111111111>\n";
echo "<input type=hidden name=old_extension value=\"$row[0]\">\n"; echo "<input type=hidden name=old_extension value=\"$row[0]\">\n";
@@ -41422,7 +41431,7 @@ if ($ADD==31111111111)
echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Phone Extension").": </td><td align=left><input type=text name=extension size=20 maxlength=100 value=\"$row[0]\">$NWB#phones-extension$NWE <i></i></td></tr>\n"; echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Phone Extension").": </td><td align=left><input type=text name=extension size=20 maxlength=100 value=\"$row[0]\">$NWB#phones-extension$NWE <i></i></td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Dial Plan Number").": </td><td align=left><input type=text name=dialplan_number size=15 maxlength=20 value=\"$row[1]\"> ("._QXZ("digits only").")$NWB#phones-dialplan_number$NWE</td></tr>\n"; echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Dial Plan Number").": </td><td align=left><input type=text name=dialplan_number size=15 maxlength=20 value=\"$row[1]\"> ("._QXZ("digits only").")$NWB#phones-dialplan_number$NWE$reserved_dialplan_warning</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Voicemail Box").": </td><td align=left><input type=text name=voicemail_id size=10 maxlength=10 value=\"$row[2]\"> ("._QXZ("digits only").")$NWB#phones-voicemail_id$NWE</td></tr>\n"; echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Voicemail Box").": </td><td align=left><input type=text name=voicemail_id size=10 maxlength=10 value=\"$row[2]\"> ("._QXZ("digits only").")$NWB#phones-voicemail_id$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Outbound CallerID").": </td><td align=left><input type=text name=outbound_cid size=10 maxlength=20 value=\"$row[65]\"> ("._QXZ("digits only").")$NWB#phones-outbound_cid$NWE</td></tr>\n"; echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Outbound CallerID").": </td><td align=left><input type=text name=outbound_cid size=10 maxlength=20 value=\"$row[65]\"> ("._QXZ("digits only").")$NWB#phones-outbound_cid$NWE</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Outbound Alt CallerID").": </td><td align=left><input type=text name=outbound_alt_cid size=10 maxlength=20 value=\"$row[100]\"> <i>"._QXZ("optional")."</i> ("._QXZ("digits only").")$NWB#phones-outbound_alt_cid$NWE</td></tr>\n"; echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Outbound Alt CallerID").": </td><td align=left><input type=text name=outbound_alt_cid size=10 maxlength=20 value=\"$row[100]\"> <i>"._QXZ("optional")."</i> ("._QXZ("digits only").")$NWB#phones-outbound_alt_cid$NWE</td></tr>\n";
@@ -1,4 +1,4 @@
# version: 20251205193301 # version: 20260126143901
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ> users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ> users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ> users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
@@ -936,7 +936,7 @@ list_loader-state_conversion State Abbreviation Lookup <QXZ>If your lead file ha
list_loader-required_phone_length Required Phone Number Length <QXZ>If enabled, this is the length in digits that phone numbers must be in order to be loaded into the system.</QXZ> list_loader-required_phone_length Required Phone Number Length <QXZ>If enabled, this is the length in digits that phone numbers must be in order to be loaded into the system.</QXZ>
list_loader-invalid_phone_override Invalid Phone Number Replacement <QXZ>If enabled, this option will try to replace an invalid phone_number lead value with either the alt_phone or address3 value in the same lead. This can be made active only in cases where the number is INVALID, and-or the number is a DUPLICATE, and-or the number is an International DNC match. The -empty-rep-value- options will set the replacement field to blank if it has been used to replace the phone_number for a lead. For example, if the phone_number is invalid and is replaced with a valid alt_phone, then the alt_phone field will be blank if one of the -empty-rep-value- options is used. Default is DISABLED.</QXZ> list_loader-invalid_phone_override Invalid Phone Number Replacement <QXZ>If enabled, this option will try to replace an invalid phone_number lead value with either the alt_phone or address3 value in the same lead. This can be made active only in cases where the number is INVALID, and-or the number is a DUPLICATE, and-or the number is an International DNC match. The -empty-rep-value- options will set the replacement field to blank if it has been used to replace the phone_number for a lead. For example, if the phone_number is invalid and is replaced with a valid alt_phone, then the alt_phone field will be blank if one of the -empty-rep-value- options is used. Default is DISABLED.</QXZ>
phones-extension Phone Extension <QXZ>This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone. For SIP, PJSIP and IAX phones, this field should not contain any dashes.</QXZ> phones-extension Phone Extension <QXZ>This field is where you put the phones name as it appears to Asterisk not including the protocol or slash at the beginning. For Example: for the SIP phone SIP/test101 the Phone extension would be test101. Also, for IAX2 phones: IAX2/IAXphone1@IAXphone1 would be IAXphone1. For Zap and Dahdi attached channelbank or FXS phones make sure you put the full channel number without the prefix: Zap/25-1 would be 25-1. Another note, make sure you set the Protocol field below correctly for your type of phone. For SIP, PJSIP and IAX phones, this field should not contain any dashes.</QXZ>
phones-dialplan_number Dial Plan Number <QXZ>This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server</QXZ> phones-dialplan_number Dial Plan Number <QXZ>This field is for the number you dial to have the phone ring. This number is defined in the extensions.conf file of your Asterisk server. If you get a Reserved Dialplan Number warning here, then you will not be able to dial this phone, so you should use another dialplan number. The reserved dialplan numbers are: <font size=1>8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8320 8352 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8500 8501 138300 138301 138302 138303 138304 138305 138306 138307 138308 138309 138310 138311 138312 138313 138314 138315 138316 138317 138318 138319 138320 138321 138322 138323 138324 138325 138326 138327 138328 138329 138330 138331 138332 138333 138334 138335 138336 138337 138338 138339 138340 138341 138342 138343 138344 138345 138346 138347 138348 138349 138350 138351 138352 138353 138354 138355 138356 138357 138358 138359 138360 138361 138362 138363 138364 138365 138366 138367 138368 138369 138370 138371 138372 138373 138374 138375 138376 138377 138378 138379 138380 138381 138382 138383 138384 138385 138386 138387 138388 138389 138390 138391 138392 138393 138394 138395 138396 138397 138398 138399</font></QXZ>
phones-voicemail_id Voicemail Box <QXZ>This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app.</QXZ> phones-voicemail_id Voicemail Box <QXZ>This field is for the voicemail box that the messages go to for the user of this phone. We use this to check for voicemail messages and for the user to be able to use the VOICEMAIL button on astGUIclient app.</QXZ>
phones-voicemail_timezone Voicemail Zone <QXZ>This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings.</QXZ> phones-voicemail_timezone Voicemail Zone <QXZ>This setting allows you to set the zone that this voicemail box will be set to when the time is logged for a message. Default is set in the System Settings.</QXZ>
phones-voicemail_options Voicemail Options <QXZ>This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing.</QXZ> phones-voicemail_options Voicemail Options <QXZ>This optional setting allows you to define additional voicemail settings. It is recommended that you leave this blank unless you know what you are doing.</QXZ>
+6 -2
View File
@@ -226,6 +226,7 @@
# 250620-1007 - Added apinewlead_url requests for add_lead when new leads are inserted # 250620-1007 - Added apinewlead_url requests for add_lead when new leads are inserted
# 250720-1841 - Added hopper_bulk_insert function # 250720-1841 - Added hopper_bulk_insert function
# 251205-1456 - Added ADAPT_PERCENTMAX dial_method # 251205-1456 - Added ADAPT_PERCENTMAX dial_method
# 260123-1020 - pause_sec fix in agent_stats_export
# #
$version = '2.14-202'; $version = '2.14-202';
@@ -12442,6 +12443,7 @@ if ($function == 'agent_stats_export')
$talk_sec = 0; $talk_sec = 0;
$dead_sec = 0; $dead_sec = 0;
$dispo_sec = 0; $dispo_sec = 0;
$pause_sec = 0;
} }
else else
{ {
@@ -12450,6 +12452,7 @@ if ($function == 'agent_stats_export')
$talk_sec = $AStalk_sec[$k]; $talk_sec = $AStalk_sec[$k];
$dead_sec = $ASdead_sec[$k]; $dead_sec = $ASdead_sec[$k];
$dispo_sec = $ASdispo_sec[$k]; $dispo_sec = $ASdispo_sec[$k];
$pause_sec = $ASpause_sec[$k];
} }
$avg_session_sec = round($avg_session_sec); $avg_session_sec = round($avg_session_sec);
$avg_pause_sec = round($avg_pause_sec); $avg_pause_sec = round($avg_pause_sec);
@@ -12466,16 +12469,17 @@ if ($function == 'agent_stats_export')
$talk_sec = sec_convert($talk_sec,$time_format); $talk_sec = sec_convert($talk_sec,$time_format);
$dead_sec = sec_convert($dead_sec,$time_format); $dead_sec = sec_convert($dead_sec,$time_format);
$dispo_sec = sec_convert($dispo_sec,$time_format); $dispo_sec = sec_convert($dispo_sec,$time_format);
$pause_sec = sec_convert($pause_sec,$time_format);
$avg_cust_sec = sec_convert($avg_cust_sec,$time_format); $avg_cust_sec = sec_convert($avg_cust_sec,$time_format);
$avg_wait_sec = sec_convert($avg_wait_sec,$time_format); $avg_wait_sec = sec_convert($avg_wait_sec,$time_format);
if ($group_by_campaign == 'YES') if ($group_by_campaign == 'YES')
{ {
$output .= "$AScampaign[$k]$DL$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n"; $output .= "$AScampaign[$k]$DL$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$pause_sec$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
} }
else else
{ {
$output .= "$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$ASpause_sec[$k]$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n"; $output .= "$ASuser[$k]$DL$ASfull_name[$k]$DL$ASuser_group[$k]$DL$AScalls[$k]$DL$login_sec$DL$cust_sec$DL$avg_cust_sec$DL$avg_wait_sec$DL$pct_of_queue%$DL$pause_sec$DL$ASsessions[$k]$DL$avg_session_sec$DL$ASpauses[$k]$DL$avg_pause_sec$DL$pct_pause%$DL$avg_pause_session$DL$wait_sec$DL$talk_sec$DL$dispo_sec$DL$dead_sec\n";
} }
$k++; $k++;
} }