Added options to allow for an agent to place manual dial calls out as if they were in-group inbound calls. Also allows for no-dial calls that are not actually placed out the telco, but are logged as calls. For more information see the "In-Group Manual Dial" options in Campaign Detail

git-svn-id: svn://192.168.202.10@1816 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2012-05-13 05:01:03 +00:00
parent 01583de58f
commit 8ec1af2871
9 changed files with 764 additions and 522 deletions
+4 -1
View File
@@ -52,7 +52,10 @@ REQUIRED STEPS!!!
OTHER CHANGES:
1. Nothing new yet, we just forked 2.4. New features will go here...
1. Added the ability for an agent to place manual dial calls out as if they were
in-group inbound calls. Also allows for no-dial calls that are not
actually placed out the telco, but are logged as calls. For more
information see the "In-Group Manual Dial" options in Campaign Detail
+14 -8
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-VDAD_ALL_inbound.agi version 2.4
# agi-VDAD_ALL_inbound.agi version 2.6
#
# runs when a call comes in from an inbound call. This script will
# send the calls out to the closers that are logged in.
@@ -174,6 +174,7 @@
# 111219-2124 - Added max stats updating
# 111229-1726 - Changed call time overflow to look at previous day stop time
# 120130-1708 - Fix for ring agent EXTERNAL protocol phone issue
# 120513-0051 - Added ability to have Dial In-Group agent calls go directly to agents
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -485,12 +486,14 @@ if ($call_handle_method =~ /^CLOSER/)
$park_extension = $EXT_vars[4]; # filename of the on-hold music file
$phone_number = $EXT_vars[5]; # phone number of customer
$fronter = $EXT_vars[6]; # user of the fronter that transferred the call
if ($channel_group =~ /AGENTDIRECT/)
$fronter_call_seconds = $EXT_vars[8]; # not currently used
$dial_ingroup_flag = $EXT_vars[9]; # used by dial in-group feature
if ( ($channel_group =~ /AGENTDIRECT/) || ($dial_ingroup_flag > 0) )
{
$agent_only = $EXT_vars[7]; # optional AGENTDIRECT user to queue call for
$agent_only = $EXT_vars[7]; # optional AGENTDIRECT user to queue call for
$agent_grab_extension = $EXT_vars[10]; # used by dial in-group feature
}
$CIDlead_id = $parked_by;
$fronter_call_seconds = $EXT_vars[8]; # not currently used
$originalCID = $phone_number;
$PADlead_id = sprintf("%010s", $parked_by); while (length($PADlead_id) > 10) {chop($PADlead_id);}
@@ -1459,7 +1462,7 @@ if ( ($no_agent_no_queue =~ /Y|NO_PAUSED/) || ($$MCnanque_override > 0) )
$ADsql='';
if ($no_agent_no_queue =~ /NO_PAUSED/)
{$NPsql = "and status NOT IN('PAUSED')";}
if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) )
if ( ( ($channel_group =~ /AGENTDIRECT/i) || ($dial_ingroup_flag > 0) ) && (length($agent_only) > 1) )
{$ADsql = "and user='$agent_only'";}
$stmtA = "SELECT count(*) FROM vicidial_live_agents where closer_campaigns LIKE \"% $channel_group %\" $NPsql $ADsql;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -1832,7 +1835,7 @@ if ($enable_queuemetrics_logging > 0)
### If AGENTDIRECT set variable accordingly ###
$adSQL='';
if ($channel_group =~ /AGENTDIRECT/)
if ( ($channel_group =~ /AGENTDIRECT/) || ($dial_ingroup_flag > 0) )
{$adSQL = ",agent_only='$agent_only'";}
### check for an IVR status record in vicidial_auto_calls
@@ -1900,8 +1903,11 @@ if ($sthArows > 0)
$queue_position = $aryA[0];
}
$dial_ingroup_grab_SQL='';
if ($dial_ingroup_flag > 0)
{$dial_ingroup_grab_SQL = ",agent_grab='$agent_only',agent_grab_extension='$agent_grab_extension'";}
### UPDATE vicidial_auto_calls record with starting queue_position
$stmtA = "UPDATE vicidial_auto_calls SET queue_position='$queue_position' WHERE auto_call_id='$auto_call_id';";
$stmtA = "UPDATE vicidial_auto_calls SET queue_position='$queue_position' $dial_ingroup_grab_SQL WHERE auto_call_id='$auto_call_id';";
$Uaffected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "$Uaffected_rows|$stmtA|"; &agi_output;}
$dbhP=$dbhA; $mysql_count='02121'; $MEL_aff_rows=$Uaffected_rows; &mysql_error_logging;
@@ -1951,7 +1957,7 @@ $ring_no_answer_agents = "'',";
##########################################################
### For AGENTDIRECT calls try to send call to an agent ###
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) )
if ( ( ($channel_group =~ /AGENTDIRECT/) || ($dial_ingroup_flag > 0) ) && (length($agent_only) > 1) )
{
$skipLOSO=1;
$ADfindSQL = "and agent_only='$agent_only'";
+11 -1
View File
@@ -71,6 +71,7 @@
# 120124-1032 - Added Answer to all call menus at the top
# 120209-1525 - Separated all vicidial-auto dialplan contexts into their own contexts to allow for more control of dialing access through phones
# 120213-1405 - Added vicidial_daily_ra_stats rolling
# 120512-2332 - Added loopback dialaround for ringing of calls
#
$DB=0; # Debug flag
@@ -1536,7 +1537,6 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$Vext .= "exten => 8310,3,Wait,$vicidial_recording_limit\n";
$Vext .= "exten => 8310,4,Hangup\n";
$Vext .= "\n; agent alert extension\n";
$Vext .= "exten => 83047777777777,1,Answer\n";
if ($asterisk_version =~ /^1.2/)
@@ -1544,6 +1544,16 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
else
{$Vext .= "exten => 83047777777777,2,Playback(\${CALLERID(name)})\n";}
$Vext .= "exten => 83047777777777,3,Hangup\n";
$Vext .= "; This is a loopback dial-around to allow for immediate answer of outbound calls\n";
$Vext .= "exten => _8305888888888888.,1,Answer\n";
$Vext .= "exten => _8305888888888888.,n,Wait(\${EXTEN:16:1})\n";
$Vext .= "exten => _8305888888888888.,n,Dial(\${TRUNKloop}/\${EXTEN:17},,To)\n";
$Vext .= "exten => _8305888888888888.,n,Hangup\n";
$Vext .= "; No-call silence extension\n";
$Vext .= "exten => _8305888888888888X999,1,Answer\n";
$Vext .= "exten => _8305888888888888X999,n,Wait($vicidial_recording_limit)\n";
$Vext .= "exten => _8305888888888888X999,n,Hangup\n";
##### END Create Voicemail extensions for this server_ip #####
@@ -849,7 +849,9 @@ call_count_target SMALLINT(5) UNSIGNED default '3',
callback_hours_block TINYINT(2) default '0',
callback_list_calltime ENUM('ENABLED','DISABLED') default 'DISABLED',
user_group VARCHAR(20) default '---ALL---',
hopper_vlc_dup_check ENUM('Y','N') default 'N'
hopper_vlc_dup_check ENUM('Y','N') default 'N',
in_group_dial ENUM('DISABLED','MANUAL_DIAL','NO_DIAL','BOTH') default 'DISABLED',
in_group_dial_select ENUM('AGENT_SELECTED','CAMPAIGN_SELECTED','ALL_USER_GROUP') default 'CAMPAIGN_SELECTED'
);
CREATE TABLE vicidial_lists (
@@ -2809,7 +2811,7 @@ CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer;
CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log;
CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route);
UPDATE system_settings SET db_schema_version='1318',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1319',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+3 -4
View File
@@ -1,10 +1,9 @@
UPDATE system_settings SET db_schema_version='1318',version='2.6b0.5',db_schema_update_date=NOW() where db_schema_version < 1318;
ALTER TABLE vicidial_phone_codes MODIFY geographic_description VARCHAR(100);
ALTER TABLE vicidial_campaigns ADD in_group_dial ENUM('DISABLED','MANUAL_DIAL','NO_DIAL','BOTH') default 'DISABLED';
ALTER TABLE vicidial_campaigns ADD in_group_dial_select ENUM('AGENT_SELECTED','CAMPAIGN_SELECTED','ALL_USER_GROUP') default 'AGENT_SELECTED';
ALTER TABLE vicidial_campaigns ADD in_group_dial_select ENUM('AGENT_SELECTED','CAMPAIGN_SELECTED','ALL_USER_GROUP') default 'CAMPAIGN_SELECTED';
UPDATE system_settings SET db_schema_version='1319',db_schema_update_date=NOW() where db_schema_version < 1319;
@@ -0,0 +1,22 @@
############################################################ ADMIN
In-Group Manual Dial||
In-Group Manual Dial Select||
This feature allows you to enable the ability for agents to place manual dial outbound calls that are logged as in-group calls assigned to a specific in-group. The MANUAL_DIAL option allows the placing of phone calls out through an In-Group to the agent placing the call. The NO_DIAL option allows the agent to log time on a call that does not exist, as if it were a real call, this is often used for logging email or faxing time. The BOTH option will allow both call and no-call in-group dialing. The default is DISABLED||
This option is only active if the above In-Group Manual Dial feature is not DISABLED. This option restricts the selectable In-Groups that the agent can place In-Group Manual Dial calls through. CAMPAIGN_SELECTED will show only the in-groups that the campaign has set as allowable in-groups. ALL_USER_GROUP will show all of the in-groups that are viewable to the members of the user group that the agent belongs to||
############################################################ CLIENT
Click Here to Choose a Dial In-Group||
SELECT A DIAL IN-GROUP||
DIAL IN-GROUP||
Dial In-Group||
Click Here to Activate||
Click Here to Deactivate||
############################################################ MANAGER Manual
############################################################ AGENT Manual
+264 -250
View File
@@ -93,6 +93,8 @@
# - $disable_alter_custphone = ('N','Y','HIDE')
# - $old_CID = ('M06301413000000002',...)
# - $qm_dispo_code
# - $dial_ingroup
# - $nocall_dial_flag
#
#
# CHANGELOG:
@@ -305,10 +307,11 @@
# 120213-1700 - Added vendor_lead_code to all vicidial_hopper inserts
# 120221-2125 - Manual dials update lastcalldate, and other small changes
# 120427-1717 - Fixed 3-way logging issue
# 120513-0045 - Added Dial In-group and No-Dial compatibility
#
$version = '2.4-205';
$build = '120427-1717';
$version = '2.6-206';
$build = '120513-0045';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=438;
$one_mysql_log=0;
@@ -525,6 +528,10 @@ if (isset($_GET["old_CID"])) {$old_CID=$_GET["old_CID"];}
elseif (isset($_POST["old_CID"])) {$old_CID=$_POST["old_CID"];}
if (isset($_GET["qm_dispo_code"])) {$qm_dispo_code=$_GET["qm_dispo_code"];}
elseif (isset($_POST["qm_dispo_code"])) {$qm_dispo_code=$_POST["qm_dispo_code"];}
if (isset($_GET["dial_ingroup"])) {$dial_ingroup=$_GET["dial_ingroup"];}
elseif (isset($_POST["dial_ingroup"])) {$dial_ingroup=$_POST["dial_ingroup"];}
if (isset($_GET["nocall_dial_flag"])) {$nocall_dial_flag=$_GET["nocall_dial_flag"];}
elseif (isset($_POST["nocall_dial_flag"])) {$nocall_dial_flag=$_POST["nocall_dial_flag"];}
header ("Content-type: text/html; charset=utf-8");
@@ -1622,23 +1629,23 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00237',$user,$server_ip,$session_name,$one_mysql_log);}
$rowx=mysql_fetch_row($rslt);
$Gct_default_start = "$rowx[3]";
$Gct_default_stop = "$rowx[4]";
$Gct_sunday_start = "$rowx[5]";
$Gct_sunday_stop = "$rowx[6]";
$Gct_monday_start = "$rowx[7]";
$Gct_monday_stop = "$rowx[8]";
$Gct_tuesday_start = "$rowx[9]";
$Gct_tuesday_stop = "$rowx[10]";
$Gct_wednesday_start = "$rowx[11]";
$Gct_wednesday_stop = "$rowx[12]";
$Gct_thursday_start = "$rowx[13]";
$Gct_thursday_stop = "$rowx[14]";
$Gct_friday_start = "$rowx[15]";
$Gct_friday_stop = "$rowx[16]";
$Gct_saturday_start = "$rowx[17]";
$Gct_saturday_stop = "$rowx[18]";
$Gct_state_call_times = "$rowx[19]";
$Gct_default_start = $rowx[3];
$Gct_default_stop = $rowx[4];
$Gct_sunday_start = $rowx[5];
$Gct_sunday_stop = $rowx[6];
$Gct_monday_start = $rowx[7];
$Gct_monday_stop = $rowx[8];
$Gct_tuesday_start = $rowx[9];
$Gct_tuesday_stop = $rowx[10];
$Gct_wednesday_start = $rowx[11];
$Gct_wednesday_stop = $rowx[12];
$Gct_thursday_start = $rowx[13];
$Gct_thursday_stop = $rowx[14];
$Gct_friday_start = $rowx[15];
$Gct_friday_stop = $rowx[16];
$Gct_saturday_start = $rowx[17];
$Gct_saturday_stop = $rowx[18];
$Gct_state_call_times = $rowx[19];
$ct_states = '';
$ct_state_gmt_SQL = '';
@@ -1657,24 +1664,24 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00238',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$Gstate_call_time_id = "$row[0]";
$Gstate_call_time_state = "$row[1]";
$Gsct_default_start = "$row[4]";
$Gsct_default_stop = "$row[5]";
$Gsct_sunday_start = "$row[6]";
$Gsct_sunday_stop = "$row[7]";
$Gsct_monday_start = "$row[8]";
$Gsct_monday_stop = "$row[9]";
$Gsct_tuesday_start = "$row[10]";
$Gsct_tuesday_stop = "$row[11]";
$Gsct_wednesday_start = "$row[12]";
$Gsct_wednesday_stop = "$row[13]";
$Gsct_thursday_start = "$row[14]";
$Gsct_thursday_stop = "$row[15]";
$Gsct_friday_start = "$row[16]";
$Gsct_friday_stop = "$row[17]";
$Gsct_saturday_start = "$row[18]";
$Gsct_saturday_stop = "$row[19]";
$Gstate_call_time_id = $row[0];
$Gstate_call_time_state = $row[1];
$Gsct_default_start = $row[4];
$Gsct_default_stop = $row[5];
$Gsct_sunday_start = $row[6];
$Gsct_sunday_stop = $row[7];
$Gsct_monday_start = $row[8];
$Gsct_monday_stop = $row[9];
$Gsct_tuesday_start = $row[10];
$Gsct_tuesday_stop = $row[11];
$Gsct_wednesday_start = $row[12];
$Gsct_wednesday_stop = $row[13];
$Gsct_thursday_start = $row[14];
$Gsct_thursday_stop = $row[15];
$Gsct_friday_start = $row[16];
$Gsct_friday_stop = $row[17];
$Gsct_saturday_start = $row[18];
$Gsct_saturday_stop = $row[19];
$ct_states .="'$Gstate_call_time_state',";
@@ -2365,7 +2372,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
### if preview dialing, do not send the call
if ( (strlen($preview)<1) || ($preview == 'NO') )
if ( (strlen($preview)<1) or ($preview == 'NO') or (strlen($dial_ingroup) > 1) )
{
### prepare variables to place manual call from VICIDiaL
$CCID_on=0; $CCID='';
@@ -2443,8 +2450,6 @@ if ($ACTION == 'manDiaLnextCaLL')
$eac_extension = preg_replace("/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\//",'',$eac_phone);
$EAC=" $eac_extension";
}
if ($CCID_on) {$CIDstring = "\"$MqueryCID$EAC\" <$CCID>";}
else {$CIDstring = "$MqueryCID$EAC";}
### whether to omit phone_code or not
if (eregi('Y',$omit_phone_code))
@@ -2461,17 +2466,46 @@ if ($ACTION == 'manDiaLnextCaLL')
else
{$account=''; $variable='';}
$dial_channel = "$local_DEF$conf_exten$local_AMP$ext_context$Local_persist";
$preset_name='';
if (strlen($dial_ingroup) > 1)
{
$preset_name='DIG';
$MqueryCID = "Y$CIDdate$PADlead_id";
$loop_ingroup_dial_prefix = '8305888888888888';
$dial_wait_seconds = '4'; # 1 digit only
if ($nocall_dial_flag == 'ENABLED')
{
$Ndialstring = "$loop_ingroup_dial_prefix$dial_wait_seconds" . "999";
$preset_name='DIG_NODIAL';
}
else
{$Ndialstring = "$loop_ingroup_dial_prefix$dial_wait_seconds$Ndialstring";}
$dial_ingroup_dialstring = "90009*$dial_ingroup" . "**$lead_id" . "**$agent_dialed_number" . "*$user" . "*$user" . "**1*$conf_exten";
$dial_channel = "$local_DEF$dial_ingroup_dialstring$local_AMP$ext_context$Local_persist";
}
if ($CCID_on) {$CIDstring = "\"$MqueryCID$EAC\" <$CCID>";}
else {$CIDstring = "$MqueryCID$EAC";}
### insert the call action into the vicidial_manager table to initiate the call
# $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');";
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');";
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $dial_channel','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);}
$stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$agent_dialed_number','$NOW_TIME','OUT')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);}
### Skip logging and list overrides if dial in-group is used
if (strlen($dial_ingroup) < 1)
{
$stmt = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type) values('$server_ip','$campaign','XFER','$lead_id','$MqueryCID','$phone_code','$agent_dialed_number','$NOW_TIME','OUT')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00034',$user,$server_ip,$session_name,$one_mysql_log);}
}
### update the agent status to INCALL in vicidial_live_agents
$stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today',external_hangup=0,external_status='',external_pause='',external_dial='',last_state_change='$NOW_TIME' where user='$user' and server_ip='$server_ip';";
@@ -2485,233 +2519,213 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);}
# #### update vicidial_agent_log if not MANUAL dial_method
# if ($dial_method != 'MANUAL')
# {
# $pause_sec=0;
# $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;";
# if ($DB) {echo "$stmt\n";}
# $rslt=mysql_query($stmt, $link);
# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);}
# $VDpr_ct = mysql_num_rows($rslt);
# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) )
# {
# $row=mysql_fetch_row($rslt);
# $agent_log_id = $row[5];
# $pause_sec = (($StarTtime - $row[0]) + $row[1]);
#
# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';";
# if ($format=='debug') {echo "\n<!-- $stmt -->";}
# $rslt=mysql_query($stmt, $link);
# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);}
# }
# }
$val_pause_epoch=0;
$val_pause_sec=0;
$stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00323',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$vald_ct = mysql_num_rows($rslt);
if ($vald_ct > 0)
{
$row=mysql_fetch_row($rslt);
$val_pause_epoch = $row[0];
$val_pause_sec = ($StarTtime - $val_pause_epoch);
}
$stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00324',$user,$server_ip,$session_name,$one_mysql_log);}
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','$agent_dialed_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')";
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$agent_dialed_number','$Ndialstring','$lead_id','$CCID','$RAWaccount','$preset_name')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);}
}
#############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_pe_phone_append FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
### Skip logging and list overrides if dial in-group is used
if (strlen($dial_ingroup) > 1)
{
$row=mysql_fetch_row($rslt);
$enable_queuemetrics_logging = $row[0];
$queuemetrics_server_ip = $row[1];
$queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$queuemetrics_pe_phone_append = $row[6];
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
if ($enable_queuemetrics_logging > 0)
{
$data4SQL='';
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
$val_pause_epoch=0;
$val_pause_sec=0;
$stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00389',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00323',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cqpe_ct = mysql_num_rows($rslt);
if ($cqpe_ct > 0)
$vald_ct = mysql_num_rows($rslt);
if ($vald_ct > 0)
{
$row=mysql_fetch_row($rslt);
$pe_append='';
if ( ($queuemetrics_pe_phone_append > 0) and (strlen($row[0])>0) )
{$pe_append = "-$qm_extension";}
$data4SQL = ",data4='$row[0]$pe_append'";
$val_pause_epoch = $row[0];
$val_pause_sec = ($StarTtime - $val_pause_epoch);
}
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysql_select_db("$queuemetrics_dbname", $linkB);
# UNPAUSEALL
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($linkB);
# CALLOUTBOUND (formerly ENTERQUEUE)
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$agent_dialed_number',serverid='$queuemetrics_log_id' $data4SQL;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($linkB);
# CONNECT
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id' $data4SQL;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($linkB);
mysql_close($linkB);
}
}
##### find if script contains recording fields
$stmt="SELECT count(*) FROM vicidial_lists WHERE list_id='$list_id' and agent_script_override!='' and agent_script_override IS NOT NULL and agent_script_override!='NONE';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00259',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$vls_vc_ct = mysql_num_rows($rslt);
if ($vls_vc_ct > 0)
{
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$script_recording_delay=0;
##### find if script contains recording fields
$stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_lists vls WHERE list_id='$list_id' and vs.script_id=vls.agent_script_override and script_text LIKE \"%--A--recording_%\";";
$stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00260',$user,$server_ip,$session_name,$one_mysql_log);}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00324',$user,$server_ip,$session_name,$one_mysql_log);}
#############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_pe_phone_append FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00037',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$vs_vc_ct = mysql_num_rows($rslt);
if ($vs_vc_ct > 0)
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$script_recording_delay = $row[0];
$enable_queuemetrics_logging = $row[0];
$queuemetrics_server_ip = $row[1];
$queuemetrics_dbname = $row[2];
$queuemetrics_login = $row[3];
$queuemetrics_pass = $row[4];
$queuemetrics_log_id = $row[5];
$queuemetrics_pe_phone_append = $row[6];
}
}
}
### Check for List ID override settings
$VDCL_xferconf_a_number='';
$VDCL_xferconf_b_number='';
$VDCL_xferconf_c_number='';
$VDCL_xferconf_d_number='';
$VDCL_xferconf_e_number='';
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00277',$user,$server_ip,$session_name,$one_mysql_log);}
$VC_preset_ct = mysql_num_rows($rslt);
if ($VC_preset_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VDCL_xferconf_a_number = $row[0];
$VDCL_xferconf_b_number = $row[1];
$VDCL_xferconf_c_number = $row[2];
$VDCL_xferconf_d_number = $row[3];
$VDCL_xferconf_e_number = $row[4];
}
if (strlen($list_id)>0)
{
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00278',$user,$server_ip,$session_name,$one_mysql_log);}
$VDIG_preset_ct = mysql_num_rows($rslt);
if ($VDIG_preset_ct > 0)
{
$row=mysql_fetch_row($rslt);
if (strlen($row[0]) > 0)
{$VDCL_xferconf_a_number = $row[0];}
if (strlen($row[1]) > 0)
{$VDCL_xferconf_b_number = $row[1];}
if (strlen($row[2]) > 0)
{$VDCL_xferconf_c_number = $row[2];}
if (strlen($row[3]) > 0)
{$VDCL_xferconf_d_number = $row[3];}
if (strlen($row[4]) > 0)
{$VDCL_xferconf_e_number = $row[4];}
}
$custom_field_names='|';
$custom_field_names_SQL='';
$custom_field_values='----------';
$custom_field_types='|';
### find the names of all custom fields, if any
$stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('vendor_lead_code','source_id','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','date_of_birth','alt_phone','email','security_phrase','comments','called_count','last_local_call_time','rank','owner');";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00334',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cffn_ct = mysql_num_rows($rslt);
$d=0;
while ($cffn_ct > $d)
{
$row=mysql_fetch_row($rslt);
$custom_field_names .= "$row[0]|";
$custom_field_names_SQL .= "$row[0],";
$custom_field_types .= "$row[1]|";
$custom_field_values .= "----------";
$d++;
}
if ($cffn_ct > 0)
{
$custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL);
### find the values of the named custom fields
$stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00335',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cffv_ct = mysql_num_rows($rslt);
if ($cffv_ct > 0)
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
if ($enable_queuemetrics_logging > 0)
{
$custom_field_values='----------';
$row=mysql_fetch_row($rslt);
$d=0;
while ($cffn_ct > $d)
$data4SQL='';
$stmt="SELECT queuemetrics_phone_environment FROM vicidial_campaigns where campaign_id='$campaign' and queuemetrics_phone_environment!='';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00389',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cqpe_ct = mysql_num_rows($rslt);
if ($cqpe_ct > 0)
{
$custom_field_values .= "$row[$d]----------";
$d++;
$row=mysql_fetch_row($rslt);
$pe_append='';
if ( ($queuemetrics_pe_phone_append > 0) and (strlen($row[0])>0) )
{$pe_append = "-$qm_extension";}
$data4SQL = ",data4='$row[0]$pe_append'";
}
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysql_select_db("$queuemetrics_dbname", $linkB);
# UNPAUSEALL
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='NONE',queue='NONE',agent='Agent/$user',verb='UNPAUSEALL',serverid='$queuemetrics_log_id' $data4SQL;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00038',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($linkB);
# CALLOUTBOUND (formerly ENTERQUEUE)
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='NONE',verb='CALLOUTBOUND',data2='$agent_dialed_number',serverid='$queuemetrics_log_id' $data4SQL;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00039',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($linkB);
# CONNECT
$stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtime',call_id='$MqueryCID',queue='$campaign',agent='Agent/$user',verb='CONNECT',data1='0',serverid='$queuemetrics_log_id' $data4SQL;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkB);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00040',$user,$server_ip,$session_name,$one_mysql_log);}
$affected_rows = mysql_affected_rows($linkB);
mysql_close($linkB);
}
}
##### find if script contains recording fields
$stmt="SELECT count(*) FROM vicidial_lists WHERE list_id='$list_id' and agent_script_override!='' and agent_script_override IS NOT NULL and agent_script_override!='NONE';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00259',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$vls_vc_ct = mysql_num_rows($rslt);
if ($vls_vc_ct > 0)
{
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$script_recording_delay=0;
##### find if script contains recording fields
$stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_lists vls WHERE list_id='$list_id' and vs.script_id=vls.agent_script_override and script_text LIKE \"%--A--recording_%\";";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00260',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$vs_vc_ct = mysql_num_rows($rslt);
if ($vs_vc_ct > 0)
{
$row=mysql_fetch_row($rslt);
$script_recording_delay = $row[0];
}
}
}
### Check for List ID override settings
$VDCL_xferconf_a_number='';
$VDCL_xferconf_b_number='';
$VDCL_xferconf_c_number='';
$VDCL_xferconf_d_number='';
$VDCL_xferconf_e_number='';
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00277',$user,$server_ip,$session_name,$one_mysql_log);}
$VC_preset_ct = mysql_num_rows($rslt);
if ($VC_preset_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VDCL_xferconf_a_number = $row[0];
$VDCL_xferconf_b_number = $row[1];
$VDCL_xferconf_c_number = $row[2];
$VDCL_xferconf_d_number = $row[3];
$VDCL_xferconf_e_number = $row[4];
}
if (strlen($list_id)>0)
{
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00278',$user,$server_ip,$session_name,$one_mysql_log);}
$VDIG_preset_ct = mysql_num_rows($rslt);
if ($VDIG_preset_ct > 0)
{
$row=mysql_fetch_row($rslt);
if (strlen($row[0]) > 0)
{$VDCL_xferconf_a_number = $row[0];}
if (strlen($row[1]) > 0)
{$VDCL_xferconf_b_number = $row[1];}
if (strlen($row[2]) > 0)
{$VDCL_xferconf_c_number = $row[2];}
if (strlen($row[3]) > 0)
{$VDCL_xferconf_d_number = $row[3];}
if (strlen($row[4]) > 0)
{$VDCL_xferconf_e_number = $row[4];}
}
$custom_field_names='|';
$custom_field_names_SQL='';
$custom_field_values='----------';
$custom_field_types='|';
### find the names of all custom fields, if any
$stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('vendor_lead_code','source_id','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','date_of_birth','alt_phone','email','security_phrase','comments','called_count','last_local_call_time','rank','owner');";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00334',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cffn_ct = mysql_num_rows($rslt);
$d=0;
while ($cffn_ct > $d)
{
$row=mysql_fetch_row($rslt);
$custom_field_names .= "$row[0]|";
$custom_field_names_SQL .= "$row[0],";
$custom_field_types .= "$row[1]|";
$custom_field_values .= "----------";
$d++;
}
if ($cffn_ct > 0)
{
$custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL);
### find the values of the named custom fields
$stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00335',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$cffv_ct = mysql_num_rows($rslt);
if ($cffv_ct > 0)
{
$custom_field_values='----------';
$row=mysql_fetch_row($rslt);
$d=0;
while ($cffn_ct > $d)
{
$custom_field_values .= "$row[$d]----------";
$d++;
}
$custom_field_values = preg_replace("/\n/"," ",$custom_field_values);
$custom_field_values = preg_replace("/\r/","",$custom_field_values);
}
$custom_field_values = preg_replace("/\n/"," ",$custom_field_values);
$custom_field_values = preg_replace("/\r/","",$custom_field_values);
}
}
}
+415 -251
View File
@@ -379,10 +379,11 @@
# 120403-1204 - Fixed issue with MANUAL dial method hotkeys, added 1 second delay
# 120420-1621 - Forked 2.4 to branches, changing trunk to 2.6
# 120427-1718 - Fixed 3-way logging issue
# 120512-0849 - Added In-Group Manual Dial functions
#
$version = '2.6-347c';
$build = '120427-1718';
$version = '2.6-348c';
$build = '120512-0849';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=75;
$one_mysql_log=0;
@@ -1376,7 +1377,7 @@ else
$HKstatusnames = substr("$HKstatusnames", 0, -1);
##### grab the campaign settings
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_pause_precall_code,auto_resume_precall,manual_dial_cid,custom_3way_button_transfer,callback_days_limit,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,pllb_grouping,pllb_grouping_limit FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_pause_precall_code,auto_resume_precall,manual_dial_cid,custom_3way_button_transfer,callback_days_limit,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,pllb_grouping,pllb_grouping_limit,in_group_dial,in_group_dial_select FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1482,6 +1483,8 @@ else
$status_display_fields = $row[98];
$pllb_grouping = $row[99];
$pllb_grouping_limit = $row[100];
$in_group_dial = $row[101];
$in_group_dial_select = $row[102];
if ( ($queuemetrics_pe_phone_append > 0) and (strlen($qm_phone_environment)>0) )
{$qm_phone_environment .= "-$qm_extension";}
@@ -1768,6 +1771,50 @@ else
else
{$closer_campaigns = "''";}
$in_group_dial_display=0;
if ($in_group_dial != 'DISABLED')
{
$in_group_dial_display=1;
if ($in_group_dial_select == 'CAMPAIGN_SELECTED')
{
$VARdialingroups='';
$stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 800;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$dialcloser_ct = mysql_num_rows($rslt);
$dialINgrpCT=0;
while ($dialINgrpCT < $dialcloser_ct)
{
$row=mysql_fetch_row($rslt);
$dial_closer_groups[$dialINgrpCT] =$row[0];
$VARdialingroups = "$VARdialingroups'$dial_closer_groups[$dialINgrpCT]',";
$dialINgrpCT++;
}
$VARdialingroups = substr("$VARdialingroups", 0, -1);
}
if ($in_group_dial_select == 'ALL_USER_GROUP')
{
$VARdialingroups='';
$stmt="select group_id from vicidial_inbound_groups where active = 'Y' and user_group IN('---ALL---','$user_group') order by group_id limit 800;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$dialcloser_ct = mysql_num_rows($rslt);
$dialINgrpCT=0;
while ($dialINgrpCT < $dialcloser_ct)
{
$row=mysql_fetch_row($rslt);
$dial_closer_groups[$dialINgrpCT] =$row[0];
$VARdialingroups = "$VARdialingroups'$dial_closer_groups[$dialINgrpCT]',";
$dialINgrpCT++;
}
$VARdialingroups = substr("$VARdialingroups", 0, -1);
}
}
##### gather territory listings for this agent if select territories is enabled
$VARterritories='';
if ($agent_select_territories > 0)
@@ -3121,6 +3168,8 @@ $CCAL_OUT .= "</table>";
var VARSELstatuses_ct = '<?php echo $VARSELstatuses_ct ?>';
VARingroups = new Array(<?php echo $VARingroups ?>);
var INgroupCOUNT = '<?php echo $INgrpCT ?>';
VARdialingroups = new Array(<?php echo $VARdialingroups ?>);
var dialINgroupCOUNT = '<?php echo $dialINgrpCT ?>';
VARterritories = new Array(<?php echo $VARterritories ?>);
var territoryCOUNT = '<?php echo $territoryCT ?>';
VARxfergroups = new Array(<?php echo $VARxfergroups ?>);
@@ -3553,6 +3602,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var consult_custom_wait=0;
var consult_custom_go=0;
var consult_custom_sent=0;
var in_group_dial='<?php echo $in_group_dial ?>';
var in_group_dial_select='<?php echo $in_group_dial_select ?>';
var in_group_dial_display='<?php echo $in_group_dial_display ?>';
var active_ingroup_dial='';
var nocall_dial_flag='DISABLED';
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\" />";
@@ -5861,6 +5915,16 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "<font size=\"2\" face=\"Arial,Helvetica\">Group Alias: " + active_group_alias + "</font>";
document.getElementById("ManuaLDiaLGrouP").innerHTML = "<a href=\"#\" onclick=\"GroupAliasSelectContent_create('0');\"><font size=\"1\" face=\"Arial,Helvetica\">Click Here to Choose a Group Alias</font></a>";
}
if (in_group_dial_display > 0)
{
document.getElementById("ManuaLDiaLInGrouPSelecteD").innerHTML = "<font size=\"2\" face=\"Arial,Helvetica\">Dial In-Group: " + active_ingroup_dial + "</font>";
document.getElementById("ManuaLDiaLInGrouP").innerHTML = "<a href=\"#\" onclick=\"ManuaLDiaLInGrouPSelectContent_create('0');\"><font size=\"1\" face=\"Arial,Helvetica\">Click Here to Choose a Dial In-Group</font></a>";
}
if ( (in_group_dial == 'BOTH') || (in_group_dial == 'NO_DIAL') )
{
nocall_dial_flag = 'DISABLED';
document.getElementById("NoDiaLSelecteD").innerHTML = "<font size=\"2\" face=\"Arial,Helvetica\">No-Call Dial: " + nocall_dial_flag + " &nbsp; &nbsp; </font><a href=\"#\" onclick=\"NoDiaLSwitcH('');\"><font size=\"1\" face=\"Arial,Helvetica\">Click Here to Activate</font></a>";
}
showDiv('NeWManuaLDiaLBox');
document.vicidial_form.search_phone_number.value='';
@@ -5906,7 +5970,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
if (MDDiaLCodEform.length < 1)
{MDDiaLCodEform = document.vicidial_form.phone_code.value;}
if (MDDiaLOverridEform.length > 0)
if ( (MDDiaLOverridEform.length > 0) && (active_ingroup_dial.length < 1) )
{
agent_dialed_number=1;
agent_dialed_type='MANUAL_OVERRIDE';
@@ -5914,12 +5978,15 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
else
{
auto_dial_level=0;
manual_dial_in_progress=1;
agent_dialed_number=1;
if (active_ingroup_dial.length < 1)
{
auto_dial_level=0;
manual_dial_in_progress=1;
agent_dialed_number=1;
}
MainPanelToFront();
if (tempDiaLnow == 'PREVIEW')
if ( (tempDiaLnow == 'PREVIEW') && (active_ingroup_dial.length < 1) )
{
// alt_phone_dialing=1;
agent_dialed_type='MANUAL_PREVIEW';
@@ -5989,6 +6056,24 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
}
// ################################################################################
// Toggle the no-dial flag
function NoDiaLSwitcH()
{
if (nocall_dial_flag == 'DISABLED')
{
nocall_dial_flag = 'ENABLED';
document.getElementById("NoDiaLSelecteD").innerHTML = "<font size=\"2\" face=\"Arial,Helvetica\">No-Call Dial: " + nocall_dial_flag + " &nbsp; &nbsp; </font><a href=\"#\" onclick=\"NoDiaLSwitcH('');\"><font size=\"1\" face=\"Arial,Helvetica\">Click Here to Deactivate</font></a>";
}
else
{
nocall_dial_flag = 'DISABLED';
document.getElementById("NoDiaLSelecteD").innerHTML = "<font size=\"2\" face=\"Arial,Helvetica\">No-Call Dial: " + nocall_dial_flag + " &nbsp; &nbsp; </font><a href=\"#\" onclick=\"NoDiaLSwitcH('');\"><font size=\"1\" face=\"Arial,Helvetica\">Click Here to Activate</font></a>";
}
}
// ################################################################################
// Request lookup of manual dial channel
function ManualDialCheckChanneL(taskCheckOR)
@@ -6486,7 +6571,10 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
else
{
document.getElementById("DiaLControl").innerHTML = "<img src=\"./images/vdc_LB_dialnextnumber_OFF.gif\" border=\"0\" alt=\"Dial Next Number\" />";
if (active_ingroup_dial.length < 1)
{
document.getElementById("DiaLControl").innerHTML = "<img src=\"./images/vdc_LB_dialnextnumber_OFF.gif\" border=\"0\" alt=\"Dial Next Number\" />";
}
}
var manual_dial_only_type_flag = '';
if ( (mdtype == 'ALT') || (mdtype == 'ADDR3') )
@@ -6498,7 +6586,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
if (mdtype == 'ADDR3')
{manual_dial_only_type_flag = 'AddresS3';}
}
if (document.vicidial_form.LeadPreview.checked==true)
if ( (document.vicidial_form.LeadPreview.checked==true) && (active_ingroup_dial.length < 1) )
{
reselect_preview_dial = 1;
in_lead_preview_state = 1;
@@ -6550,13 +6638,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
else
{var call_prefix = manual_dial_prefix;}
manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&vtiger_callback_id=" + vtiger_callback_id + "&dial_method=" + dial_method + "&manual_dial_call_time_check=" + manual_dial_call_time_check + "&qm_extension=" + qm_extension;
manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&vtiger_callback_id=" + vtiger_callback_id + "&dial_method=" + dial_method + "&manual_dial_call_time_check=" + manual_dial_call_time_check + "&qm_extension=" + qm_extension + "&dial_ingroup=" + active_ingroup_dial + "&nocall_dial_flag=" + nocall_dial_flag;
// alert(manual_dial_filter + "\n" +manDiaLnext_query);
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(manDiaLnext_query);
xmlhttp.onreadystatechange = function()
{
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var MDnextResponse = null;
@@ -6564,261 +6652,269 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// alert(xmlhttp.responseText);
MDnextResponse = xmlhttp.responseText;
var MDnextResponse_array=MDnextResponse.split("\n");
MDnextCID = MDnextResponse_array[0];
LastCallCID = MDnextResponse_array[0];
var regMNCvar = new RegExp("HOPPER EMPTY","ig");
var regMDFvarDNC = new RegExp("DNC","ig");
var regMDFvarCAMP = new RegExp("CAMPLISTS","ig");
var regMDFvarTIME = new RegExp("OUTSIDE","ig");
if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) || (MDnextCID.match(regMDFvarTIME)) )
if (active_ingroup_dial.length > 0)
{
var alert_displayed=0;
trigger_ready=1;
alt_phone_dialing=starting_alt_phone_dialing;
auto_dial_level=starting_dial_level;
MainPanelToFront();
CalLBacKsCounTCheck();
if (MDnextCID.match(regMNCvar))
{alert_box("No more leads in the hopper for campaign:\n" + campaign); alert_displayed=1;}
if (MDnextCID.match(regMDFvarDNC))
{alert_box("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;}
if (MDnextCID.match(regMDFvarCAMP))
{alert_box("This phone number is not in the campaign lists:\n" + mdnPhonENumbeR); alert_displayed=1;}
if (MDnextCID.match(regMDFvarTIME))
{alert_box("This phone number is outside of the local call time:\n" + mdnPhonENumbeR); alert_displayed=1;}
if (alert_displayed==0)
{alert_box("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;}
if (starting_dial_level == 0)
{
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><img src=\"./images/vdc_LB_dialnextnumber.gif\" border=\"0\" alt=\"Dial Next Number\" /></a>";
}
else
{
if (dial_method == "INBOUND_MAN")
{
auto_dial_level=starting_dial_level;
document.getElementById("DiaLControl").innerHTML = "<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><br /><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><img src=\"./images/vdc_LB_dialnextnumber.gif\" border=\"0\" alt=\"Dial Next Number\" /></a>";
}
else
{
document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
reselect_alt_dial = 0;
}
AutoDial_ReSume_PauSe("VDADready",'','','NO_STATUS_CHANGE');
AutoDialWaiting=1;
}
else
{
fronter = user;
LasTCID = MDnextResponse_array[0];
document.vicidial_form.lead_id.value = MDnextResponse_array[1];
LeaDPreVDispO = MDnextResponse_array[2];
document.vicidial_form.vendor_lead_code.value = MDnextResponse_array[4];
document.vicidial_form.list_id.value = MDnextResponse_array[5];
document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6];
document.vicidial_form.phone_code.value = MDnextResponse_array[7];
if ( (disable_alter_custphone=='Y') || (disable_alter_custphone=='HIDE') )
var MDnextResponse_array=MDnextResponse.split("\n");
MDnextCID = MDnextResponse_array[0];
LastCallCID = MDnextResponse_array[0];
var regMNCvar = new RegExp("HOPPER EMPTY","ig");
var regMDFvarDNC = new RegExp("DNC","ig");
var regMDFvarCAMP = new RegExp("CAMPLISTS","ig");
var regMDFvarTIME = new RegExp("OUTSIDE","ig");
if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) || (MDnextCID.match(regMDFvarTIME)) )
{
var tmp_pn = document.getElementById("phone_numberDISP");
if (disable_alter_custphone=='Y')
var alert_displayed=0;
trigger_ready=1;
alt_phone_dialing=starting_alt_phone_dialing;
auto_dial_level=starting_dial_level;
MainPanelToFront();
CalLBacKsCounTCheck();
if (MDnextCID.match(regMNCvar))
{alert_box("No more leads in the hopper for campaign:\n" + campaign); alert_displayed=1;}
if (MDnextCID.match(regMDFvarDNC))
{alert_box("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;}
if (MDnextCID.match(regMDFvarCAMP))
{alert_box("This phone number is not in the campaign lists:\n" + mdnPhonENumbeR); alert_displayed=1;}
if (MDnextCID.match(regMDFvarTIME))
{alert_box("This phone number is outside of the local call time:\n" + mdnPhonENumbeR); alert_displayed=1;}
if (alert_displayed==0)
{alert_box("Unspecified error:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;}
if (starting_dial_level == 0)
{
tmp_pn.innerHTML = MDnextResponse_array[8];
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><img src=\"./images/vdc_LB_dialnextnumber.gif\" border=\"0\" alt=\"Dial Next Number\" /></a>";
}
}
document.vicidial_form.phone_number.value = MDnextResponse_array[8];
document.vicidial_form.title.value = MDnextResponse_array[9];
document.vicidial_form.first_name.value = MDnextResponse_array[10];
document.vicidial_form.middle_initial.value = MDnextResponse_array[11];
document.vicidial_form.last_name.value = MDnextResponse_array[12];
document.vicidial_form.address1.value = MDnextResponse_array[13];
document.vicidial_form.address2.value = MDnextResponse_array[14];
document.vicidial_form.address3.value = MDnextResponse_array[15];
document.vicidial_form.city.value = MDnextResponse_array[16];
document.vicidial_form.state.value = MDnextResponse_array[17];
document.vicidial_form.province.value = MDnextResponse_array[18];
document.vicidial_form.postal_code.value = MDnextResponse_array[19];
document.vicidial_form.country_code.value = MDnextResponse_array[20];
document.vicidial_form.gender.value = MDnextResponse_array[21];
document.vicidial_form.date_of_birth.value = MDnextResponse_array[22];
document.vicidial_form.alt_phone.value = MDnextResponse_array[23];
document.vicidial_form.email.value = MDnextResponse_array[24];
document.vicidial_form.security_phrase.value = MDnextResponse_array[25];
var REGcommentsNL = new RegExp("!N","g");
MDnextResponse_array[26] = MDnextResponse_array[26].replace(REGcommentsNL, "\n");
document.vicidial_form.comments.value = MDnextResponse_array[26];
document.vicidial_form.called_count.value = MDnextResponse_array[27];
previous_called_count = MDnextResponse_array[27];
previous_dispo = MDnextResponse_array[2];
CBentry_time = MDnextResponse_array[28];
CBcallback_time = MDnextResponse_array[29];
CBuser = MDnextResponse_array[30];
CBcomments = MDnextResponse_array[31];
dialed_number = MDnextResponse_array[32];
dialed_label = MDnextResponse_array[33];
source_id = MDnextResponse_array[34];
document.vicidial_form.rank.value = MDnextResponse_array[35];
document.vicidial_form.owner.value = MDnextResponse_array[36];
// CalL_ScripT_id = MDnextResponse_array[37];
script_recording_delay = MDnextResponse_array[38];
CalL_XC_a_NuMber = MDnextResponse_array[39];
CalL_XC_b_NuMber = MDnextResponse_array[40];
CalL_XC_c_NuMber = MDnextResponse_array[41];
CalL_XC_d_NuMber = MDnextResponse_array[42];
CalL_XC_e_NuMber = MDnextResponse_array[43];
document.vicidial_form.entry_list_id.value = MDnextResponse_array[44];
custom_field_names = MDnextResponse_array[45];
custom_field_values = MDnextResponse_array[46];
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;
timer_action_seconds = campaign_timer_action_seconds;
timer_action_destination = campaign_timer_action_destination;
lead_dial_number = dialed_number;
var dispnum = dialed_number;
var status_display_number = phone_number_format(dispnum);
var status_display_content='';
if (status_display_CALLID > 0) {status_display_content = status_display_content + " UID: " + MDnextCID;}
if (status_display_LEADID > 0) {status_display_content = status_display_content + " Lead: " + document.vicidial_form.lead_id.value;}
if (status_display_LISTID > 0) {status_display_content = status_display_content + " List: " + document.vicidial_form.list_id.value;}
document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " " + status_display_content + " &nbsp; " + man_status;
if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';}
if (hide_gender > 0)
{
document.vicidial_form.gender_list.value = MDnextResponse_array[21];
}
else
{
var gIndex = 0;
if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;}
if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;}
document.getElementById("gender_list").selectedIndex = gIndex;
var genderIndex = document.getElementById("gender_list").selectedIndex;
var genderValue = document.getElementById('gender_list').options[genderIndex].value;
document.vicidial_form.gender.value = genderValue;
}
LeaDDispO='';
VDIC_web_form_address = VICIDiaL_web_form_address
VDIC_web_form_address_two = VICIDiaL_web_form_address_two
if (list_webform.length > 5) {VDIC_web_form_address=list_webform;}
if (list_webform_two.length > 5) {VDIC_web_form_address_two=list_webform_two;}
var regWFAcustom = new RegExp("^VAR","ig");
if (VDIC_web_form_address.match(regWFAcustom))
{
TEMP_VDIC_web_form_address = URLDecode(VDIC_web_form_address,'YES','CUSTOM');
TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, '');
}
else
{
TEMP_VDIC_web_form_address = URLDecode(VDIC_web_form_address,'YES','DEFAULT','1');
}
if (VDIC_web_form_address_two.match(regWFAcustom))
{
TEMP_VDIC_web_form_address_two = URLDecode(VDIC_web_form_address_two,'YES','CUSTOM');
TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAcustom, '');
}
else
{
TEMP_VDIC_web_form_address_two = URLDecode(VDIC_web_form_address_two,'YES','DEFAULT','2');
}
document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><img src=\"./images/vdc_LB_webform.gif\" border=\"0\" alt=\"Web Form\" /></a>\n";
if (enable_second_webform > 0)
{
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormTwoRefresH();\"><img src=\"./images/vdc_LB_webform_two.gif\" border=\"0\" alt=\"Web Form 2\" /></a>\n";
}
if (CBentry_time.length > 2)
{
document.getElementById("CusTInfOSpaN").innerHTML = " <b> PREVIOUS CALLBACK </b>";
document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor;
document.getElementById("CBcommentsBoxA").innerHTML = "<b>Last Call: </b>" + CBentry_time;
document.getElementById("CBcommentsBoxB").innerHTML = "<b>CallBack: </b>" + CBcallback_time;
document.getElementById("CBcommentsBoxC").innerHTML = "<b>Agent: </b>" + CBuser;
document.getElementById("CBcommentsBoxD").innerHTML = "<b>Comments: </b><br />" + CBcomments;
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;
MD_channel_look=1;
custchannellive=1;
document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><img src=\"./images/vdc_LB_hangupcustomer.gif\" border=\"0\" alt=\"Hangup Customer\" /></a>";
if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') )
{all_record = 'YES';}
if ( (view_scripts == 1) && (campaign_script.length > 0) )
else
{
var SCRIPT_web_form = 'http://127.0.0.1/testing.php';
var TEMP_SCRIPT_web_form = URLDecode(SCRIPT_web_form,'YES','DEFAULT','1');
if ( (script_recording_delay > 0) && ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) )
if (dial_method == "INBOUND_MAN")
{
delayed_script_load = 'YES';
RefresHScript('CLEAR');
auto_dial_level=starting_dial_level;
document.getElementById("DiaLControl").innerHTML = "<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><br /><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><img src=\"./images/vdc_LB_dialnextnumber.gif\" border=\"0\" alt=\"Dial Next Number\" /></a>";
}
else
{
load_script_contents();
document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
}
document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
reselect_alt_dial = 0;
}
if (custom_fields_enabled > 0)
{
FormContentsLoad();
}
if (get_call_launch == 'SCRIPT')
{
if (delayed_script_load == 'YES')
{
load_script_contents();
}
ScriptPanelToFront();
}
if (get_call_launch == 'FORM')
{
FormPanelToFront();
}
if (get_call_launch == 'WEBFORM')
{
window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
}
if (get_call_launch == 'WEBFORMTWO')
{
window.open(TEMP_VDIC_web_form_address_two, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
}
}
else
{
reselect_preview_dial = 1;
fronter = user;
LasTCID = MDnextResponse_array[0];
document.vicidial_form.lead_id.value = MDnextResponse_array[1];
LeaDPreVDispO = MDnextResponse_array[2];
document.vicidial_form.vendor_lead_code.value = MDnextResponse_array[4];
document.vicidial_form.list_id.value = MDnextResponse_array[5];
document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6];
document.vicidial_form.phone_code.value = MDnextResponse_array[7];
if ( (disable_alter_custphone=='Y') || (disable_alter_custphone=='HIDE') )
{
var tmp_pn = document.getElementById("phone_numberDISP");
if (disable_alter_custphone=='Y')
{
tmp_pn.innerHTML = MDnextResponse_array[8];
}
}
document.vicidial_form.phone_number.value = MDnextResponse_array[8];
document.vicidial_form.title.value = MDnextResponse_array[9];
document.vicidial_form.first_name.value = MDnextResponse_array[10];
document.vicidial_form.middle_initial.value = MDnextResponse_array[11];
document.vicidial_form.last_name.value = MDnextResponse_array[12];
document.vicidial_form.address1.value = MDnextResponse_array[13];
document.vicidial_form.address2.value = MDnextResponse_array[14];
document.vicidial_form.address3.value = MDnextResponse_array[15];
document.vicidial_form.city.value = MDnextResponse_array[16];
document.vicidial_form.state.value = MDnextResponse_array[17];
document.vicidial_form.province.value = MDnextResponse_array[18];
document.vicidial_form.postal_code.value = MDnextResponse_array[19];
document.vicidial_form.country_code.value = MDnextResponse_array[20];
document.vicidial_form.gender.value = MDnextResponse_array[21];
document.vicidial_form.date_of_birth.value = MDnextResponse_array[22];
document.vicidial_form.alt_phone.value = MDnextResponse_array[23];
document.vicidial_form.email.value = MDnextResponse_array[24];
document.vicidial_form.security_phrase.value = MDnextResponse_array[25];
var REGcommentsNL = new RegExp("!N","g");
MDnextResponse_array[26] = MDnextResponse_array[26].replace(REGcommentsNL, "\n");
document.vicidial_form.comments.value = MDnextResponse_array[26];
document.vicidial_form.called_count.value = MDnextResponse_array[27];
previous_called_count = MDnextResponse_array[27];
previous_dispo = MDnextResponse_array[2];
CBentry_time = MDnextResponse_array[28];
CBcallback_time = MDnextResponse_array[29];
CBuser = MDnextResponse_array[30];
CBcomments = MDnextResponse_array[31];
dialed_number = MDnextResponse_array[32];
dialed_label = MDnextResponse_array[33];
source_id = MDnextResponse_array[34];
document.vicidial_form.rank.value = MDnextResponse_array[35];
document.vicidial_form.owner.value = MDnextResponse_array[36];
// CalL_ScripT_id = MDnextResponse_array[37];
script_recording_delay = MDnextResponse_array[38];
CalL_XC_a_NuMber = MDnextResponse_array[39];
CalL_XC_b_NuMber = MDnextResponse_array[40];
CalL_XC_c_NuMber = MDnextResponse_array[41];
CalL_XC_d_NuMber = MDnextResponse_array[42];
CalL_XC_e_NuMber = MDnextResponse_array[43];
document.vicidial_form.entry_list_id.value = MDnextResponse_array[44];
custom_field_names = MDnextResponse_array[45];
custom_field_values = MDnextResponse_array[46];
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;
timer_action_seconds = campaign_timer_action_seconds;
timer_action_destination = campaign_timer_action_destination;
lead_dial_number = dialed_number;
var dispnum = dialed_number;
var status_display_number = phone_number_format(dispnum);
var status_display_content='';
if (status_display_CALLID > 0) {status_display_content = status_display_content + " UID: " + MDnextCID;}
if (status_display_LEADID > 0) {status_display_content = status_display_content + " Lead: " + document.vicidial_form.lead_id.value;}
if (status_display_LISTID > 0) {status_display_content = status_display_content + " List: " + document.vicidial_form.list_id.value;}
document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " " + status_display_content + " &nbsp; " + man_status;
if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';}
if (hide_gender > 0)
{
document.vicidial_form.gender_list.value = MDnextResponse_array[21];
}
else
{
var gIndex = 0;
if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;}
if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;}
document.getElementById("gender_list").selectedIndex = gIndex;
var genderIndex = document.getElementById("gender_list").selectedIndex;
var genderValue = document.getElementById('gender_list').options[genderIndex].value;
document.vicidial_form.gender.value = genderValue;
}
LeaDDispO='';
VDIC_web_form_address = VICIDiaL_web_form_address
VDIC_web_form_address_two = VICIDiaL_web_form_address_two
if (list_webform.length > 5) {VDIC_web_form_address=list_webform;}
if (list_webform_two.length > 5) {VDIC_web_form_address_two=list_webform_two;}
var regWFAcustom = new RegExp("^VAR","ig");
if (VDIC_web_form_address.match(regWFAcustom))
{
TEMP_VDIC_web_form_address = URLDecode(VDIC_web_form_address,'YES','CUSTOM');
TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, '');
}
else
{
TEMP_VDIC_web_form_address = URLDecode(VDIC_web_form_address,'YES','DEFAULT','1');
}
if (VDIC_web_form_address_two.match(regWFAcustom))
{
TEMP_VDIC_web_form_address_two = URLDecode(VDIC_web_form_address_two,'YES','CUSTOM');
TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAcustom, '');
}
else
{
TEMP_VDIC_web_form_address_two = URLDecode(VDIC_web_form_address_two,'YES','DEFAULT','2');
}
document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><img src=\"./images/vdc_LB_webform.gif\" border=\"0\" alt=\"Web Form\" /></a>\n";
if (enable_second_webform > 0)
{
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormTwoRefresH();\"><img src=\"./images/vdc_LB_webform_two.gif\" border=\"0\" alt=\"Web Form 2\" /></a>\n";
}
if (CBentry_time.length > 2)
{
document.getElementById("CusTInfOSpaN").innerHTML = " <b> PREVIOUS CALLBACK </b>";
document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor;
document.getElementById("CBcommentsBoxA").innerHTML = "<b>Last Call: </b>" + CBentry_time;
document.getElementById("CBcommentsBoxB").innerHTML = "<b>CallBack: </b>" + CBcallback_time;
document.getElementById("CBcommentsBoxC").innerHTML = "<b>Agent: </b>" + CBuser;
document.getElementById("CBcommentsBoxD").innerHTML = "<b>Comments: </b><br />" + CBcomments;
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;
MD_channel_look=1;
custchannellive=1;
document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><img src=\"./images/vdc_LB_hangupcustomer.gif\" border=\"0\" alt=\"Hangup Customer\" /></a>";
if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') )
{all_record = 'YES';}
if ( (view_scripts == 1) && (campaign_script.length > 0) )
{
var SCRIPT_web_form = 'http://127.0.0.1/testing.php';
var TEMP_SCRIPT_web_form = URLDecode(SCRIPT_web_form,'YES','DEFAULT','1');
if ( (script_recording_delay > 0) && ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') ) )
{
delayed_script_load = 'YES';
RefresHScript('CLEAR');
}
else
{
load_script_contents();
}
}
if (custom_fields_enabled > 0)
{
FormContentsLoad();
}
if (get_call_launch == 'SCRIPT')
{
if (delayed_script_load == 'YES')
{
load_script_contents();
}
ScriptPanelToFront();
}
if (get_call_launch == 'FORM')
{
FormPanelToFront();
}
if (get_call_launch == 'WEBFORM')
{
window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
}
if (get_call_launch == 'WEBFORMTWO')
{
window.open(TEMP_VDIC_web_form_address_two, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
}
}
else
{
reselect_preview_dial = 1;
}
}
}
}
@@ -8882,6 +8978,39 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
}
// ################################################################################
// Generate the Dial In-Group Chooser panel
function ManuaLDiaLInGrouPSelectContent_create()
{
HidEGenDerPulldown();
showDiv('DiaLInGrouPSelectBox');
WaitingForNextStep=1;
DiaLInGrouP_HTML = '';
document.vicidial_form.DiaLInGrouPSelection.value = '';
var VD_dial_ingroups_ct_half = parseInt(dialINgroupCOUNT / 2);
DiaLInGrouP_HTML = "<table cellpadding=\"5\" cellspacing=\"5\" width=\"500px\"><tr><td colspan=\"2\"><b> DIAL IN-GROUP</b></td></tr><tr><td bgcolor=\"#99FF99\" height=\"300px\" width=\"240px\" valign=\"top\"><font class=\"log_text\"><span id=\"DiaLInGrouPSelectA\">";
var loop_ct = 0;
while (loop_ct < dialINgroupCOUNT)
{
DiaLInGrouP_HTML = DiaLInGrouP_HTML + "<font size=\"2\" style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"DiaLInGrouPSelect_submit('" + VARdialingroups[loop_ct] + "','1');return false;\">" + VARdialingroups[loop_ct] + "</a></b></font><br /><br />";
loop_ct++;
if (loop_ct == VD_dial_ingroups_ct_half)
{DiaLInGrouP_HTML = DiaLInGrouP_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=\"300px\" width=\"240px\" valign=\"top\"><font class=\"log_text\"><span id=DiaLInGrouPSelectB>";}
}
var Go_BacK_LinK = "<font size=\"3\" style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"DiaLInGrouPSelect_submit('');return false;\">Go Back</a>";
DiaLInGrouP_HTML = DiaLInGrouP_HTML + "</span></font></td></tr></table><br /><br />" + Go_BacK_LinK;
document.getElementById("DiaLInGrouPSelectContent").innerHTML = DiaLInGrouP_HTML;
if (focus_blur_enabled==1)
{
document.inert_form.inert_button.focus();
document.inert_form.inert_button.blur();
}
}
// ################################################################################
// open web form, then submit disposition
function WeBForMDispoSelect_submit()
@@ -9099,6 +9228,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
CallBackrecipient='';
CallBackCommenTs='';
DispoQMcsCODE='';
active_ingroup_dial='';
nocall_dial_flag='DISABLED';
document.vicidial_form.CallBackDatESelectioN.value = '';
document.vicidial_form.CallBackCommenTsField.value = '';
@@ -9276,6 +9407,23 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
}
// ################################################################################
// Submit the Dial In-Group
function DiaLInGrouPSelect_submit(dialingroupid,dialingroupgo)
{
hideDiv('DiaLInGrouPSelectBox');
ShoWGenDerPulldown();
WaitingForNextStep=0;
if (dialingroupid.length > 0)
{
active_ingroup_dial = dialingroupid;
document.getElementById("ManuaLDiaLInGrouPSelecteD").innerHTML = "<font size=\"2\" face=\"Arial,Helvetica\">Dial In-Group: " + active_ingroup_dial + "</font>";
}
scroll(0,0);
}
// ################################################################################
// Populate the dtmf and xfer number for each preset link in xfer-conf frame
function DtMf_PreSet_a()
@@ -10841,7 +10989,6 @@ function phone_number_format(formatphone) {
}
delete xmlhttp;
}
}
}
}
@@ -11778,6 +11925,7 @@ function phone_number_format(formatphone) {
hideDiv('PauseCodeSelectBox');
hideDiv('PresetsSelectBox');
hideDiv('GroupAliasSelectBox');
hideDiv('DiaLInGrouPSelectBox');
hideDiv('AgentViewSpan');
hideDiv('AgentXferViewSpan');
hideDiv('TimerSpan');
@@ -13595,6 +13743,10 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></center></font
<td align="left" colspan="2">
<br /><br /><CENTER>
<span id="ManuaLDiaLGrouPSelecteD"></span> &nbsp; &nbsp; <span id="ManuaLDiaLGrouP"></span>
<br><br>
<span id="ManuaLDiaLInGrouPSelecteD"></span> &nbsp; &nbsp; <span id="ManuaLDiaLInGrouP"></span>
<br><br>
<span id="NoDiaLSelecteD"></span>
</CENTER>
<br /><br />If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there.<br /> &nbsp; </td>
</tr><tr>
@@ -13845,6 +13997,18 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></center></font
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="DiaLInGrouPSelectBox">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> SELECT A DIAL IN-GROUP :<br />
<?php
if ($webphone_location == 'bar')
{echo "<br /><img src=\"images/pixel.gif\" width=\"1px\" height=\"".$webphone_height."px\" /><br />\n";}
?>
<span id="DiaLInGrouPSelectContent"> Dial In-Group Selection </span>
<input type="hidden" name="DiaLInGrouPSelection" id="DiaLInGrouPSelection" />
<br /><br /> &nbsp;
</td></tr></table>
</span>
<span style="position:absolute;left:0px;top:0px;z-index:<?php $zi++; echo $zi ?>;" id="blind_monitor_alert_span">
<table border="1" bgcolor="#CCFFCC" width="<?php echo $CAwidth ?>px" height="<?php echo $WRheight ?>px"><tr><td align="center" valign="top"> ALERT :<br />
<b><font color="red" size="5"> &nbsp; &nbsp; <span id="blind_monitor_alert_span_contents"></span></b></font>
File diff suppressed because one or more lines are too long