Added carrier_description field, campaigns links from in-group screen, server links on reports page, agent ranks listing active only in admin.php

Moved non-optimize queries from DB_optimize script to the keepalive_ALL script and run them at the timeclock end of day

git-svn-id: svn://192.168.202.10@1252 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-10-31 17:24:54 +00:00
parent 6b47893808
commit 0b7a1b29cf
5 changed files with 440 additions and 365 deletions
+159 -18
View File
@@ -42,6 +42,8 @@
# 90821-1246 - Fixed central voicemail server conf file, changed voicemail to use phone password
# 90903-1626 - Added musiconhold and meetme conf file generation
# 90919-1516 - Added generation of standalone voicemail boxes in voicemail conf file
# 91028-1023 - Added clearing of daily-reset tables at the timeclock reset time
# 91031-1258 - Added carrier description comments
#
$DB=0; # Debug flag
@@ -485,7 +487,8 @@ if ($timeclock_auto_logout > 0)
################################################################################
##### START clear out non-used vicidial_conferences sessions
##### START clear out non-used vicidial_conferences sessions and reset daily
##### tally tables
################################################################################
# default path to astguiclient configuration file:
@@ -586,10 +589,142 @@ if ($timeclock_end_of_day_NOW > 0)
$k++;
}
if ($DB) {print "Starting clear out daily reset tables...\n";}
$secX = time();
$TDtarget = ($secX - 86000); # almost one day old
($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime($TDtarget);
$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";}
$TDSQLdate = "$Tyear-$Tmon-$Tmday $Thour:$Tmin:$Tsec";
$stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0', calls_today='0', answers_today='0', drops_today='0', drops_today_pct='0', drops_answers_today_pct='0', calls_hour='0', answers_hour='0', drops_hour='0', drops_hour_pct='0', calls_halfhour='0', answers_halfhour='0', drops_halfhour='0', drops_halfhour_pct='0', calls_fivemin='0', answers_fivemin='0', drops_fivemin='0', drops_fivemin_pct='0', calls_onemin='0', answers_onemin='0', drops_onemin='0', drops_onemin_pct='0', differential_onemin='0', agents_average_onemin='0', balance_trunk_fill='0', status_category_count_1='0', status_category_count_2='0', status_category_count_3='0', status_category_count_4='0';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_campaign_stats records reset|\n";}
$stmtA = "optimize table vicidial_campaign_stats;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "UPDATE vicidial_drop_rate_groups SET calls_today='0', answers_today='0', drops_today='0', drops_today_pct='0', drops_answers_today_pct='0';";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_campaign_stats records reset|\n";}
$stmtA = "optimize table vicidial_drop_rate_groups;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "delete from vicidial_campaign_server_stats;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_campaign_server_stats records deleted|\n";}
$stmtA = "optimize table vicidial_campaign_server_stats;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "update vicidial_inbound_group_agents SET calls_today=0;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_inbound_group_agents call counts reset|\n";}
$stmtA = "optimize table vicidial_inbound_group_agents;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "update vicidial_campaign_agents SET calls_today=0;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_campaign_agents call counts reset|\n";}
$stmtA = "optimize table vicidial_campaign_agents;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "delete from vicidial_live_inbound_agents where last_call_finish < \"$TDSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_inbound_agents old records deleted|\n";}
$stmtA = "update vicidial_live_inbound_agents SET calls_today=0;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_inbound_agents call counts reset|\n";}
$stmtA = "optimize table vicidial_live_inbound_agents;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "delete from vicidial_live_agents where last_state_change < \"$TDSQLdate\" and extension NOT LIKE \"R/%\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_live_agents old records deleted|\n";}
$stmtA = "optimize table vicidial_live_agents;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
$stmtA = "delete from vicidial_auto_calls where last_update_time < \"$TDSQLdate\";";
if($DBX){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA);
if($DB){print STDERR "\n|$affected_rows vicidial_auto_calls old records deleted|\n";}
$stmtA = "optimize table vicidial_auto_calls;";
if($DBX){print STDERR "\n|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
################################################################################
##### END clear out non-used vicidial_conferences sessions
##### END clear out non-used vicidial_conferences sessions and reset daily
##### tally tables
################################################################################
@@ -804,7 +939,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
##### BEGIN Generate the IAX carriers for this server_ip #####
$stmtA = "SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,globals_string,dialplan_entry FROM vicidial_server_carriers where server_ip='$server_ip' and active='Y' and protocol='IAX2' order by carrier_id;";
$stmtA = "SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,globals_string,dialplan_entry,carrier_description FROM vicidial_server_carriers where server_ip='$server_ip' and active='Y' and protocol='IAX2' order by carrier_id;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -812,13 +947,14 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
while ($sthArows > $i)
{
@aryA = $sthA->fetchrow_array;
$carrier_id[$i] = "$aryA[0]";
$carrier_name[$i] = "$aryA[1]";
$registration_string[$i] = "$aryA[2]";
$template_id[$i] = "$aryA[3]";
$account_entry[$i] = "$aryA[4]";
$globals_string[$i] = "$aryA[5]";
$dialplan_entry[$i] = "$aryA[6]";
$carrier_id[$i] = $aryA[0];
$carrier_name[$i] = $aryA[1];
$registration_string[$i] = $aryA[2];
$template_id[$i] = $aryA[3];
$account_entry[$i] = $aryA[4];
$globals_string[$i] = $aryA[5];
$dialplan_entry[$i] = $aryA[6];
$carrier_description[$i] = $aryA[7];
$i++;
}
$sthA->finish();
@@ -845,9 +981,11 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$iax .= "$registration_string[$i]\n";
$Lext .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n";
if (length($carrier_description[$i]) > 0) {$Lext .= "; $carrier_description[$i]\n";}
$Lext .= "$dialplan_entry[$i]\n";
$Liax .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n";
if (length($carrier_description[$i]) > 0) {$Liax .= "; $carrier_description[$i]\n";}
$Liax .= "$account_entry[$i]\n";
$Liax .= "$template_contents[$i]\n";
@@ -858,7 +996,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
##### BEGIN Generate the SIP carriers for this server_ip #####
$stmtA = "SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,globals_string,dialplan_entry FROM vicidial_server_carriers where server_ip='$server_ip' and active='Y' and protocol='SIP' order by carrier_id;";
$stmtA = "SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,globals_string,dialplan_entry,carrier_description FROM vicidial_server_carriers where server_ip='$server_ip' and active='Y' and protocol='SIP' order by carrier_id;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -866,13 +1004,14 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
while ($sthArows > $i)
{
@aryA = $sthA->fetchrow_array;
$carrier_id[$i] = "$aryA[0]";
$carrier_name[$i] = "$aryA[1]";
$registration_string[$i] = "$aryA[2]";
$template_id[$i] = "$aryA[3]";
$account_entry[$i] = "$aryA[4]";
$globals_string[$i] = "$aryA[5]";
$dialplan_entry[$i] = "$aryA[6]";
$carrier_id[$i] = $aryA[0];
$carrier_name[$i] = $aryA[1];
$registration_string[$i] = $aryA[2];
$template_id[$i] = $aryA[3];
$account_entry[$i] = $aryA[4];
$globals_string[$i] = $aryA[5];
$dialplan_entry[$i] = $aryA[6];
$carrier_description[$i] = $aryA[7];
$i++;
}
$sthA->finish();
@@ -899,9 +1038,11 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$sip .= "$registration_string[$i]\n";
$Lext .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n";
if (length($carrier_description[$i]) > 0) {$Lext .= "; $carrier_description[$i]\n";}
$Lext .= "$dialplan_entry[$i]\n";
$Lsip .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n";
if (length($carrier_description[$i]) > 0) {$Lsip .= "; $carrier_description[$i]\n";}
$Lsip .= "$account_entry[$i]\n";
$Lsip .= "$template_contents[$i]\n";
+224 -333
View File
@@ -19,6 +19,7 @@
# 90307-2025 - Added several new queries and rearranged update/deletes
# 90401-1335 - Added quiet and test flag functions
# 90628-2354 - Added vicidial_drop_rate_groups optimizations
# 91028-1028 - Removed non-optimize queries, they are placed in ADMIN_keepalive now and happen at timeclock reset time
#
# default path to astguiclient configuration file:
@@ -71,375 +72,265 @@ $q=0;
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
{
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
$i++;
}
{
$args = "$args $ARGV[$i]";
$i++;
}
if ($args =~ /--help/i)
{
print "allowed run time options:\n";
print " [-q] = quiet\n";
print " [-t] = test\n";
print " [-help] = this screen\n";
print "\n";
{
print "allowed run time options:\n";
print " [-q] = quiet\n";
print " [-t] = test\n";
print " [-help] = this screen\n";
print "\n";
exit;
}
exit;
}
else
{
{
if ($args =~ /-t/i)
{
$T=1;
}
{
$T=1;
}
if ($args =~ /-q/i)
{
$q=1;
$DB=0;
{
$q=1;
$DB=0;
}
}
}
}
else
{
print "no command line options set\n";
}
{
print "no command line options set\n";
}
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;
$stmtA = "optimize table call_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table park_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0', calls_today='0', answers_today='0', drops_today='0', drops_today_pct='0', drops_answers_today_pct='0', calls_hour='0', answers_hour='0', drops_hour='0', drops_hour_pct='0', calls_halfhour='0', answers_halfhour='0', drops_halfhour='0', drops_halfhour_pct='0', calls_fivemin='0', answers_fivemin='0', drops_fivemin='0', drops_fivemin_pct='0', calls_onemin='0', answers_onemin='0', drops_onemin='0', drops_onemin_pct='0', differential_onemin='0', agents_average_onemin='0', balance_trunk_fill='0', status_category_count_1='0', status_category_count_2='0', status_category_count_3='0', status_category_count_4='0';";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
if(!$q){print STDERR "\n|$affected_rows vicidial_campaign_stats records reset|\n";}
}
$stmtA = "optimize table vicidial_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_campaign_stats;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_closer_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "UPDATE vicidial_drop_rate_groups SET calls_today='0', answers_today='0', drops_today='0', drops_today_pct='0', drops_answers_today_pct='0';";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
if(!$q){print STDERR "\n|$affected_rows vicidial_campaign_stats records reset|\n";}
}
$stmtA = "optimize table vicidial_xfer_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_drop_rate_groups;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_list;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "delete from vicidial_campaign_server_stats;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
if(!$q){print STDERR "\n|$affected_rows vicidial_campaign_server_stats records deleted|\n";}
}
$stmtA = "optimize table vicidial_manager;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_campaign_server_stats;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_auto_calls;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "delete from vicidial_live_inbound_agents;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
if(!$q){print STDERR "\n|$affected_rows vicidial_live_inbound_agents records deleted|\n";}
}
$stmtA = "optimize table vicidial_live_agents;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_live_inbound_agents;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_dnc;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "update vicidial_inbound_group_agents SET calls_today=0;;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
if(!$q){print STDERR "\n|$affected_rows vicidial_inbound_group_agents call counts reset|\n";}
}
$stmtA = "optimize table vicidial_campaign_dnc;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_inbound_group_agents;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_callbacks;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "update vicidial_campaign_agents SET calls_today=0;;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
if(!$q){print STDERR "\n|$affected_rows vicidial_campaign_agents call counts reset|\n";}
}
$stmtA = "optimize table vicidial_agent_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_campaign_agents;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_conferences;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table call_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_hopper;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table servers;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table park_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_timeclock_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_timeclock_status;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T)
{
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_closer_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_xfer_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_list;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_manager;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_auto_calls;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_live_agents;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_dnc;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_campaign_dnc;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_callbacks;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_agent_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_conferences;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_hopper;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table servers;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_timeclock_log;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_timeclock_status;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$dbhA->disconnect();
$dbhA->disconnect();
exit;
+8
View File
@@ -596,3 +596,11 @@ ALTER TABLE vicidial_campaigns MODIFY use_internal_dnc ENUM('Y','N','AREACODE')
ALTER TABLE vicidial_campaigns MODIFY use_campaign_dnc ENUM('Y','N','AREACODE') default 'N';
UPDATE system_settings SET db_schema_version='1178',db_schema_update_date=NOW();
ALTER TABLE vicidial_server_carriers ADD carrier_description VARCHAR(255);
UPDATE system_settings SET db_schema_version='1179',db_schema_update_date=NOW();
@@ -342,6 +342,9 @@ Agent Choose Territories||
This option if set to 1 allows the user to choose the territories that they will receive calls from when they login to a MANUAL or INBOUND_MAN campaign. Otherwise the user will be set to use all of the territories that they are set to belong to in the User Territories administrative section||
The AREACODE option is just like the Y option, except it is used to also filter out an entire area code in North America from being dialed, in this case using the 201XXXXXXX entry in the DNC list would block all calls to the 201 areacode if enabled||
If you have the active DNC option set to AREACODE then you can also use area code wildcard entries like this 201XXXXXXX to block all calls to the 201 areacode when enabled||
Carrier Description||
This is put in the comments of the asterisk conf files above the dialplan and account entries. Maximum 255 characters||
CAMPAIGNS ALLOWING THIS IN-GROUP||
add-file: user_territories.php
+46 -14
View File
@@ -1131,6 +1131,9 @@ if (isset($_GET["agent_select_territories"])) {$agent_select_territories=$_GET
elseif (isset($_POST["agent_select_territories"])) {$agent_select_territories=$_POST["agent_select_territories"];}
if (isset($_GET["agent_choose_territories"])) {$agent_choose_territories=$_GET["agent_choose_territories"];}
elseif (isset($_POST["agent_choose_territories"])) {$agent_choose_territories=$_POST["agent_choose_territories"];}
if (isset($_GET["carrier_description"])) {$carrier_description=$_GET["carrier_description"];}
elseif (isset($_POST["carrier_description"])) {$carrier_description=$_POST["carrier_description"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
@@ -1720,6 +1723,11 @@ if ($non_latin < 1)
$tts_text = ereg_replace(";","",$tts_text);
$tts_text = ereg_replace("\r","",$tts_text);
$tts_text = ereg_replace("\"","",$tts_text);
$carrier_description = ereg_replace("\\\\","",$carrier_description);
$carrier_description = ereg_replace(";","",$carrier_description);
$carrier_description = ereg_replace("\r","",$carrier_description);
$carrier_description = ereg_replace("\"","",$carrier_description);
### VARIABLES TO BE mysql_real_escape_string ###
# $web_form_address
@@ -1978,11 +1986,12 @@ else
# 90924-1645 - Added list_id overrides for cid, am_message and drop in-group
# 90930-2107 - Added agent territory selection options for ViciDial agents
# 91026-1050 - Added AREACODE DNC option for campaigns
# 91031-1232 - Added carrier_description field, campaigns links from in-group screen, server links on reports page, agent ranks listing active only
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.2.0-221';
$build = '91026-1050';
$admin_version = '2.2.0-222';
$build = '91031-1232';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -5543,6 +5552,11 @@ if ($ADD==99999)
<BR>
<B>Carrier Name -</B> This is the descriptive name of the carrier entry.
<BR>
<A NAME="vicidial_server_carriers-carrier_description">
<BR>
<B>Carrier Description -</B> This is put in the comments of the asterisk conf files above the dialplan and account entries. Maximum 255 characters.
<BR>
<A NAME="vicidial_server_carriers-registration_string">
<BR>
@@ -7541,6 +7555,7 @@ if ($ADD==141111111111)
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier ID: </td><td align=left><input type=text name=carrier_id size=15 maxlength=15>$NWB#vicidial_server_carriers-carrier_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Name: </td><td align=left><input type=text name=carrier_name size=40 maxlength=50>$NWB#vicidial_server_carriers-carrier_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Description: </td><td align=left><input type=text name=carrier_description size=70 maxlength=255>$NWB#vicidial_server_carriers-carrier_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Registration String: </td><td align=left><input type=text name=registration_string size=50 maxlength=255>$NWB#vicidial_server_carriers-registration_string$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Template ID: </td><td align=left><select size=1 name=template_id>\n";
@@ -9843,7 +9858,7 @@ if ($ADD==241111111111)
{
echo "<br>CARRIER ADDED\n";
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');";
$stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N','$carrier_description');";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
@@ -12809,7 +12824,7 @@ if ($ADD==441111111111)
{echo "<br>CARRIER NOT MODIFIED - Please go back and look at the data you entered\n";}
else
{
$stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active' where carrier_id='$carrier_id';";
$stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active',carrier_description='$carrier_description' where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
@@ -16549,7 +16564,7 @@ if ($ADD==31)
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Click here to see all CallBack Holds in this campaign</a><BR><BR>\n";
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Click here to see Admin chages to this campaign</FONT>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Click here to see Admin chages to this campaign</a></FONT>\n";
}
echo "</b></center>\n";
}
@@ -17552,7 +17567,7 @@ if ($ADD==34)
echo "<a href=\"$PHP_SELF?ADD=81&campaign_id=$campaign_id\">Click here to see all CallBack Holds in this campaign</a><BR><BR>\n";
if ($LOGuser_level >= 9)
{
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Click here to see Admin chages to this campaign</FONT>\n";
echo "<br><br><a href=\"$PHP_SELF?ADD=720000000000000&category=CAMPAIGNS&stage=$campaign_id\">Click here to see Admin chages to this campaign</a></FONT>\n";
}
echo "</b></center>\n";
@@ -17562,10 +17577,10 @@ if ($ADD==34)
### list of agent rank or skill-level for this campaign
echo "<center>\n";
echo "<br><b>AGENT RANKS FOR THIS CAMPAIGN:</b><br>\n";
echo "<TABLE width=400 cellspacing=3>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>USER</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
$stmt="SELECT user,campaign_rank,calls_today from vicidial_campaign_agents where campaign_id='$campaign_id'";
$stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
@@ -17579,7 +17594,7 @@ if ($ADD==34)
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a></td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td></tr>\n";
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a> - $rowx[3]</td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td></tr>\n";
}
echo "</table></center><br>\n";
@@ -19267,10 +19282,10 @@ if ($ADD==3111)
### list of agent rank or skill-level for this inbound group
echo "<center>\n";
echo "<br><b>AGENT RANKS FOR THIS INBOUND GROUP:</b><br>\n";
echo "<TABLE width=400 cellspacing=3>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>USER</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
$stmt="SELECT user,group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id'";
$stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
@@ -19285,7 +19300,7 @@ if ($ADD==3111)
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a></td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td></tr>\n";
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a> - $rowx[3]</td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td></tr>\n";
}
echo "</table></center><br>\n";
@@ -19325,6 +19340,21 @@ if ($ADD==3111)
$o++;
}
echo "</TABLE><BR>\n";
echo "<B>CAMPAIGNS ALLOWING THIS IN-GROUP:</B><BR>\n";
echo "<TABLE>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";";
$rslt=mysql_query($stmt, $link);
$campin_to_print = mysql_num_rows($rslt);
$o=0;
while ($campin_to_print > $o)
{
$row=mysql_fetch_row($rslt);
echo "<TR><TD><a href=\"$PHP_SELF?ADD=31&campaign_id=$row[0]\">$row[0] </a></TD><TD> $row[1]<BR></TD></TR>\n";
$o++;
}
echo "</TABLE>\n";
if ($LOGdelete_ingroups > 0)
@@ -21293,7 +21323,7 @@ if ($ADD==341111111111)
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active from vicidial_server_carriers where carrier_id='$carrier_id';";
$stmt="SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description from vicidial_server_carriers where carrier_id='$carrier_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$carrier_id = $row[0];
@@ -21306,6 +21336,7 @@ if ($ADD==341111111111)
$dialplan_entry = $row[7];
$server_ip = $row[8];
$active = $row[9];
$carrier_description = $row[10];
echo "<br>MODIFY A CARRIER RECORD: $row[0]<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=441111111111>\n";
@@ -21314,6 +21345,7 @@ if ($ADD==341111111111)
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier ID: </td><td align=left><B>$carrier_id</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Name: </td><td align=left><input type=text name=carrier_name size=40 maxlength=50 value=\"$carrier_name\">$NWB#vicidial_server_carriers-carrier_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Carrier Description: </td><td align=left><input type=text name=carrier_description size=70 maxlength=255 value=\"$carrier_description\">$NWB#vicidial_server_carriers-carrier_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Registration String: </td><td align=left><input type=text name=registration_string size=50 maxlength=255 value=\"$registration_string\">$NWB#vicidial_server_carriers-registration_string$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=331111111111&template_id=$template_id\">Template ID</a>: </td><td align=left><select size=1 name=template_id>\n";
@@ -24054,7 +24086,7 @@ if ($ADD==999999)
}
$disk = "$disk%";
echo "<TR>\n";
echo "<TD>$server_id[$o]</TD>\n";
echo "<TD><a href=\"$PHP_SELF?ADD=311111111111&server_id=$server_id[$o]\">$server_id[$o]</a></TD>\n";
echo "<TD>$server_description[$o]</TD>\n";
echo "<TD>$server_ip[$o]</TD>\n";
echo "<TD>$active[$o]</TD>\n";