in branch and trunk changed admin_modify_lead.php comments field to TEXTAREA

in trunk fixed recording_log vicidial_id logging issues in vicidial.php/manager_send.php/vdc_db_query.php

git-svn-id: svn://192.168.202.10@932 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-08-07 07:02:57 +00:00
parent 0ceb204008
commit c9c3c0f851
5 changed files with 60 additions and 12 deletions
@@ -25,6 +25,7 @@
# 80428-0144 - UTF8 cleanup # 80428-0144 - UTF8 cleanup
# 80516-0936 - Cleanup of logging changes, added vicidial_agent_log display # 80516-0936 - Cleanup of logging changes, added vicidial_agent_log display
# 80701-0832 - Changed to allow for altering of main phone number # 80701-0832 - Changed to allow for altering of main phone number
# 80805-2106 - Changed comments to TEXTAREA
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -487,7 +488,7 @@ else
echo "<tr><td align=right>Alt Phone : </td><td align=left><input type=text name=alt_phone size=20 maxlength=20 value=\"$alt_phone\"></td></tr>\n"; echo "<tr><td align=right>Alt Phone : </td><td align=left><input type=text name=alt_phone size=20 maxlength=20 value=\"$alt_phone\"></td></tr>\n";
echo "<tr><td align=right>Email : </td><td align=left><input type=text name=email size=30 maxlength=50 value=\"$email\"></td></tr>\n"; echo "<tr><td align=right>Email : </td><td align=left><input type=text name=email size=30 maxlength=50 value=\"$email\"></td></tr>\n";
echo "<tr><td align=right>Security : </td><td align=left><input type=text name=security size=30 maxlength=100 value=\"$security\"></td></tr>\n"; echo "<tr><td align=right>Security : </td><td align=left><input type=text name=security size=30 maxlength=100 value=\"$security\"></td></tr>\n";
echo "<tr><td align=right>Comments : </td><td align=left><input type=text name=comments size=30 maxlength=255 value=\"$comments\"></td></tr>\n"; echo "<tr><td align=right>Comments : </td><td align=left><TEXTAREA name=comments ROWS=3 COLS=65>$comments</TEXTAREA></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n";
$stmt="SELECT * from vicidial_statuses where selectable='Y' order by status"; $stmt="SELECT * from vicidial_statuses where selectable='Y' order by status";
+48 -5
View File
@@ -34,6 +34,7 @@
# - $CalLCID - ('VD01234567890123456',...) # - $CalLCID - ('VD01234567890123456',...)
# - $stage - ('UP','DOWN','2NDXfeR') # - $stage - ('UP','DOWN','2NDXfeR')
# - $session_id - ('8600051') # - $session_id - ('8600051')
# - $FROMvdc - ('YES','NO')
# CHANGELOG: # CHANGELOG:
# 50401-1002 - First build of script, Hangup function only # 50401-1002 - First build of script, Hangup function only
@@ -143,6 +144,8 @@ if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["all
elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];}
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];}
elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];}
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -1255,6 +1258,8 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
else else
{ {
$VDvicidial_id='';
if ($ACTION=="MonitorConf") if ($ACTION=="MonitorConf")
{ {
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');";
@@ -1264,12 +1269,50 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") )
$stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')"; $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$RLaffected_rows = mysql_affected_rows($link);
if ($RLaffected_rows > 0)
{
$recording_id = mysql_insert_id($link);
}
$stmt="SELECT recording_id FROM recording_log where filename='$filename'"; if ($FROMvdc=='YES')
$rslt=mysql_query($stmt, $link); {
if ($DB) {echo "$stmt\n";} ##### get call type from vicidial_live_agents table
$row=mysql_fetch_row($rslt); $VLA_inOUT='NONE';
$recording_id = $row[0]; $stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VLA_inOUT_ct = mysql_num_rows($rslt);
if ($VLA_inOUT_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VLA_inOUT = $row[0];
}
if ($VLA_inOUT == 'INBOUND')
{
$four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y")));
##### look for the vicidial ID in the vicidial_closer_log table
$stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;";
}
else
{
##### look for the vicidial ID in the vicidial_log table
$stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';";
}
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VM_mancall_ct = mysql_num_rows($rslt);
if ($VM_mancall_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VDvicidial_id = $row[0];
$stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
}
}
} }
else else
{ {
+7 -4
View File
@@ -1544,7 +1544,7 @@ if ($stage == "end")
} }
} }
if ($VLA_inOUT == 'AUTO') if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') )
{ {
$SQLterm = "term_reason='$term_reason',"; $SQLterm = "term_reason='$term_reason',";
@@ -1676,7 +1676,7 @@ if ($stage == "end")
echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|";
if (strlen($filename)>2) if (strlen($filename)>2)
{ {
$stmt="SELECT recording_id,start_epoch,vicidial_id FROM recording_log where filename='$filename[$loop_count]'"; $stmt="SELECT recording_id,start_epoch,vicidial_id,lead_id FROM recording_log where filename='$filename[$loop_count]'";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($rslt) {$fn_count = mysql_num_rows($rslt);} if ($rslt) {$fn_count = mysql_num_rows($rslt);}
@@ -1686,7 +1686,10 @@ if ($stage == "end")
$recording_id = $row[0]; $recording_id = $row[0];
$start_time = $row[1]; $start_time = $row[1];
$vicidial_id = $row[2]; $vicidial_id = $row[2];
$RClead_id = $row[3];
if ( (strlen($RClead_id)<1) or ($RClead_id < 1) or ($RClead_id=='NULL') )
{$lidSQL = ",lead_id='$lead_id'";}
if (strlen($vicidial_id)<1) if (strlen($vicidial_id)<1)
{$vidSQL = ",vicidial_id='$VDvicidial_id'";} {$vidSQL = ",vicidial_id='$VDvicidial_id'";}
else else
@@ -1705,14 +1708,14 @@ if ($stage == "end")
$length_in_min = ($length_in_sec / 60); $length_in_min = ($length_in_sec / 60);
$length_in_min = sprintf("%8.2f", $length_in_min); $length_in_min = sprintf("%8.2f", $length_in_min);
$stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;"; $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' $vidSQL $lidSQL where filename='$filename[$loop_count]' and end_epoch is NULL;";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
echo "$recording_id|$length_in_min|"; echo "$recording_id|$length_in_min|";
$fp = fopen ("./recording_debug_$NOW_DATE$txt", "a"); $fp = fopen ("./recording_debug_$NOW_DATE$txt", "a");
fwrite ($fp, "$NOW_TIME|RECORD_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n"); fwrite ($fp, "$NOW_TIME|RECORD_LOG|$filename[$loop_count]|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|$VDIDselect|\n");
fclose($fp); fclose($fp);
} }
else {echo "||";} else {echo "||";}
+1 -1
View File
@@ -2721,7 +2721,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
document.getElementById("RecorDControl").innerHTML = conf_rec_start_html; document.getElementById("RecorDControl").innerHTML = conf_rec_start_html;
} }
} }
confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&uniqueid=" + tmp_vicidial_id; confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id;
xmlhttp.open('POST', 'manager_send.php'); xmlhttp.open('POST', 'manager_send.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(confmonitor_query); xmlhttp.send(confmonitor_query);
@@ -26,6 +26,7 @@
# 80501-0454 - Added Hangup Reason to logs display # 80501-0454 - Added Hangup Reason to logs display
# 80516-0936 - Cleanup of logging changes, added vicidial_agent_log display # 80516-0936 - Cleanup of logging changes, added vicidial_agent_log display
# 80701-0832 - Changed to allow for altering of main phone number # 80701-0832 - Changed to allow for altering of main phone number
# 80805-2106 - Changed comments to TEXTAREA
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -488,7 +489,7 @@ else
echo "<tr><td align=right>Alt Phone : </td><td align=left><input type=text name=alt_phone size=20 maxlength=20 value=\"$alt_phone\"></td></tr>\n"; echo "<tr><td align=right>Alt Phone : </td><td align=left><input type=text name=alt_phone size=20 maxlength=20 value=\"$alt_phone\"></td></tr>\n";
echo "<tr><td align=right>Email : </td><td align=left><input type=text name=email size=30 maxlength=50 value=\"$email\"></td></tr>\n"; echo "<tr><td align=right>Email : </td><td align=left><input type=text name=email size=30 maxlength=50 value=\"$email\"></td></tr>\n";
echo "<tr><td align=right>Security : </td><td align=left><input type=text name=security size=30 maxlength=100 value=\"$security\"></td></tr>\n"; echo "<tr><td align=right>Security : </td><td align=left><input type=text name=security size=30 maxlength=100 value=\"$security\"></td></tr>\n";
echo "<tr><td align=right>Comments : </td><td align=left><input type=text name=comments size=30 maxlength=255 value=\"$comments\"></td></tr>\n"; echo "<tr><td align=right>Comments : </td><td align=left><TEXTAREA name=comments ROWS=3 COLS=65>$comments</TEXTAREA></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Disposition: </td><td align=left><select size=1 name=status>\n";
$stmt="SELECT * from vicidial_statuses where selectable='Y' order by status"; $stmt="SELECT * from vicidial_statuses where selectable='Y' order by status";