diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php index 2b029c22..ba24a6fb 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php @@ -281,12 +281,14 @@ # 110310-0546 - Added ability to set a pause code at the same time of a pause # 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-186'; -$build = '110317-0222'; +$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"); @@ -501,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.", @@ -1255,27 +1294,6 @@ if ($ACTION == 'manDiaLnextCaLL') $inSD = $pulldate0; $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - ### Grab Servidor 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=''; @@ -1296,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); @@ -2075,6 +2094,72 @@ if ($ACTION == 'manDiaLnextCaLL') if (strlen($agent_dialed_type) < 3) {$agent_dialed_type = 'MAIN';} } + if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) + { + if ($agent_dialed_type=='ALT') + {$agent_dialed_number = $alt_phone;} + if ($agent_dialed_type=='ADDR3') + {$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 .= "Teléfono 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 .= " Teléfono 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 .= " Teléfono 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;"; @@ -2596,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; } @@ -5676,7 +5762,6 @@ if ($ACTION == 'userLOGout') $rslt=mysql_query($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00139',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} - echo "$stmt\n"; $li_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $li_conf_ct) @@ -5739,7 +5824,6 @@ if ($ACTION == 'userLOGout') $rslt=mysql_query($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00351',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} - echo "$stmt\n"; $amq_conf_ct = mysql_num_rows($rslt); $i=0; while ($i < $amq_conf_ct) @@ -6725,7 +6809,6 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00409',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} - echo "$stmt\n"; $comp_ct = mysql_num_rows($rslt); if ($comp_ct > 0) { @@ -6746,7 +6829,6 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00410',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} - echo "$stmt\n"; $connect_ct = mysql_num_rows($rslt); if ($connect_ct > 0) { @@ -6760,7 +6842,6 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'00411',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} - echo "$stmt\n"; $pausereason_ct = mysql_num_rows($rslt); if ($pausereason_ct > 0) { @@ -7206,6 +7287,9 @@ if ($ACTION == 'updateDISPO') fclose($fp); } + # debug testing sleep + # sleep(5); + echo 'Lead ' . $lead_id . ' se ha cambiado a ' . $dispo_choice . " Estado\nNext agent_log_id:\n" . $agent_log_id . "\n"; } @@ -8673,6 +8757,7 @@ if ($ACTION == 'LEADINFOview') if (strlen($row[18])>0) {$label_comments = $row[18];} ### END find any custom field labels ### + $INFOout .= ""; $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;"; @@ -8684,6 +8769,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 .= "Teléfono 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 .= " Teléfono 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 .= " Teléfono 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 ";} + } + + if (strlen($post_phone_time_diff_alert_message)>5) + {$INFOout .= "";} + } + ##### END check for postal_code and phone time zones if alert enabled + $INFOout .= ""; $INFOout .= ""; $INFOout .= ""; diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php index dc51eb31..95b72b2c 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php @@ -138,6 +138,9 @@ if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];} elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];} if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} +if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];} + elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php index fb63caf6..91fd21e7 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # This script is designed display the contents of the SCRIPT tab in the agent interface # @@ -14,10 +14,11 @@ # 100127-1611 - Added ignore_list_script_override option # 100823-1644 - Added DID variables # 100902-1344 - Added closecallid, xfercallid, agent_log_id variables +# 110420-1201 - Added web_vars variable # -$version = '2.4-8'; -$build = '100902-1344'; +$version = '2.4-9'; +$build = '110420-1201'; require("dbconnect.php"); @@ -185,6 +186,8 @@ if (isset($_GET["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_GET["CF_u elseif (isset($_POST["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_POST["CF_uses_custom_fields"];} if (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];} elseif (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];} +if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];} + elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];} header ("Content-type: text/html; charset=utf-8"); @@ -388,6 +391,7 @@ if (eregi("iframe src",$script_text)) $did_extension = eregi_replace(' ','+',$did_extension); $did_pattern = eregi_replace(' ','+',$did_pattern); $did_description = eregi_replace(' ','+',$did_description); + $web_vars = eregi_replace(' ','+',$web_vars); } $script_text = eregi_replace('--A--lead_id--B--',"$lead_id",$script_text); @@ -471,6 +475,7 @@ $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); +$script_text = eregi_replace('--A--web_vars--B--',"$web_vars",$script_text); if ($CF_uses_custom_fields=='Y') { diff --git a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php index f1039201..c4151a6a 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php @@ -343,10 +343,20 @@ # 110310-0331 - Added auto-pause/resume functions in auto-dial mode for pre-call work # 110310-1627 - Changed most browser alerts to HTML alerts, other bug fixes # 110322-0923 - Allowed hiding of gender pulldown +# 110413-1244 - Added ALT dialing from scheduled callback list, and other formatting changes +# 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 +# 110506-1612 - Added custom_3way_button_transfer button feature +# 110510-1637 - Added number validation to custom_3way_button_transfer function +# 110526-1723 - Added webphone_auto_answer option +# 110528-1033 - Added waiting_on_dispo manual dial check +# 110531-2158 - Added callback_days_limit campaign feature # -$version = '2.4-320c'; -$build = '110322-0923'; +$version = '2.4-330c'; +$build = '110531-2158'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=72; $one_mysql_log=0; @@ -1337,7 +1347,7 @@ echo ""; + + if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) + {$CCAL_OUT .= "";} + $CINC++; + } $CCAL_OUT .= "
$post_phone_time_diff_alert_message
Estado:   $row[0]
$label_vendor_lead_code:   $row[1]
List ID:   $row[2]
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1434,6 +1444,9 @@ echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1953,7 +1973,7 @@ echo "\n"; } echo "Agent web client\n"; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent,webphone_auto_answer from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -2027,6 +2047,7 @@ echo " 0) + {$limit_days=$callback_days_limit;} $Cmonths = Array('Enero','February','Marcha','Abril','Puede','Junio', 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'); @@ -2732,106 +2759,117 @@ $CCAL_OUT = ''; $CCAL_OUT .= ""; while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= "";} -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); + if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) + {$CCAL_OUT .= "
"; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; + $CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) + $CYyear = $Cyear; + $Cmonth= ($Cmon + $CINC); + if ($Cmonth > 12) { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="$MAIN_COLOR"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; + $Cmonth = ($Cmonth - 12); + $CYyear++; } + $Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); + $CfirstdayARY = getdate($Cstart); + #echo "|$Cmon|$Cmonth|$CINC|\n"; + $CPRNTDAY = date("Y-m", $Cstart); - $CCAL_OUT .= ""; + $CCAL_OUT .= ""; -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} + foreach($Cdays as $Cday) + { + $CDCLR="#ffffff"; + $CCAL_OUT .= ""; + } + + for( $Ccount=0;$Ccount<(6*7);$Ccount++) + { + $Cdayarray = getdate($Cstart); + if((($Ccount) % 7) == 0) + { + if($Cdayarray['mon'] != $CfirstdayARY['mon']) + break; + $CCAL_OUT .= ""; + } + if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) + { + $CCAL_OUT .= ""; + } + else + { + if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) + { + $CPRNTmday = $Cdayarray['mday']; + if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} + if ($limit_days > $live_days) + { + $CBL = ""; + $CEL = ""; + } + else + {$CBL=''; $CEL='';} + $CCAL_OUT .= ""; + $Cstart += ADAY; + $live_days++; + } + else + { + $CDCLR="#ffffff"; + if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) + { + $CDCLR="$MAIN_COLOR"; + $CBL = ''; + $CEL = ''; + } + else + { + $CPRNTmday = $Cdayarray['mday']; + if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} + if ($limit_days > $live_days) + { + $CBL = ""; + $CEL = ""; + } + else + {$CBL=''; $CEL='';} + $live_days++; + } + + $CCAL_OUT .= ""; + $Cstart += ADAY; + } + } + } + $CCAL_OUT .= ""; + $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; + $CCAL_OUT .= ""; + $CCAL_OUT .= ""; + $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; + $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "$Cday"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "
 "; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "
"; + $CCAL_OUT .= "
"; @@ -3234,6 +3272,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var agent_call_log_view=''; var scheduled_callbacks_alert=''; var scheduled_callbacks_count=''; + var callback_days_limit=''; var tmp_vicidial_id=''; var agent_xfer_consultative=''; var agent_xfer_dial_override=''; @@ -3313,6 +3352,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var auto_resume_precall=''; var trigger_ready=0; var hide_gender=''; + var manual_dial_cid=''; + var post_phone_time_diff_alert_message=''; + var custom_3way_button_transfer=''; + var custom_3way_button_transfer_enabled=''; + var custom_3way_button_transfer_park=''; + var waiting_on_dispo=0; var DiaLControl_auto_HTML = "\"\"Comienzo\""; var DiaLControl_auto_HTML_ready = "\"\"Comienzo\""; var DiaLControl_auto_HTML_OFF = "\"\"Comienzo\""; @@ -3537,6 +3582,54 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// custom button transfer 3way call + function custom_button_transfer() + { + ShoWTransferMain('ON'); + + if ( (custom_3way_button_transfer == 'PRESET_1') || (custom_3way_button_transfer == 'PARKING_PRESET_1') ) + {document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; document.vicidial_form.xfername.value='D1';} + if ( (custom_3way_button_transfer == 'PRESET_2') || (custom_3way_button_transfer == 'PARKING_PRESET_2') ) + {document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; document.vicidial_form.xfername.value='D2';} + if ( (custom_3way_button_transfer == 'PRESET_3') || (custom_3way_button_transfer == 'PARKING_PRESET_3') ) + {document.vicidial_form.xfernumber.value = CalL_XC_c_NuMber; document.vicidial_form.xfername.value='D3';} + if ( (custom_3way_button_transfer == 'PRESET_4') || (custom_3way_button_transfer == 'PARKING_PRESET_4') ) + {document.vicidial_form.xfernumber.value = CalL_XC_d_NuMber; document.vicidial_form.xfername.value='D4';} + if ( (custom_3way_button_transfer == 'PRESET_5') || (custom_3way_button_transfer == 'PARKING_PRESET_5') ) + {document.vicidial_form.xfernumber.value = CalL_XC_e_NuMber; document.vicidial_form.xfername.value='D5';} + if ( (custom_3way_button_transfer == 'FIELD_address3') || (custom_3way_button_transfer == 'PARKING_FIELD_address3') ) + {document.vicidial_form.xfernumber.value = document.vicidial_form.address3.value;} + if ( (custom_3way_button_transfer == 'FIELD_province') || (custom_3way_button_transfer == 'PARKING_FIELD_province') ) + {document.vicidial_form.xfernumber.value = document.vicidial_form.province.value;} + if ( (custom_3way_button_transfer == 'FIELD_security_phrase') || (custom_3way_button_transfer == 'PARKING_FIELD_security_phrase') ) + {document.vicidial_form.xfernumber.value = document.vicidial_form.security_phrase.value;} + if ( (custom_3way_button_transfer == 'FIELD_vendor_lead_code') || (custom_3way_button_transfer == 'PARKING_FIELD_vendor_lead_code') ) + {document.vicidial_form.xfernumber.value = document.vicidial_form.vendor_lead_code.value;} + if ( (custom_3way_button_transfer == 'FIELD_email') || (custom_3way_button_transfer == 'PARKING_FIELD_email') ) + {document.vicidial_form.xfernumber.value = document.vicidial_form.email.value;} + if ( (custom_3way_button_transfer == 'FIELD_owner') || (custom_3way_button_transfer == 'PARKING_FIELD_owner') ) + {document.vicidial_form.xfernumber.value = document.vicidial_form.owner.value;} + + var temp_xfernumber = document.vicidial_form.xfernumber.value; + if (temp_xfernumber.length < 3) + { + alert_box("Number to Dial invalid: " + temp_xfernumber); + ShoWTransferMain('OFF','YES'); + } + else + { + if (custom_3way_button_transfer_park > 0) + { + xfer_park_dial(); + } + else + { + SendManualDial('YES'); + } + } + } + // ################################################################################ // park customer and place 3way call function xfer_park_dial() @@ -3618,6 +3711,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var manual_number = document.vicidial_form.xfernumber.value; var manual_string = manual_number.toString(); + var threeway_cid='1'; + if (manual_dial_cid == 'AGENT_PHONE') + {threeway_cid = outbound_cid;} } var regXFvars = new RegExp("XFER","g"); if (manual_string.match(regXFvars)) @@ -3645,7 +3741,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (taskFromConf == 'YES') {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias,'',sending_preset_name,call_variables);} else - {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias,sending_preset_name,call_variables);} + {basic_originate_call(manual_string,'NO','NO','','','',threeway_cid,sending_group_alias,sending_preset_name,call_variables);} MD_ring_secondS=0; } @@ -4222,6 +4318,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) active_group_alias = APIDiaL_array_detail[8]; cid_choice = APIDiaL_array_detail[9]; vtiger_callback_id = APIDiaL_array_detail[10]; + document.vicidial_form.MDLeadID.value = APIDiaL_array_detail[11]; + document.vicidial_form.MDType.value = APIDiaL_array_detail[12]; // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value); @@ -5281,7 +5379,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var CB_calls = all_CBs_array[0]; var loop_ct=0; var conv_start=0; - var CB_HTML = "px\">\">" + var CB_HTML = "
# LLAMADABACK DATE/TIMENÚMERONAME ESTADOCAMPAIGNLAST FECHA/HORA DE LA LLAMADA DIAL
px\">\">" while (loop_ct < CB_calls) { loop_ct++; @@ -5301,7 +5399,13 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var CB_lastcall_time = call_array[7]; var CB_callback_time = call_array[8]; var CB_comments = call_array[9]; - CB_HTML = CB_HTML + ""; + var CB_comments_ten = CB_comments; + if (CB_comments_ten.length > 10) + { + CB_comments_ten = CB_comments_ten.substr(0,10); + CB_comments_ten = CB_comments_ten + '...'; + } + CB_HTML = CB_HTML + ""; } CB_HTML = CB_HTML + "
# LLAMADABACK DATE/TIMENÚMEROINFONAME ESTADOCAMPAIGNLAST FECHA/HORA DE LA LLAMADA DIAL ALT
" + loop_ct + "" + CB_callback_time + "" + CB_phone + " - INFO" + CB_name + "" + CB_status + "" + CB_campaign + "" + CB_lastcall_time + " DIAL 
" + loop_ct + "" + CB_callback_time + "" + CB_phone + "" + CB_comments_ten + " - INFO" + CB_name + "" + CB_status + "" + CB_campaign + "" + CB_lastcall_time + " DIAL ALT 
"; document.getElementById("CallBacKsLisT").innerHTML = CB_HTML; @@ -5364,21 +5468,28 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // ################################################################################ // Open up a callback customer record as manual dial preview mode - function new_callback_call(taskCBid,taskLEADid) + function new_callback_call(taskCBid,taskLEADid,taskCBalt) { - // alt_phone_dialing=1; - ÚltimoCallbackViewed=1; - ÚltimoCallbackCount = (ÚltimoCallbackCount - 1); - auto_dial_level=0; - manual_dial_in_progress=1; - MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - if (alt_phone_dialing == 1) - {buildDiv('DiaLDiaLAltPhonE');} - document.vicidial_form.LeadPreview.checked=true; - // document.vicidial_form.DiaLAltPhonE.checked=true; - hideDiv('CallBacKsLisTBox'); - ManualDialNext(taskCBid,taskLEADid,'','','','0'); + if (waiting_on_dispo > 0) + { + alert_box("System Delay, Por favor, inténtelo de nuevo
code:" + agent_log_id + " - " + waiting_on_dispo + ""); + } + else + { + // alt_phone_dialing=1; + ÚltimoCallbackViewed=1; + ÚltimoCallbackCount = (ÚltimoCallbackCount - 1); + auto_dial_level=0; + manual_dial_in_progress=1; + MainPanelToFront(); + buildDiv('DiaLLeaDPrevieW'); + if (alt_phone_dialing == 1) + {buildDiv('DiaLDiaLAltPhonE');} + document.vicidial_form.LeadPreview.checked=true; + // document.vicidial_form.DiaLAltPhonE.checked=true; + hideDiv('CallBacKsLisTBox'); + ManualDialNext(taskCBid,taskLEADid,'','','','0','',taskCBalt); + } } @@ -5464,62 +5575,69 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // Insert the new manual dial as a lead and go to manual dial screen function NeWManuaLDiaLCalLSubmiT(tempDiaLnow) { - hideDiv('NeWManuaLDiaLBox'); - document.getElementById("debugbottomspan").innerHTML = "DEBUG OUTPUT" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; - - var sending_group_alias = 0; - var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; - var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; - var MDLeadIDform = document.vicidial_form.MDLeadID.value; - var MDTypeform = document.vicidial_form.MDType.value; - var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; - var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; - var MDLookuPLeaD = 'new'; - if (document.vicidial_form.LeadLookuP.checked==true) - {MDLookuPLeaD = 'lookup';} - - if (MDDiaLCodEform.length < 1) - {MDDiaLCodEform = document.vicidial_form.phone_code.value;} - - if (MDDiaLOverridEform.length > 0) + if (waiting_on_dispo > 0) { - agent_dialed_number=1; - agent_dialed_type='MANUAL_OVERRIDE'; - basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); + alert_box("System Delay, Por favor, inténtelo de nuevo
code:" + agent_log_id + " - " + waiting_on_dispo + ""); } else { - auto_dial_level=0; - manual_dial_in_progress=1; - agent_dialed_number=1; - MainPanelToFront(); + hideDiv('NeWManuaLDiaLBox'); + document.getElementById("debugbottomspan").innerHTML = "DEBUG OUTPUT" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias; - if (tempDiaLnow == 'PREVIEW') + var sending_group_alias = 0; + var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value; + var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value; + var MDLeadIDform = document.vicidial_form.MDLeadID.value; + var MDTypeform = document.vicidial_form.MDType.value; + var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value; + var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value; + var MDLookuPLeaD = 'new'; + if (document.vicidial_form.LeadLookuP.checked==true) + {MDLookuPLeaD = 'lookup';} + + if (MDDiaLCodEform.length < 1) + {MDDiaLCodEform = document.vicidial_form.phone_code.value;} + + if (MDDiaLOverridEform.length > 0) { - // alt_phone_dialing=1; - agent_dialed_type='MANUAL_PREVIEW'; - buildDiv('DiaLLeaDPrevieW'); - if (alt_phone_dialing == 1) - {buildDiv('DiaLDiaLAltPhonE');} - document.vicidial_form.LeadPreview.checked=true; - // document.vicidial_form.DiaLAltPhonE.checked=true; + agent_dialed_number=1; + agent_dialed_type='MANUAL_OVERRIDE'; + basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0'); } else { - agent_dialed_type='MANUAL_DIALNOW'; - document.vicidial_form.LeadPreview.checked=false; - document.vicidial_form.DiaLAltPhonE.checked=false; + auto_dial_level=0; + manual_dial_in_progress=1; + agent_dialed_number=1; + MainPanelToFront(); + + if (tempDiaLnow == 'PREVIEW') + { + // alt_phone_dialing=1; + agent_dialed_type='MANUAL_PREVIEW'; + buildDiv('DiaLLeaDPrevieW'); + if (alt_phone_dialing == 1) + {buildDiv('DiaLDiaLAltPhonE');} + document.vicidial_form.LeadPreview.checked=true; + // document.vicidial_form.DiaLAltPhonE.checked=true; + } + else + { + agent_dialed_type='MANUAL_DIALNOW'; + document.vicidial_form.LeadPreview.checked=false; + document.vicidial_form.DiaLAltPhonE.checked=false; + } + if (active_group_alias.length > 1) + {var sending_group_alias = 1;} + + ManualDialNext("",MDLeadIDform,MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias,MDTypeform); } - if (active_group_alias.length > 1) - {var sending_group_alias = 1;} - ManualDialNext("",MDLeadIDform,MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias,MDTypeform); + document.vicidial_form.MDPhonENumbeR.value = ''; + document.vicidial_form.MDDiaLOverridE.value = ''; + document.vicidial_form.MDLeadID.value = ''; + document.vicidial_form.MDType.value = ''; } - - document.vicidial_form.MDPhonENumbeR.value = ''; - document.vicidial_form.MDDiaLOverridE.value = ''; - document.vicidial_form.MDLeadID.value = ''; - document.vicidial_form.MDType.value = ''; } // ################################################################################ @@ -5536,22 +5654,29 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } else { - var MDLookuPLeaD = 'new'; - if (document.vicidial_form.LeadLookuP.checked==true) - {MDLookuPLeaD = 'lookup';} - - agent_dialed_number=1; - agent_dialed_type='MANUAL_DIALFAST'; - // alt_phone_dialing=1; - auto_dial_level=0; - manual_dial_in_progress=1; - MainPanelToFront(); - buildDiv('DiaLLeaDPrevieW'); - if (alt_phone_dialing == 1) - {buildDiv('DiaLDiaLAltPhonE');} - document.vicidial_form.LeadPreview.checked=false; - // document.vicidial_form.DiaLAltPhonE.checked=true; - ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); + if (waiting_on_dispo > 0) + { + alert_box("System Delay, Por favor, inténtelo de nuevo
code:" + agent_log_id + " - " + waiting_on_dispo + ""); + } + else + { + var MDLookuPLeaD = 'new'; + if (document.vicidial_form.LeadLookuP.checked==true) + {MDLookuPLeaD = 'lookup';} + + agent_dialed_number=1; + agent_dialed_type='MANUAL_DIALFAST'; + // alt_phone_dialing=1; + auto_dial_level=0; + manual_dial_in_progress=1; + MainPanelToFront(); + buildDiv('DiaLLeaDPrevieW'); + if (alt_phone_dialing == 1) + {buildDiv('DiaLDiaLAltPhonE');} + document.vicidial_form.LeadPreview.checked=false; + // document.vicidial_form.DiaLAltPhonE.checked=true; + ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0'); + } } } @@ -5761,6 +5886,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } + if (custom_3way_button_transfer_enabled > 0) + { + document.getElementById("CustomXfer").innerHTML = "\"Custom"; + } + if (call_requeue_button > 0) { var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -6007,353 +6137,376 @@ function set_length(SLnumber,SLlength_goal,SLdirection) // Send the Manual Marcar el Siguiente Número request function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias,mdtype) { - inOUT = 'OUT'; - all_record = 'NO'; - all_record_count=0; - if (dial_method == "INBOUND_MAN") + if (waiting_on_dispo > 0) { - auto_dial_level=0; - - if (VDRP_stage != 'PAUSED') - { - agent_log_id = AutoDial_ReSume_PauSe("VDADpause",'','','',"DIALNEXT",'1','NXDIAL'); - - // PauseCodeSelect_submit("NXDIAL"); - } - else - {auto_dial_level=starting_dial_level;} - - document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + alert_box("System Delay, Por favor, inténtelo de nuevo
code:" + agent_log_id + " - " + waiting_on_dispo + ""); } else { - document.getElementById("DiaLControl").innerHTML = "\"Marcar"; - } - if (document.vicidial_form.LeadPreview.checked==true) - { - reselect_preview_dial = 1; - in_lead_preview_state = 1; - var man_preview = 'YES'; - var man_status = "Mostrar el Lead entonces MARCAR LEAD or SALTAR LEAD"; - if (manual_preview_dial=='PREVIEW_ONLY') + inOUT = 'OUT'; + all_record = 'NO'; + all_record_count=0; + if (dial_method == "INBOUND_MAN") { - var man_status = "Mostrar el Lead entonces MARCAR LEAD"; - } - } - else - { - reselect_preview_dial = 0; - var man_preview = 'NO'; - var man_status = "Espeerar al Ring..."; - } + auto_dial_level=0; - if ( (mdtype == 'ALT') || (mdtype == 'ADDR3') ) - { - agent_dialed_type = mdtype; - agent_dialed_number = mdnPhonENumbeR; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - if (cid_choice.length > 3) - {var call_cid = cid_choice;} - else - {var call_cid = campaign_cid;} - if (prefix_choice.length > 0) - {var call_prefix = prefix_choice;} - 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; - // 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) + if (VDRP_stage != 'PAUSED') { - var MDnextResponse = null; - // alert(manDiaLnext_query); - // alert(xmlhttp.responseText); - MDnextResponse = xmlhttp.responseText; + agent_log_id = AutoDial_ReSume_PauSe("VDADpause",'','','',"DIALNEXT",'1','NXDIAL'); - var MDnextResponse_array=MDnextResponse.split("\n"); - MDnextCID = MDnextResponse_array[0]; - ÚltimoCallCID = MDnextResponse_array[0]; + // PauseCodeSelect_submit("NXDIAL"); + } + else + {auto_dial_level=starting_dial_level;} - var regMNCvar = new RegExp("TOLVA VACÍA","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)) ) + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + } + else + { + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; + } + var manual_dial_only_type_flag = ''; + if ( (mdtype == 'ALT') || (mdtype == 'ADDR3') ) + { + agent_dialed_type = mdtype; + agent_dialed_number = mdnPhonENumbeR; + if (mdtype == 'ALT') + {manual_dial_only_type_flag = 'ALTPhonE';} + if (mdtype == 'ADDR3') + {manual_dial_only_type_flag = 'AddresS3';} + } + if (document.vicidial_form.LeadPreview.checked==true) + { + reselect_preview_dial = 1; + in_lead_preview_state = 1; + var man_preview = 'YES'; + var man_status = "Mostrar el Lead entonces MARCAR LEAD or SALTAR LEAD"; + if (manual_preview_dial=='PREVIEW_ONLY') + { + var man_status = "Mostrar el Lead entonces MARCAR LEAD"; + } + } + else + { + reselect_preview_dial = 0; + var man_preview = 'NO'; + var man_status = "Espeerar al Ring..."; + } + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + if (cid_choice.length > 3) + {var call_cid = cid_choice;} + else + { + var call_cid = campaign_cid; + if (manual_dial_cid == 'AGENT_PHONE') + {call_cid = outbound_cid;} + } + if (prefix_choice.length > 0) + {var call_prefix = prefix_choice;} + 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; + // 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 alert_displayed=0; - trigger_ready=1; - alt_phone_dialing=starting_alt_phone_dialing; - auto_dial_level=starting_dial_level; - MainPanelToFront(); - CalLBacKsCounTCheck(); + var MDnextResponse = null; + // alert(manDiaLnext_query); + // alert(xmlhttp.responseText); + MDnextResponse = xmlhttp.responseText; - if (MDnextCID.match(regMNCvar)) - {alert_box("No más Leads en el hopper de la campaña:\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("Este número de teléfono no está en la campaña de las listas:\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("Error no especificado:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + var MDnextResponse_array=MDnextResponse.split("\n"); + MDnextCID = MDnextResponse_array[0]; + ÚltimoCallCID = MDnextResponse_array[0]; - if (starting_dial_level == 0) + var regMNCvar = new RegExp("TOLVA VACÍA","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)) ) { - document.getElementById("DiaLControl").innerHTML = "\"Marcar"; - } - else - { - if (dial_method == "INBOUND_MAN") + 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 más Leads en el hopper de la campaña:\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("Este número de teléfono no está en la campaña de las listas:\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("Error no especificado:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;} + + if (starting_dial_level == 0) { - auto_dial_level=starting_dial_level; - - document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; + document.getElementById("DiaLControl").innerHTML = "\"Marcar"; } else { - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; - } - document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; - reselect_alt_dial = 0; - } - } - 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 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]; - - 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); - - document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + "   " + 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 = "\"Formulario\n"; - if (enable_second_webform > 0) - { - document.getElementById("WebFormSpanTwo").innerHTML = "\"Formulario\n"; - } - - if (CBentry_time.length > 2) - { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS LLAMADABACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Llamada Pasada:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Servicio repetido:" + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Comentarios:
" + CBcomments; - showDiv('CBcommentsBox'); - } - - if (document.vicidial_form.LeadPreview.checked==false) - { - reselect_preview_dial = 0; - MD_channel_look=1; - custchannellive=1; - - document.getElementById("HangupControl").innerHTML = "\"Colgar"; - - 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') ) ) + if (dial_method == "INBOUND_MAN") { - delayed_script_load = 'YES'; - RefresHScript('CLEAR'); + auto_dial_level=starting_dial_level; + + document.getElementById("DiaLControl").innerHTML = "\"\"Comienzo\"
\"Marcar"; } 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); + + document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + "   " + 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 = "\"Formulario\n"; + if (enable_second_webform > 0) + { + document.getElementById("WebFormSpanTwo").innerHTML = "\"Formulario\n"; + } + + if (CBentry_time.length > 2) + { + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS LLAMADABACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Llamada Pasada:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Servicio repetido:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Comentarios:
" + CBcomments; + showDiv('CBcommentsBox'); + } + + if (post_phone_time_diff_alert_message.length > 10) + { + document.getElementById("post_phone_time_diff_span_contents").innerHTML = "     " + post_phone_time_diff_alert_message + "
"; + 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 = "\"Colgar"; + + 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; + } } } } - } - delete xmlhttp; + delete xmlhttp; - if (document.vicidial_form.LeadPreview.checked==false) - { - active_group_alias=''; - cid_choice=''; - prefix_choice=''; - agent_dialed_number=''; - agent_dialed_type=''; - CalL_ScripT_id=''; + if (document.vicidial_form.LeadPreview.checked==false) + { + active_group_alias=''; + cid_choice=''; + prefix_choice=''; + agent_dialed_number=''; + agent_dialed_type=''; + CalL_ScripT_id=''; + } } } } @@ -6462,6 +6615,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 en to next lead"; if (dial_method == "INBOUND_MAN") @@ -6573,7 +6732,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) usegroupalias=1; } else - {var call_cid = campaign_cid;} + { + var call_cid = campaign_cid; + if (manual_dial_cid == 'AGENT_PHONE') + {call_cid = outbound_cid;} + } if (prefix_choice.length > 0) {var call_prefix = prefix_choice;} else @@ -6766,6 +6929,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } delete xmlhttp; } + waiting_on_dispo=0; return agent_log_id; } @@ -7268,6 +7432,12 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } + if (custom_3way_button_transfer_enabled > 0) + { + document.getElementById("CustomXfer").innerHTML = "\"Custom"; + } + + if (call_requeue_button > 0) { var CloserSelectChoices = document.vicidial_form.CloserSelectList.value; @@ -7720,6 +7890,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 = "\"Formulario"; @@ -7743,6 +7919,9 @@ function set_length(SLnumber,SLlength_goal,SLdirection) if (quick_transfer_button_enabled > 0) {document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA";} + if (custom_3way_button_transfer_enabled > 0) + {document.getElementById("CustomXfer").innerHTML = "\"Custom";} + if (call_requeue_button > 0) { document.getElementById("ReQueueCall").innerHTML = "\"Re-Queue"; @@ -8373,6 +8552,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) CheckDEADcallON=0; customer_3way_hangup_counter=0; customer_3way_hangup_counter_trigger=0; + waiting_on_dispo=1; document.getElementById("callchannel").innerHTML = ''; document.vicidial_form.callserverip.value = ''; document.vicidial_form.xferchannel.value = ''; @@ -8420,16 +8600,20 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { // alert(DSupdate_query + "\n" +xmlhttp.responseText); - if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) ) + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - var check_dispo = null; - check_dispo = xmlhttp.responseText; - var check_DS_array=check_dispo.split("\n"); - // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|"); - if (check_DS_array[1] == 'Next agent_log_id:') + // alert(xmlhttp.responseText); + if (auto_dial_level < 1) { - agent_log_id = check_DS_array[2]; + var check_dispo = null; + check_dispo = xmlhttp.responseText; + var check_DS_array=check_dispo.split("\n"); + if (check_DS_array[1] == 'Next agent_log_id:') + { + agent_log_id = check_DS_array[2]; + } } + waiting_on_dispo=0; } } delete xmlhttp; @@ -8535,6 +8719,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(); @@ -8567,7 +8758,6 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { AutoDialWaiting = 0; AutoDial_ReSume_PauSe("VDADpause"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML; } VICIDiaL_pause_calling = 1; if (dispo_check_all_pause != '1') @@ -8581,7 +8771,6 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { AutoDialWaiting = 1; agent_log_id = AutoDial_ReSume_PauSe("VDADready","NEW_ID"); - // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready; } else { @@ -9550,6 +9739,7 @@ else "&xfercallid=" + xfercallid + '' + "&agent_log_id=" + agent_log_id + '' + "&entry_list_id=" + document.vicidial_form.entry_list_id.value + '' + + "&web_vars=" + LIVE_web_vars + '' + webform_session; if (custom_field_names.length > 2) @@ -10710,7 +10900,7 @@ function phone_number_format(formatphone) { var form_entry_list_id = document.vicidial_form.entry_list_id.value; if (form_entry_list_id.length > 2) {form_list_id = form_entry_list_id} - document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' +"&agent_log_id=" + agent_log_id + ''; + document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY' + "&campaign=" + campaign + "&phone_login=" + phone_login + "&original_phone_login=" + original_phone_login +"&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + "&group=" + group + "&channel_group=" + group + "&SQLdate=" + SQLdate + "&epoch=" + UnixTime + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&customer_zap_channel=" + lastcustchannel + "&customer_server_ip=" + lastcustserverip +"&server_ip=" + server_ip + "&SIPexten=" + extension + "&session_id=" + session_id + "&phone=" + document.vicidial_form.phone_number.value + "&parked_by=" + document.vicidial_form.lead_id.value +"&dispo=" + LeaDDispO + '' +"&dialed_number=" + dialed_number + '' +"&dialed_label=" + dialed_label + '' +"&camp_script=" + campaign_script + '' +"&in_script=" + CalL_ScripT_id + '' +"&script_width=" + script_width + '' +"&script_height=" + script_height + '' +"&fullname=" + LOGfullname + '' +"&recording_filename=" + recording_filename + '' +"&recording_id=" + recording_id + '' +"&user_custom_one=" + VU_custom_one + '' +"&user_custom_two=" + VU_custom_two + '' +"&user_custom_three=" + VU_custom_three + '' +"&user_custom_four=" + VU_custom_four + '' +"&user_custom_five=" + VU_custom_five + '' +"&preset_number_a=" + CalL_XC_a_NuMber + '' +"&preset_number_b=" + CalL_XC_b_NuMber + '' +"&preset_number_c=" + CalL_XC_c_NuMber + '' +"&preset_number_d=" + CalL_XC_d_NuMber + '' +"&preset_number_e=" + CalL_XC_e_NuMber + '' +"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +"&did_id=" + did_id + '' +"&did_extension=" + did_extension + '' +"&did_pattern=" + did_pattern + '' +"&did_description=" + did_description + '' +"&closecallid=" + closecallid + '' +"&xfercallid=" + xfercallid + '' +"&agent_log_id=" + agent_log_id + '' +"&web_vars=" + LIVE_web_vars + ''; form_list_id = ''; form_entry_list_id = ''; } @@ -10722,7 +10912,7 @@ function phone_number_format(formatphone) { showDiv('DispoButtonHideA'); showDiv('DispoButtonHideB'); showDiv('DispoButtonHideC'); - document.getElementById("DispoSelectBox").style.top = 340; + document.getElementById("DispoSelectBox").style.top = '340px'; document.getElementById("DispoSelectMaxMin").innerHTML = " maximice "; } @@ -10731,7 +10921,7 @@ function phone_number_format(formatphone) { // Move the Dispo frame to the top and change the link to minimize function DispoMaximize() { - document.getElementById("DispoSelectBox").style.top = 1; + document.getElementById("DispoSelectBox").style.top = '1px'; document.getElementById("DispoSelectMaxMin").innerHTML = " reduzca al mínimo "; hideDiv('DispoButtonHideA'); hideDiv('DispoButtonHideB'); @@ -11086,6 +11276,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');} @@ -11822,12 +12013,16 @@ function phone_number_format(formatphone) { var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} - document.getElementById("TransferMain").style.top = xfer_height; + var X_xfer_height = xfer_height.toString(); + var temp_xfer_height = X_xfer_height + 'px'; + document.getElementById("TransferMain").style.top = temp_xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transferencia"; if ( (quick_transfer_button_enabled > 0) && (quick_transfer_button_locked < 1) ) {document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA";} + if (custom_3way_button_transfer_enabled > 0) + {document.getElementById("CustomXfer").innerHTML = "\"Custom";} } else { @@ -11846,6 +12041,10 @@ function phone_number_format(formatphone) { { document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } + if (custom_3way_button_transfer_enabled > 0) + { + document.getElementById("CustomXfer").innerHTML = "\"Custom"; + } } } if (three_way_call_cid == 'AGENT_CHOOSE') @@ -12076,6 +12275,7 @@ $zi=2; echo "
\n"; } ?> + ESTADO: @@ -12118,6 +12318,8 @@ $zi=2; 0) {echo "\"Quick
\n";} + if ($custom_3way_button_transfer_enabled > 0) + {echo "\"Custom
\n";} ?>