2006-04-14_snapshot
git-svn-id: svn://192.168.202.10@3 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
# 50503-1236 added session_name checking for extra security
|
||||
# 50610-1158 Added NULL check on MySQL results to reduced errors
|
||||
# 50711-1202 removed HTTP authentication in favor of user/pass vars
|
||||
# 60323-1550 added option for showing different number dialed in log
|
||||
#
|
||||
|
||||
|
||||
@@ -45,9 +46,11 @@ $protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];}
|
||||
if (!$format) {$format="text";}
|
||||
if (!$in_limit) {$in_limit="100";}
|
||||
if (!$out_limit) {$out_limit="100";}
|
||||
$number_dialed = 'number_dialed';
|
||||
#$number_dialed = 'extension';
|
||||
|
||||
$version = '0.0.5';
|
||||
$build = '50711-1202';
|
||||
$version = '0.0.6';
|
||||
$build = '60323-1550';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -114,7 +117,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
else
|
||||
{
|
||||
##### print outbound calls from the call_log table
|
||||
$stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;";
|
||||
$stmt="SELECT uniqueid,start_time,$number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$out_calls_count = mysql_num_rows($rslt);}
|
||||
@@ -134,6 +137,7 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
|
||||
$call_time_MS = "$call_time_M_int:$call_time_SEC";
|
||||
|
||||
if ($number_dialed == 'extension') {$row[2] = substr($row[2],-10);}
|
||||
echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|";
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
# 50706-1525 Added date-time display for vicidial client display
|
||||
# 50816-1500 Added random update to vicidial_live_agents table for vdc users
|
||||
# 51121-1353 Altered echo statements for several small PHP speed optimizations
|
||||
# 60410-1424 Added ability to grab calls-being-placed and agent status
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -45,6 +46,7 @@ $client=$_GET["client"]; if (!$client) {$client=$_POST["client"];}
|
||||
$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];}
|
||||
$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];}
|
||||
$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];}
|
||||
$campagentstdisp=$_GET["campagentstdisp"]; if (!$campagentstdisp) {$campagentstdisp=$_POST["campagentstdisp"];}
|
||||
|
||||
# default optional vars if not set
|
||||
if (!$format) {$format="text";}
|
||||
@@ -132,9 +134,39 @@ echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
|
||||
$stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
|
||||
|
||||
if ($campagentstdisp == 'YES')
|
||||
{
|
||||
### grab the status of this agent to display
|
||||
$stmt="SELECT status,campaign_id from vicidial_live_agents where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$Astatus=$row[0];
|
||||
$Acampaign=$row[1];
|
||||
|
||||
### grab the number of calls being placed from this server and campaign
|
||||
$stmt="SELECT count(*) from vicidial_auto_calls where server_ip='$server_ip' and status NOT IN('XFER') and campaign_id='$Acampaign';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$RingCalls=$row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$Astatus='N';
|
||||
$RingCalls='N';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Astatus='N';
|
||||
$RingCalls='N';
|
||||
}
|
||||
|
||||
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n";
|
||||
echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n";
|
||||
|
||||
}
|
||||
$total_conf=0;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
### - $pass
|
||||
### optional variables:
|
||||
### - $format - ('text','debug')
|
||||
### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs')
|
||||
### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT')
|
||||
### - $stage - ('start','finish')
|
||||
### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -')
|
||||
### - $conf_exten - ('8600011',...)
|
||||
@@ -92,10 +92,13 @@
|
||||
# 60208-1617 Added dtmf buttons output per call
|
||||
# 60213-1521 Added closer_campaigns update to vicidial_users
|
||||
# 60215-1036 Added Callback date-time entry into vicidial_callbacks table
|
||||
# 60413-1541 Added USERONLY Callback listings output - CalLBacKLisT
|
||||
# Added USERONLY Callback count output - CalLBacKCounT
|
||||
# 60414-1140 Added Callback lead lookup for manual dialing
|
||||
#
|
||||
|
||||
$version = '0.0.26';
|
||||
$build = '60215-1036';
|
||||
$version = '0.0.28';
|
||||
$build = '60414-1140';
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -161,6 +164,7 @@ $agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"
|
||||
$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];}
|
||||
$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];}
|
||||
$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];}
|
||||
$callback_id=$_GET["callback_id"]; if (!$callback_id) {$callback_id=$_POST["callback_id"];}
|
||||
|
||||
|
||||
# default optional vars if not set
|
||||
@@ -172,6 +176,7 @@ $StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$CIDdate = date("mdHis");
|
||||
$ENTRYdate = date("YmdHis");
|
||||
if (!$query_date) {$query_date = $NOW_DATE;}
|
||||
$MT[0]='';
|
||||
|
||||
@@ -287,14 +292,42 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
}
|
||||
else
|
||||
{
|
||||
### grab the next lead in the hopper for this campaign and reserve it for the user
|
||||
$stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE
|
||||
if ( (strlen($callback_id)>0) && (strlen($lead_id)>0) )
|
||||
{
|
||||
$affected_rows=1;
|
||||
$CBleadIDset=1;
|
||||
|
||||
$stmt = "UPDATE vicidial_callbacks set status='INACTIVE' where callback_id='$callback_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($phone_number)>3)
|
||||
{
|
||||
### grab the next lead in the hopper for this campaign and reserve it for the user
|
||||
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='QUEUE',user='$user',called_since_last_reset='Y',entry_date='$ENTRYdate';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$lead_id = mysql_insert_id();
|
||||
$CBleadIDset=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
### grab the next lead in the hopper for this campaign and reserve it for the user
|
||||
$stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
}
|
||||
}
|
||||
|
||||
if ($affected_rows > 0)
|
||||
{
|
||||
if (!$CBleadIDset)
|
||||
{
|
||||
##### grab the lead_id of the reserved user in vicidial_hopper
|
||||
$stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -305,6 +338,7 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$lead_id =$row[0];
|
||||
}
|
||||
}
|
||||
|
||||
##### grab the data from vicidial_list for the lead_id
|
||||
$stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
|
||||
@@ -350,10 +384,13 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### delete the lead from the hopper
|
||||
$stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!$CBleadIDset)
|
||||
{
|
||||
### delete the lead from the hopper
|
||||
$stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
$stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
@@ -1274,6 +1311,59 @@ if ($ACTION == 'UpdatEFavoritEs')
|
||||
}
|
||||
|
||||
|
||||
################################################################################
|
||||
### CalLBacKLisT - List the USERONLY callbacks for an agent
|
||||
################################################################################
|
||||
if ($ACTION == 'CalLBacKLisT')
|
||||
{
|
||||
$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($rslt) {$callbacks_count = mysql_num_rows($rslt);}
|
||||
echo "$callbacks_count\n";
|
||||
$loop_count=0;
|
||||
while ($callbacks_count>$loop_count)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$callback_id[$loop_count] = $row[0];
|
||||
$lead_id[$loop_count] = $row[1];
|
||||
$campaign_id[$loop_count] = $row[2];
|
||||
$status[$loop_count] = $row[3];
|
||||
$entry_time[$loop_count] = $row[4];
|
||||
$callback_time[$loop_count] = $row[5];
|
||||
$comments[$loop_count] = $row[6];
|
||||
$loop_count++;
|
||||
}
|
||||
$loop_count=0;
|
||||
while ($callbacks_count>$loop_count)
|
||||
{
|
||||
$stmt = "select first_name,last_name,phone_number from vicidial_list where lead_id='$lead_id[$loop_count]';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
echo "$row[0] ~$row[1] ~$row[2] ~$callback_id[$loop_count] ~$lead_id[$loop_count] ~$campaign_id[$loop_count] ~$status[$loop_count] ~$entry_time[$loop_count] ~$callback_time[$loop_count] ~$comments[$loop_count]\n";
|
||||
$loop_count++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
################################################################################
|
||||
### CalLBacKCounT - send the count of the USERONLY callbacks for an agent
|
||||
################################################################################
|
||||
if ($ACTION == 'CalLBacKCounT')
|
||||
{
|
||||
$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$cbcount=$row[0];
|
||||
|
||||
echo "$cbcount";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($format=='debug')
|
||||
|
||||
+650
-99
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user