diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 46c3a44b..f5db8ba7 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -229,6 +229,8 @@ OTHER CHANGES: 58. Added campaign option to allow agents to pause the Manual Dial Auto Next feature +59. Added ability to display inbound email messages in Script tab scripts. + diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index 94a14f79..bde473ca 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -9239,7 +9239,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') if ($email_ct==0) { # Chats don't have a priority setting, but we use it for the AGENTDIRECT_CHAT one (which has it set to 99 and is uneditable through the admin) so that is always the highest priority. Also ensures that agent does not transfer to self if transferring to the same ingroup (transferring_agent!=user clause) - $stmt="SELECT vlc.chat_id,UNIX_TIMESTAMP(vlc.chat_start_time),vlc.status,vlc.chat_creator,vlc.group_id,vlc.lead_id,vlc.user_direct_group_id,vig.queue_priority from vicidial_live_chats vlc, vicidial_inbound_groups vig where vlc.status='WAITING' and (vlc.group_id in ($chat_group_str) or (vlc.group_id='AGENTDIRECT_CHAT' and user_direct='$user')) and (transferring_agent is null or transferring_agent!='$user') order by queue_priority desc, chat_id asc limit 1;"; + $stmt="SELECT vlc.chat_id,UNIX_TIMESTAMP(vlc.chat_start_time),vlc.status,vlc.chat_creator,vlc.group_id,vlc.lead_id,vlc.user_direct_group_id,vig.queue_priority,vig.get_call_launch from vicidial_live_chats vlc, vicidial_inbound_groups vig where vlc.status='WAITING' and (vlc.group_id in ($chat_group_str) or (vlc.group_id='AGENTDIRECT_CHAT' and user_direct='$user')) and (transferring_agent is null or transferring_agent!='$user') order by queue_priority desc, chat_id asc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00638',$user,$server_ip,$session_name,$one_mysql_log);} @@ -9285,8 +9285,20 @@ if ($ACTION == 'VDADcheckINCOMINGother') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} + $stmt="SELECT get_call_launch FROM vicidial_inbound_groups where group_id='$VDADchannel_group';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $eg_ct = mysqli_num_rows($rslt); + if ($eg_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $get_call_launch = $row[0]; + } + if (!preg_match("/EMAIL|SCRIPT/",$get_call_launch)) + {$get_call_launch='EMAIL';} # Change to better suit the output processed by the agent interface - echo "1\n" . $lead_id . '|'.$uniqueid.'|' . $email_from . '|EMAIL|' . $email_row_id . '|' . $email_row_id . "|EMAIL\n"; # VDIC_data_VDAC + echo "1\n" . $lead_id . '|'.$uniqueid.'|' . $email_from . '|' . $get_call_launch . '|' . $email_row_id . '|' . $email_row_id . "|EMAIL\n"; # VDIC_data_VDAC ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; diff --git a/agc_2-X/trunk/www/agc/vdc_email_display.php b/agc_2-X/trunk/www/agc/vdc_email_display.php index 96352004..932f9852 100644 --- a/agc_2-X/trunk/www/agc/vdc_email_display.php +++ b/agc_2-X/trunk/www/agc/vdc_email_display.php @@ -22,10 +22,11 @@ # 141216-2117 - Added language settings lookups and user/pass variable standardization # 150603-1541 - Fixed email attachments issue # 170526-2330 - Added additional variable filtering +# 171126-1406 - Added fault tolerance and extra debug # -$version = '2.14-12'; -$build = '170526-2330'; +$version = '2.14-13'; +$build = '171126-1406'; require_once("dbconnect_mysqli.php"); require_once("functions.php"); @@ -259,8 +260,12 @@ if ($REPLY) } -if ($lead_id) { - $stmt="select * from vicidial_email_list where lead_id='$lead_id' and direction='INBOUND' and status IN('NEW','INCALL') order by email_date asc"; +if ( ($lead_id) or (strlen($email_row_id)>0) ) + { + $stmt="SELECT * from vicidial_email_list where lead_id='$lead_id' and direction='INBOUND' and status IN('NEW','INCALL') order by email_date asc"; + if ($email_row_id) + {$stmt="SELECT * from vicidial_email_list where lead_id='$lead_id' and email_row_id='$email_row_id' and direction='INBOUND' and status IN('NEW','INCALL') order by email_date asc";} + if ($DB > 0) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if (mysqli_num_rows($rslt)>0) { $row=mysqli_fetch_array($rslt); diff --git a/agc_2-X/trunk/www/agc/vdc_script_display.php b/agc_2-X/trunk/www/agc/vdc_script_display.php index d4518e85..60e60512 100644 --- a/agc_2-X/trunk/www/agc/vdc_script_display.php +++ b/agc_2-X/trunk/www/agc/vdc_script_display.php @@ -36,10 +36,11 @@ # 170317-2315 - Fixed in-group list script override issue, added debug # 170526-2343 - Added additional variable filtering # 171006-2055 - Added inbound_list_script_override option +# 171126-1124 - Added email message display from inbound emails only # -$version = '2.14-30'; -$build = '171006-2055'; +$version = '2.14-31'; +$build = '171126-1124'; require_once("dbconnect_mysqli.php"); require_once("functions.php"); @@ -235,6 +236,8 @@ if (isset($_GET["did_custom_four"])) {$did_custom_four=$_GET["did_custom_four" elseif (isset($_POST["did_custom_four"])) {$did_custom_four=$_POST["did_custom_four"];} if (isset($_GET["did_custom_five"])) {$did_custom_five=$_GET["did_custom_five"];} elseif (isset($_POST["did_custom_five"])) {$did_custom_five=$_POST["did_custom_five"];} +if (isset($_GET["email_row_id"])) {$email_row_id=$_GET["email_row_id"];} + elseif (isset($_POST["email_row_id"])) {$email_row_id=$_POST["email_row_id"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} @@ -264,6 +267,7 @@ $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); $orig_pass = preg_replace("/\'|\"|\\\\|;| /","",$orig_pass); $lead_id = preg_replace('/[^0-9]/', '', $lead_id); $list_id = preg_replace('/[^0-9]/', '', $list_id); +$email_row_id = preg_replace('/[^0-9]/', '', $email_row_id); $server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip); $session_id = preg_replace('/[^0-9]/','',$session_id); $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); @@ -861,8 +865,51 @@ if (preg_match('/--A--TABLEper_call_notes--B--/i',$script_text)) ### END Gather Call Log and notes ### } +$EMAILout=''; +if ( (preg_match('/--A--EMAILinbound_message--B--/i',$script_text)) and (strlen($email_row_id) > 0) ) + { + ### BEGIN Gather inbound email message ### + $stmtA="SELECT email_date,email_to,email_from,email_from_name,subject,message FROM vicidial_email_list WHERE email_row_id='$email_row_id';"; + $rsltA=mysql_to_mysqli($stmtA, $link); + $out_email_to_print = mysqli_num_rows($rslt); + if ($out_email_to_print > 0) + { + $rowA=mysqli_fetch_row($rsltA); + $Eemail_date = $rowA[0]; + $Eemail_to = $rowA[1]; + $Eemail_from = $rowA[2]; + $Eemail_from_name = $rowA[3]; + $Esubject = $rowA[4]; + $Emessage = $rowA[5]; + + $EMAILout .= ""; + $EMAILout .= ""; + $EMAILout .= ""; + $EMAILout .= ""; + $EMAILout .= ""; + $EMAILout .= ""; + + $att_stmt="SELECT * from inbound_email_attachments where email_row_id='$email_row_id'"; + $att_rslt=mysql_to_mysqli($att_stmt, $link); + if (mysqli_num_rows($att_rslt)>0) + { + $EMAILout.=""; + } + + $EMAILout .= "
"._QXZ("INBOUND EMAIL MESSAGE:").":
"._QXZ("Email Date").": $Eemail_date
"._QXZ("Subject").": $Esubject
"._QXZ("To").": $Eemail_to
"._QXZ("From").": $Eemail_from_name <$Eemail_from>
$Emessage
"._QXZ("Attachments:")."
";
+			while($att_row=mysqli_fetch_array($att_rslt)) 
+				{
+				$EMAILout.="
  • $att_row[filename]\n"; + } + $EMAIL_form.="
  • "; + $EMAILout .= "
    "; + } + ### END Gather inbound email message ### + } + $script_text = preg_replace("/\n/i","
    ",$script_text); $script_text = preg_replace('/--A--TABLEper_call_notes--B--/i',"$NOTESout",$script_text); +$script_text = preg_replace('/--A--EMAILinbound_message--B--/i',"$EMAILout",$script_text); $manual_dial_code = "" . _QXZ("MANUAL DIAL") .""; $script_text = preg_replace('/--A--MANUALDIALLINK--B--/i',$manual_dial_code,$script_text); $script_text = stripslashes($script_text); diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index cda5cc28..a85d9d34 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -571,10 +571,11 @@ # 171115-0713 - Hide preview call if preview campaign option is disabled # 171124-1057 - Added max_inbound_calls_outcome options # 171124-1459 - Added manual_auto_next_options options +# 171126-1140 - Added ability to use EMAILinbound_message script variable # -$version = '2.14-541c'; -$build = '171124-1459'; +$version = '2.14-542c'; +$build = '171126-1140'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -11062,7 +11063,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) VDIC_web_form_address_three = VICIDiaL_web_form_address_three; CalL_AutO_LauncH = VDIC_data_VDAC[3]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - if (CalL_AutO_LauncH=='EMAIL') + if ( (CalL_AutO_LauncH=='EMAIL') || (CalL_AutO_LauncH=='SCRIPT') ) { document.vicidial_form.email_row_id.value= VDIC_data_VDAC[4]; document.getElementById("EmailAudioAlertFile").play(); @@ -14986,6 +14987,7 @@ else "&did_custom_four=" + did_custom_four + '' + "&did_custom_five=" + did_custom_five + '' + "&called_count=" + document.vicidial_form.called_count.value + '' + + "&email_row_id=" + document.vicidial_form.email_row_id.value + '' + "&web_vars=" + LIVE_web_vars + '' + webform_session; @@ -16464,7 +16466,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('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_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 + '' +"&agent_email=" + LOGemail + '' +"&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 + '' +"&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 + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + '' +"&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 + '' ; + document.getElementById('vcEmailIFrame').src='./vdc_email_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&email_row_id=' + email_row_id + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + orig_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 + '' +"&agent_email=" + LOGemail + '' +"&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 + '' +"&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 + "&call_id=" + LasTCID + "&user_group=" + VU_user_group + '' + "&did_custom_one=" + did_custom_one + "&did_custom_two=" + did_custom_two + "&did_custom_three=" + did_custom_three + "&did_custom_four=" + did_custom_four + "&did_custom_five=" + did_custom_five + "&web_vars=" + LIVE_web_vars + '' +"&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 + '' ; form_list_id = ''; form_entry_list_id = ''; } diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 24e88b5a..c84d19e2 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -4208,12 +4208,13 @@ else # 171114-1100 - Fixed issue with admin log viewer for logs of modifications made by deleted users # 171124-1041 - Added max_inbound_calls_outcome campaign setting # 171124-1349 - Added manual_auto_next_options campaign setting +# 171126-1413 - Changes to allow for Email groups to display script tab on get_call_launch # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-642a'; -$build = '171124-1349'; +$admin_version = '2.14-643a'; +$build = '171126-1413'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -28240,6 +28241,15 @@ if ($ADD==3811) echo ""._QXZ("Fronter Display").": $NWB#inbound_groups-fronter_display$NWE\n"; + $eswHTML=''; $cfwHTML=''; + if ($SSenable_second_webform > 0) + {$eswHTML = "";} + if ($SSenable_third_webform > 0) + {$eswHTML = "";} + if ($SSallow_emails > 0) + {$aemHTML = "";} + echo ""._QXZ("Get Call Launch").": $NWB#inbound_groups-get_call_launch$NWE\n"; + echo ""._QXZ("Group Handling").": $NWB#inbound_groups-group_handling$NWE\n"; + echo ""._QXZ("Script").": $NWB#inbound_groups-ingroup_script$NWE\n"; + + echo ""._QXZ("Ignore List Script Override").": $NWB#inbound_groups-ignore_list_script_override$NWE\n"; + ##### get status group listings for dynamic pulldown menu $stmt="SELECT status_group_id,status_group_notes from vicidial_status_groups $whereLOGadmin_viewable_groupsSQL order by status_group_id;"; $rslt=mysql_to_mysqli($stmt, $link); diff --git a/agc_2-X/trunk/www/vicidial/help.php b/agc_2-X/trunk/www/vicidial/help.php index efa8c9c7..95dc88f3 100644 --- a/agc_2-X/trunk/www/vicidial/help.php +++ b/agc_2-X/trunk/www/vicidial/help.php @@ -3812,7 +3812,7 @@ if ($SSqc_features_active > 0)
    - -
    Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

    This would read----

    Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

    You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:"); ?> + -
    Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

    This would read----

    Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

    You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:"); ?>
    <iframe src="http://www.sample.net/test_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&call_id=--A--call_id--B--&&user_group=--A--user_group--B--&&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17">