Added Active Voicemail Server and Auto Dial Limit to System Settings
Fixed agent manual dial logging bug Backported agent interface manual-dial blocking of agent monitoring git-svn-id: svn://192.168.202.10@1121 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -85,10 +85,11 @@
|
||||
# 90303-1144 - Fixed manual dial live hangup bug
|
||||
# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables
|
||||
# 90305-1040 - Added agent_dialed_number and type for user_call_log feature
|
||||
# 90511-1020 - Added restriction not allowing dialing into agent sessions from manual dial
|
||||
#
|
||||
|
||||
$version = '2.0.5-38';
|
||||
$build = '90305-1040';
|
||||
$version = '2.0.5-39';
|
||||
$build = '90511-1020';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=83;
|
||||
$one_mysql_log=0;
|
||||
@@ -376,40 +377,47 @@ if ($ACTION=="OriginateVDRelogin")
|
||||
}
|
||||
|
||||
if ($ACTION=="Originate")
|
||||
{
|
||||
{
|
||||
if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) )
|
||||
{
|
||||
echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($outbound_cid)>1)
|
||||
{$outCID = "\"$queryCID\" <$outbound_cid>";}
|
||||
else
|
||||
{$outCID = "$queryCID";}
|
||||
if ( ($usegroupalias > 0) and (strlen($account)>1) )
|
||||
{
|
||||
$RAWaccount = $account;
|
||||
$account = "Account: $account";
|
||||
$variable = "Variable: usegroupalias=1";
|
||||
echo "ERROR Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n";
|
||||
}
|
||||
else
|
||||
{$account=''; $variable='';}
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
echo "Originate command sent for Exten $exten Channel $channel on $server_ip |$account|$variable|\n";
|
||||
{
|
||||
if ( (eregi('MANUAL',$agent_dialed_type)) and ( (preg_match("/^\d860\d\d\d\d$/i",$exten)) or (preg_match("/^860\d\d\d\d$/i",$exten)) ) )
|
||||
{
|
||||
echo "ERROR You are not allowed to dial into other agent sessions $exten\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($agent_dialed_number > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$exten','$channel','0','$outbound_cid','$RAWaccount')";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
if (strlen($outbound_cid)>1)
|
||||
{$outCID = "\"$queryCID\" <$outbound_cid>";}
|
||||
else
|
||||
{$outCID = "$queryCID";}
|
||||
if ( ($usegroupalias > 0) and (strlen($account)>1) )
|
||||
{
|
||||
$RAWaccount = $account;
|
||||
$account = "Account: $account";
|
||||
$variable = "Variable: usegroupalias=1";
|
||||
}
|
||||
else
|
||||
{$account=''; $variable='';}
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
echo "Originate command sent for Exten $exten Channel $channel on $server_ip |$account|$variable|\n";
|
||||
|
||||
if ($agent_dialed_number > 0)
|
||||
{
|
||||
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$exten','$channel','0','$outbound_cid','$RAWaccount')";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -192,10 +192,11 @@
|
||||
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
|
||||
# 90307-1735 - Added Shift enforcement and manager override features
|
||||
# 90320-0306 - Fixed agent log bug when using wrapup time
|
||||
# 90519-0634 - Fixed manual dial status and logging bug
|
||||
#
|
||||
|
||||
$version = '2.0.5-104';
|
||||
$build = '90320-0306';
|
||||
$version = '2.0.5-105';
|
||||
$build = '90519-0634';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=194;
|
||||
$one_mysql_log=0;
|
||||
@@ -3296,7 +3297,7 @@ if ($ACTION == 'updateDISPO')
|
||||
}
|
||||
else
|
||||
{
|
||||
### update the comments in vicidial_live_agents record
|
||||
### reset the API fields in vicidial_live_agents record
|
||||
$stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='' where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -3311,12 +3312,20 @@ if ($ACTION == 'updateDISPO')
|
||||
$retry_count++;
|
||||
}
|
||||
|
||||
if ($auto_dial_level < 1)
|
||||
{
|
||||
$stmt = "UPDATE vicidial_live_agents set status='PAUSED',callerid='' where user='$user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00214',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
$stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt = "select count(*) from vicidial_inbound_groups where group_id='$stage';";
|
||||
$stmt = "SELECT count(*) from vicidial_inbound_groups where group_id='$stage';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3330,10 +3339,80 @@ if ($ACTION == 'updateDISPO')
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y")));
|
||||
|
||||
if ($auto_dial_level < 1)
|
||||
{
|
||||
$stmt = "SELECT count(*) from vicidial_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\";";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00213',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by uniqueid desc limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$VLlist_id = ''; $VLphone_number = ''; $VLphone_code = ''; $user_group='';
|
||||
$stmt = "SELECT user_group FROM vicidial_users where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00217',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VUinfo_ct = mysql_num_rows($rslt);
|
||||
if ($VUinfo_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user_group = "$row[0]";
|
||||
}
|
||||
|
||||
$stmt = "SELECT list_id,phone_number,phone_code FROM vicidial_list where lead_id='$lead_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00216',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$VLinfo_ct = mysql_num_rows($rslt);
|
||||
if ($VLinfo_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VLlist_id = "$row[0]";
|
||||
if (strlen($phone_number)<6)
|
||||
{
|
||||
$VLphone_number = "$row[1]";
|
||||
$VLalt = 'MAIN';
|
||||
}
|
||||
else
|
||||
{
|
||||
$VLphone_number = "$phone_number";
|
||||
if ($phone_number == "$row[1]")
|
||||
{$VLalt = 'MAIN';}
|
||||
else
|
||||
{$VLalt = 'ALT';}
|
||||
}
|
||||
if (strlen($phone_code)<1)
|
||||
{$VLphone_code = "$row[2]";}
|
||||
else
|
||||
{$VLphone_code = "$phone_code";}
|
||||
}
|
||||
|
||||
$PADlead_id = sprintf("%09s", $lead_id);
|
||||
while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);}
|
||||
$FAKEcall_id = "$StarTtime.$PADlead_id";
|
||||
$stmt = "INSERT INTO vicidial_log set uniqueid='$FAKEcall_id',lead_id='$lead_id',list_id='$VLlist_id',campaign_id='$campaign',call_date='$NOW_TIME',start_epoch='$StarTtime',end_epoch='$StarTtime',length_in_sec='0',status='$dispo_choice',phone_code='$VLphone_code',phone_number='$VLphone_number',user='$user',comments='MANUAL',processed='N',user_group='$user_group',term_reason='AGENT',alt_dial='$VLalt';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00215',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by uniqueid desc limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00145',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ($use_internal_dnc=='Y') and ($dispo_choice=='DNC') )
|
||||
@@ -3365,7 +3444,7 @@ if ($ACTION == 'updateDISPO')
|
||||
$dispo_sec=0;
|
||||
$dispo_epochSQL='';
|
||||
$StarTtime = date("U");
|
||||
$stmt = "select dispo_epoch,dispo_sec,talk_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
$stmt = "select dispo_epoch,dispo_sec,talk_epoch,wait_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3373,9 +3452,15 @@ if ($ACTION == 'updateDISPO')
|
||||
if ($VDpr_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( (eregi("NULL",$row[2])) or ($row[2] < 1000) )
|
||||
{
|
||||
$row[2]=$StarTtime;
|
||||
$wait_sec=($row[2] - $row[3]);
|
||||
$dispo_epochSQL = ",talk_epoch='$row[2]',wait_sec='$wait_sec'";
|
||||
}
|
||||
if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) )
|
||||
{
|
||||
$dispo_epochSQL=",dispo_epoch='$StarTtime'";
|
||||
$dispo_epochSQL .= ",dispo_epoch='$StarTtime'";
|
||||
$row[0]=$row[2];
|
||||
}
|
||||
$dispo_sec = (($StarTtime - $row[0]) + $row[1]);
|
||||
|
||||
@@ -224,10 +224,12 @@
|
||||
# 90307-1736 - Added Shift enforcement and manager override features
|
||||
# 90320-0309 - Fixed agent log bug when using wrapup time
|
||||
# 90323-1554 - Initial call to agent phone now has campaign callerIDnumber
|
||||
# 90511-1018 - Added restriction not allowing dialing into agent sessions from manual dial
|
||||
# 90519-0636 - Fixed manual dial status and logging bug
|
||||
#
|
||||
|
||||
$version = '2.0.5-203';
|
||||
$build = '90323-1554';
|
||||
$version = '2.0.5-205';
|
||||
$build = '90519-0636';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=60;
|
||||
$one_mysql_log=0;
|
||||
@@ -432,7 +434,7 @@ $camp_form_code .= "<option value=\"\"></option>\n";
|
||||
$LOGallowed_campaignsSQL='';
|
||||
if ($relogin == 'YES')
|
||||
{
|
||||
$stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'";
|
||||
$stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass';";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -486,7 +488,7 @@ if ($MGR_override > 0)
|
||||
}
|
||||
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -2814,6 +2816,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
// alert(VMCoriginate_query);
|
||||
// alert(xmlhttp.responseText);
|
||||
|
||||
var regBOerr = new RegExp("ERROR","g");
|
||||
var BOresponse = xmlhttp.responseText;
|
||||
if (BOresponse.match(regBOerr))
|
||||
{
|
||||
alert(BOresponse);
|
||||
}
|
||||
|
||||
if ((taskdialvalue.length > 0) && (tasknowait != 'YES'))
|
||||
{
|
||||
XDnextCID = queryCID;
|
||||
@@ -4057,6 +4066,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
MDlookResponse = xmlhttp.responseText;
|
||||
var MDlookResponse_array=MDlookResponse.split("\n");
|
||||
var MDlookCID = MDlookResponse_array[0];
|
||||
var regMDL = new RegExp("^Local","ig");
|
||||
if (MDlookCID == "NO")
|
||||
{
|
||||
MD_ring_secondS++;
|
||||
@@ -4073,7 +4083,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
else
|
||||
{
|
||||
var regMDL = new RegExp("^Local","ig");
|
||||
if (taskCheckOR == 'YES')
|
||||
{
|
||||
XDuniqueid = MDlookResponse_array[0];
|
||||
@@ -6155,12 +6164,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs;
|
||||
xmlhttp.open('POST', 'vdc_db_query.php');
|
||||
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&comments=" + CallBackCommenTs;
|
||||
xmlhttp.open('POST', 'vdc_db_query.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(DSupdate_query);
|
||||
xmlhttp.onreadystatechange = function()
|
||||
{
|
||||
// alert(DSupdate_query + "\n" +xmlhttp.responseText);
|
||||
|
||||
if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) )
|
||||
{
|
||||
var check_dispo = null;
|
||||
|
||||
Reference in New Issue
Block a user