fixed bug on immediate disconnect calls within MANUAL dial campaigns

added midi files for real-time alert

git-svn-id: svn://192.168.202.10@1063 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-02-27 19:20:16 +00:00
parent 2ed2fe9c3e
commit 8461d033c1
11 changed files with 53 additions and 3 deletions
+1
View File
@@ -16,6 +16,7 @@ DC - Disconnected Number - Disconnected number
DEC - Declined Sale - Agent-defined status
DNC - DO NOT CALL - If defined, lead will also go int he VICIDIAL DNC list
DNCL - DO NOT CALL Hopper Match - status of a lead that matches the phone number of a lead that has been placed in the VICIDIAL DNC list
DNCC - DO NOT CALL Hopper Match Campaign- status of a lead that matches the phone number of a lead that has been placed in the VICIDIAL Campaign-specific DNC list for this Campaign
SALE - Sale Made - Agent-defined status
N - No Answer - Agent-defined status
NI - Not Interested - Agent-defined status
+36 -2
View File
@@ -188,7 +188,7 @@
$version = '2.0.5-100';
$build = '90128-0231';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=185;
$mysql_log_count=186;
$one_mysql_log=0;
require("dbconnect.php");
@@ -1363,7 +1363,7 @@ if (strlen($MDnextCID)<18)
else
{
##### look for the channel in the UPDATED vicidial_manager record of the call initiation
$stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;";
$stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status IN('UPDATED','DEAD') LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00052',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1420,6 +1420,10 @@ if ($stage == "start")
{
if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) )
{
$fp = fopen ("./vicidial_debug.txt", "a");
fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n");
fclose($fp);
echo "LOG NOT ENTERED\n";
echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign is not valid\n";
exit;
@@ -2040,6 +2044,36 @@ if ($stage == "end")
}
}
### check to see if the vicidial_log record exists, if not, insert it
$stmt="SELECT count(*) from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00186',$user,$server_ip,$session_name,$one_mysql_log);}
$VAC_vld_ct = mysql_num_rows($rslt);
if ($VAC_vld_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VLD_count = $row[0];
if ($VLD_count < 1)
{
##### insert log into vicidial_log for manual VICIDiaL call
$stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group,alt_dial) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','DONEM','$phone_code','$phone_number','$user','MANUAL','N','$user_group','$alt_dial');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00057',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($link);
if ($affected_rows > 0)
{
echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n";
echo "$StarTtime\n";
}
else
{
echo "LOG NOT ENTERED\n";
}
}
}
##### update the duration and end time in the vicidial_log table
$stmt="UPDATE vicidial_log set $SQLterm end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id' and user='$user' order by call_date desc limit 1;";
if ($DB) {echo "$stmt\n";}
+1 -1
View File
@@ -253,7 +253,7 @@ echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n";
echo "\n";
echo "---------- DROPS\n";
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);";
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status='DROP' and (length_in_sec <= 6000 or length_in_sec is null);";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -1042,6 +1042,21 @@ $parked_to_print = mysql_num_rows($rslt);
$i++;
}
##### MIDI alert audio file test #####
# $test_midi=1;
# if ($test_midi > 0)
# {
# # echo "<bgsound src=\"../vicidial/up_down.mid\" loop=\"-1\">";
# # echo "<embed src=\"../vicidial/up_down.mid\" loop=\"-1\">";
# echo "<object type=\"audio/x-midi\" data=\"../vicidial/up_down.mid\" width=200 height=20>";
# echo " <param name=\"src\" value=\"../vicidial/up_down.mid\">";
# echo " <param name=\"autoplay\" value=\"true\">";
# echo " <param name=\"autoStart\" value=\"1\">";
# echo " <param name=\"loop\" value=\"1\">";
# echo " alt : <a href=\"../vicidial/up_down.mid\">test.mid</a>";
# echo "</object>";
# }
if ($out_live > 0) {$F='<FONT class="r1">'; $FG='</FONT>';}
if ($out_live > 4) {$F='<FONT class="r2">'; $FG='</FONT>';}
if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.