Added post_phone_time_diff_alert feature to give an alert on manual dial campaigns if the phone number area code and the postal code are in different time zones, or if either of them are outside of the local call time for the campaign. Viewable in preview mode as well as lead info viewing from the callbacks list, the call log and search results in the agent interface.

git-svn-id: svn://192.168.202.10@1650 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-05-01 01:52:18 +00:00
parent 07008fe0b3
commit cbe6d30bc0
7 changed files with 236 additions and 33 deletions
+7
View File
@@ -546,6 +546,13 @@ OTHER CHANGES:
123. Added ability to use external_dial Agent API function with a defined
lead_id and optional alt_dial setting
124. Added feature to give an alert on manual dial campaigns if the phone number
area code and the postal code are in different time zones, or if either
of them are outside of the local call time for the campaign. Viewable in
preview mode as well as lead info viewing from the callbacks list, the
call log and search results in the agent interface.
+3 -2
View File
@@ -799,7 +799,8 @@ queuemetrics_phone_environment VARCHAR(20) default '',
auto_pause_precall ENUM('Y','N') default 'N',
auto_pause_precall_code VARCHAR(6) default 'PRECAL',
auto_resume_precall ENUM('Y','N') default 'N',
manual_dial_cid ENUM('CAMPAIGN','AGENT_PHONE') default 'CAMPAIGN'
manual_dial_cid ENUM('CAMPAIGN','AGENT_PHONE') default 'CAMPAIGN',
post_phone_time_diff_alert VARCHAR(30) default 'DISABLED'
);
CREATE TABLE vicidial_lists (
@@ -2459,7 +2460,7 @@ ALTER TABLE vicidial_lead_search_log_archive MODIFY search_log_id INT(9) UNSIGNE
CREATE TABLE vicidial_closer_log_archive LIKE vicidial_closer_log;
ALTER TABLE vicidial_closer_log_archive MODIFY closecallid INT(9) UNSIGNED NOT NULL;
UPDATE system_settings SET db_schema_version='1272',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1273',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+4
View File
@@ -748,3 +748,7 @@ CREATE TABLE vicidial_closer_log_archive LIKE vicidial_closer_log;
ALTER TABLE vicidial_closer_log_archive MODIFY closecallid INT(9) UNSIGNED NOT NULL;
UPDATE system_settings SET db_schema_version='1272',db_schema_update_date=NOW();
ALTER TABLE vicidial_campaigns ADD post_phone_time_diff_alert VARCHAR(30) default 'DISABLED';
UPDATE system_settings SET db_schema_version='1273',db_schema_update_date=NOW();
@@ -562,6 +562,8 @@ Using MULTI_LEAD allows you to use a separate lead for each number on a customer
Manual Dial CID||
This defines whether an agent making manual dial calls will have the campaign callerID settings used, or their agent phone callerID settings used. Default is CAMPAIGN||
If the Use Custom CID campaign option is enabled or the list Campaign CID Override setting is used, this setting will be ignored||
Phone Post Time Difference Alert||
This manual-dial-only feature, if enabled, will display an alert if the time zone for the lead postal code, or zip code, is different from the time zone of the area code of the phone number for the lead. The OUTSIDE_CALLTIME_ONLY option will only show the alert if the two time zones are different and one of the time zones is outside of the call time selected for the campaign. OUTSIDE_CALLTIME_PHONE will only check the time zone of the phone number of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_POSTAL will only check the time zone of the postal code of the lead and alert if it is outside of the local call time. OUTSIDE_CALLTIME_BOTH will check the postal code and phone number for being within the local call time, even if they are in the same time zone. These alerts will show in the call log info, callbacks list info, search results info, when a lead is dialed and when a lead is previewed. Default is DISABLED||
admin_campaign_multi_alt.php
@@ -615,6 +617,9 @@ rings all available agents until one picks up the phone||
No calls for this lead||
ADMINISTRATION: Campaign Multi-Alt-Leads||
Multi-Lead Auto Alt Dialing Settings Form||
Time Zone Warning||
Phone Area Code Outside Dialable Zone||
Postal Code Outside Dialable Zone||
############################################################ MANAGER Manual
+168 -24
View File
@@ -282,12 +282,13 @@
# 110310-1628 - removed callslogview, extended lead info function to be used instead
# 110317-0222 - Logging bug fixes
# 110413-1245 - Added ALT dialing from scheduled callback list
# 110430-1925 - Added post_phone_time_diff_alert campaign feature
#
$version = '2.4-187';
$build = '110413-1245';
$version = '2.4-188';
$build = '110430-1925';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=413;
$mysql_log_count=415;
$one_mysql_log=0;
require("dbconnect.php");
@@ -502,6 +503,43 @@ $US='_';
while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);}
$check_time = ($StarTtime - 86400);
$secX = date("U");
$hour = date("H");
$min = date("i");
$sec = date("s");
$mon = date("m");
$mday = date("d");
$year = date("Y");
$isdst = date("I");
$Shour = date("H");
$Smin = date("i");
$Ssec = date("s");
$Smon = date("m");
$Smday = date("d");
$Syear = date("Y");
### Grab Server GMT value from the database
$stmt="SELECT local_gmt FROM servers where active='Y' limit 1;";
$rslt=mysql_query($stmt, $link);
$gmt_recs = mysql_num_rows($rslt);
if ($gmt_recs > 0)
{
$row=mysql_fetch_row($rslt);
$DBSERVER_GMT = $row[0];
if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;}
if ($isdst) {$SERVER_GMT++;}
}
else
{
$SERVER_GMT = date("O");
$SERVER_GMT = eregi_replace("\+","",$SERVER_GMT);
$SERVER_GMT = ($SERVER_GMT + 0);
$SERVER_GMT = ($SERVER_GMT / 100);
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
##### Hangup Cause Dictionary #####
$hangup_cause_dictionary = array(
0 => "Unspecified. No other cause codes applicable.",
@@ -1256,27 +1294,6 @@ if ($ACTION == 'manDiaLnextCaLL')
$inSD = $pulldate0;
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
### Grab Server GMT value from the database
$stmt="SELECT local_gmt FROM servers where active='Y' limit 1;";
$rslt=mysql_query($stmt, $link);
$gmt_recs = mysql_num_rows($rslt);
if ($gmt_recs > 0)
{
$row=mysql_fetch_row($rslt);
$DBSERVER_GMT = $row[0];
if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;}
if ($isdst) {$SERVER_GMT++;}
}
else
{
$SERVER_GMT = date("O");
$SERVER_GMT = eregi_replace("\+","",$SERVER_GMT);
$SERVER_GMT = ($SERVER_GMT + 0);
$SERVER_GMT = ($SERVER_GMT / 100);
}
$LOCAL_GMT_OFF = $SERVER_GMT;
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
$postalgmt='';
$postal_code='';
$state='';
@@ -1297,6 +1314,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
### get current gmt_offset of the phone_number
$USarea = substr($phone_number, 0, 3);
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code);
$dialable = dialable_gmt($DB,$link,$local_call_time,$gmt_offset,$state);
@@ -2084,6 +2102,65 @@ if ($ACTION == 'manDiaLnextCaLL')
{$agent_dialed_number = $address3;}
}
##### BEGIN check for postal_code and phone time zones if alert enabled
$post_phone_time_diff_alert_message='';
$stmt="SELECT post_phone_time_diff_alert,local_call_time FROM vicidial_campaigns where campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00414',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$camp_pptda_ct = mysql_num_rows($rslt);
if ($camp_pptda_ct > 0)
{
$row=mysql_fetch_row($rslt);
$post_phone_time_diff_alert = $row[0];
$local_call_time = $row[1];
}
if ( ($post_phone_time_diff_alert == 'ENABLED') or (preg_match("/OUTSIDE_CALLTIME/",$post_phone_time_diff_alert)) )
{
### get current gmt_offset of the phone_number
$postalgmtNOW = '';
$USarea = substr($agent_dialed_number, 0, 3);
$PHONEgmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmtNOW,$postal_code);
$PHONEdialable = dialable_gmt($DB,$link,$local_call_time,$PHONEgmt_offset,$state);
$postalgmtNOW = 'POSTAL';
$POSTgmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmtNOW,$postal_code);
$POSTdialable = dialable_gmt($DB,$link,$local_call_time,$POSTgmt_offset,$state);
# $post_phone_time_diff_alert_message = "$POSTgmt_offset|$POSTdialable --- $PHONEgmt_offset|$PHONEdialable|$USarea";
$post_phone_time_diff_alert_message = '';
if ($PHONEgmt_offset != $POSTgmt_offset)
{
$post_phone_time_diff_alert_message .= "Phone and Post Code Time Zone Mismatch! ";
if ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_ONLY')
{
$post_phone_time_diff_alert_message='';
if ($PHONEdialable < 1)
{$post_phone_time_diff_alert_message .= " Phone Area Code Outside Dialable Zone $PHONEgmt_offset ";}
if ($POSTdialable < 1)
{$post_phone_time_diff_alert_message .= " Postal Code Outside Dialable Zone $POSTgmt_offset";}
}
}
if ( ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_PHONE') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_POSTAL') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_BOTH') )
{$post_phone_time_diff_alert_message = '';}
if ( ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_PHONE') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_BOTH') )
{
if ($PHONEdialable < 1)
{$post_phone_time_diff_alert_message .= " Phone Area Code Outside Dialable Zone $PHONEgmt_offset ";}
}
if ( ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_POSTAL') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_BOTH') )
{
if ($POSTdialable < 1)
{$post_phone_time_diff_alert_message .= " Postal Code Outside Dialable Zone $POSTgmt_offset ";}
}
}
##### END check for postal_code and phone time zones if alert enabled
##### check if system is set to generate logfile for transfers
$stmt="SELECT enable_agc_xfer_log FROM system_settings;";
$rslt=mysql_query($stmt, $link);
@@ -2604,6 +2681,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$LeaD_InfO .= $custom_field_types . "\n";
$LeaD_InfO .= $LISTweb_form_address . "\n";
$LeaD_InfO .= $LISTweb_form_address_two . "\n";
$LeaD_InfO .= $post_phone_time_diff_alert_message . "\n";
echo $LeaD_InfO;
}
@@ -8681,6 +8759,7 @@ if ($ACTION == 'LEADINFOview')
if (strlen($row[18])>0) {$label_comments = $row[18];}
### END find any custom field labels ###
$INFOout .= "<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 WIDTH=500>";
$stmt="select status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='$lead_id' limit 1;";
@@ -8692,6 +8771,71 @@ if ($ACTION == 'LEADINFOview')
if ($info_to_print > 0)
{
$row=mysql_fetch_row($rslt);
##### BEGIN check for postal_code and phone time zones if alert enabled
$post_phone_time_diff_alert_message='';
$stmt="SELECT post_phone_time_diff_alert,local_call_time FROM vicidial_campaigns where campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00415',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$camp_pptda_ct = mysql_num_rows($rslt);
if ($camp_pptda_ct > 0)
{
$rowx=mysql_fetch_row($rslt);
$post_phone_time_diff_alert = $rowx[0];
$local_call_time = $rowx[1];
}
if ( ($post_phone_time_diff_alert == 'ENABLED') or (preg_match("/OUTSIDE_CALLTIME/",$post_phone_time_diff_alert)) )
{
$postal_code = $row[17];
$phone_code = $row[5];
$phone_number = $row[6];
$state = $row[15];
### get current gmt_offset of the phone_number
$postalgmtNOW = '';
$USarea = substr($phone_number, 0, 3);
$PHONEgmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmtNOW,$postal_code);
$PHONEdialable = dialable_gmt($DB,$link,$local_call_time,$PHONEgmt_offset,$state);
$postalgmtNOW = 'POSTAL';
$POSTgmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmtNOW,$postal_code);
$POSTdialable = dialable_gmt($DB,$link,$local_call_time,$POSTgmt_offset,$state);
# $post_phone_time_diff_alert_message = "$POSTgmt_offset|$POSTdialable|$postal_code --- $PHONEgmt_offset|$PHONEdialable|$USarea";
$post_phone_time_diff_alert_message = '';
if ($PHONEgmt_offset != $POSTgmt_offset)
{
$post_phone_time_diff_alert_message .= "Phone and Post Code Time Zone Mismatch! ";
if ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_ONLY')
{
$post_phone_time_diff_alert_message='';
if ($PHONEdialable < 1)
{$post_phone_time_diff_alert_message .= " Phone Area Code Outside Dialable Zone $PHONEgmt_offset &nbsp; &nbsp; &nbsp; ";}
if ($POSTdialable < 1)
{$post_phone_time_diff_alert_message .= " Postal Code Outside Dialable Zone $POSTgmt_offset";}
}
}
if ( ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_PHONE') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_POSTAL') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_BOTH') )
{$post_phone_time_diff_alert_message = '';}
if ( ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_PHONE') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_BOTH') )
{
if ($PHONEdialable < 1)
{$post_phone_time_diff_alert_message .= " Phone Area Code Outside Dialable Zone $PHONEgmt_offset &nbsp; &nbsp; &nbsp; ";}
}
if ( ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_POSTAL') or ($post_phone_time_diff_alert == 'OUTSIDE_CALLTIME_BOTH') )
{
if ($POSTdialable < 1)
{$post_phone_time_diff_alert_message .= " Postal Code Outside Dialable Zone $POSTgmt_offset ";}
}
if (strlen($post_phone_time_diff_alert_message)>5)
{$INFOout .= "<tr bgcolor=white><td colspan=2 align=center><font size=2 color=red><b>$post_phone_time_diff_alert_message</b></font></td></tr>";}
}
##### END check for postal_code and phone time zones if alert enabled
$INFOout .= "<tr bgcolor=white><td ALIGN=right><font size=2>Status: &nbsp; </td><td ALIGN=left><font size=2>$row[0]</td></tr>";
$INFOout .= "<tr bgcolor=white><td ALIGN=right><font size=2>$label_vendor_lead_code: &nbsp; </td><td ALIGN=left><font size=2>$row[1]</td></tr>";
$INFOout .= "<tr bgcolor=white><td ALIGN=right><font size=2>List ID: &nbsp; </td><td ALIGN=left><font size=2>$row[2]</td></tr>";
+32 -2
View File
@@ -347,10 +347,11 @@
# 110420-1211 - Added web_vars variable
# 110428-1549 - Added use of manual_dial_cid setting
# 110430-1126 - Added ability to use external_dial API function with lead_id and alt_dial options
# 110430-1924 - Added post_phone_time_diff_alert campaign feature
#
$version = '2.4-324c';
$build = '110430-1126';
$version = '2.4-325c';
$build = '110430-1924';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=72;
$one_mysql_log=0;
@@ -3319,6 +3320,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var trigger_ready=0;
var hide_gender='<?php echo $hide_gender ?>';
var manual_dial_cid='<?php echo $manual_dial_cid ?>';
var post_phone_time_diff_alert_message='';
var DiaLControl_auto_HTML = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><img src=\"./images/vdc_LB_resume.gif\" border=\"0\" alt=\"Resume\" /></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><img src=\"./images/vdc_LB_pause.gif\" border=\"0\" alt=\" Pause \" /></a><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
var DiaLControl_auto_HTML_OFF = "<img src=\"./images/vdc_LB_pause_OFF.gif\" border=\"0\" alt=\" Pause \" /><img src=\"./images/vdc_LB_resume_OFF.gif\" border=\"0\" alt=\"Resume\" />";
@@ -6234,6 +6236,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
custom_field_types = MDnextResponse_array[47];
var list_webform = MDnextResponse_array[48];
var list_webform_two = MDnextResponse_array[49];
post_phone_time_diff_alert_message = MDnextResponse_array[50];
timer_action = campaign_timer_action;
timer_action_message = campaign_timer_action_message;
@@ -6307,6 +6310,12 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
showDiv('CBcommentsBox');
}
if (post_phone_time_diff_alert_message.length > 10)
{
document.getElementById("post_phone_time_diff_span_contents").innerHTML = " &nbsp; &nbsp; " + post_phone_time_diff_alert_message + "<br />";
showDiv('post_phone_time_diff_span');
}
if (document.vicidial_form.LeadPreview.checked==false)
{
reselect_preview_dial = 0;
@@ -6488,6 +6497,12 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
previous_dispo = '';
custchannellive=1;
if (post_phone_time_diff_alert_message.length > 10)
{
document.getElementById("post_phone_time_diff_span_contents").innerHTML = "";
hideDiv('post_phone_time_diff_span');
}
document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go on to next lead";
if (dial_method == "INBOUND_MAN")
@@ -7750,6 +7765,12 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
lastcustchannel='';
lastcustserverip='';
MDchannel='';
if (post_phone_time_diff_alert_message.length > 10)
{
document.getElementById("post_phone_time_diff_span_contents").innerHTML = "";
hideDiv('post_phone_time_diff_span');
post_phone_time_diff_alert_message='';
}
if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
document.getElementById("WebFormSpan").innerHTML = "<img src=\"./images/vdc_LB_webform_OFF.gif\" border=\"0\" alt=\"Web Form\" />";
@@ -8565,6 +8586,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
document.vicidial_form.MDLeadID.value = '';
document.vicidial_form.MDType.value = '';
if (post_phone_time_diff_alert_message.length > 10)
{
document.getElementById("post_phone_time_diff_span_contents").innerHTML = "";
hideDiv('post_phone_time_diff_span');
post_phone_time_diff_alert_message='';
}
if (manual_dial_in_progress==1)
{
manual_dial_finished();
@@ -11117,6 +11145,7 @@ function phone_number_format(formatphone) {
hideDiv('LeaDInfOBox');
hideDiv('agentdirectlink');
hideDiv('blind_monitor_notice_span');
hideDiv('post_phone_time_diff_span');
hideDiv('ivrParkControl');
if (is_webphone!='Y')
{hideDiv('webphoneSpan');}
@@ -12107,6 +12136,7 @@ $zi=2;
echo "<img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";
}
?>
<span id="post_phone_time_diff_span"><b><font color="red"><span id="post_phone_time_diff_span_contents"></span></font></b></span>
<font class="body_text"> STATUS: <span id="MainStatuSSpan"></span></font></td></tr>
<tr><td colspan="3"><span id="busycallsdebug"></span></td></tr>
<tr><td width="150px" align="left" valign="top">
+17 -5
View File
File diff suppressed because one or more lines are too long