diff --git a/UPGRADE b/UPGRADE index a490f223..6ba3756f 100644 --- a/UPGRADE +++ b/UPGRADE @@ -188,6 +188,9 @@ OTHER CHANGES: 33. Added Non-Agent API functions for check_phone_number and server_refresh +34. Added Agent API functions for preview_dial_action while previewing or + manual alt dialing a lead + diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index 3eaf8005..b100b8e6 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -188,6 +188,7 @@ # 130926-1548 - Added new queue_log IVR entries for QM # 131209-1539 - Added called_count logging # 140126-1129 - Added VMAIL_NO_INST options +# 140215-2133 - Added several variable options for QM socket URL # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -199,7 +200,7 @@ $wait_prompt_runs=0; $at='@'; $S='*'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=195; +$mysql_log_count=196; $one_mysql_log=0; $dial_ingroup_flag=0; $called_count=1; @@ -2921,6 +2922,44 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override if ( ($queuemetrics_socket =~ /CONNECT_COMPLETE/) and (length($queuemetrics_socket_url) > 10) ) { + if ($queuemetrics_socket_url =~ /--A--/) + { + ########## FIND vicidial_list lead data ########## + $stmtA = "SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$insert_lead_id' LIMIT 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02196'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vendor_lead_code = $aryA[0]; + $list_id = $aryA[1]; + $phone_code = $aryA[2]; + $phone_number = $aryA[3]; + $title = $aryA[4]; + $first_name = $aryA[5]; + $middle_initial = $aryA[6]; + $last_name = $aryA[7]; + $postal_code = $aryA[8]; + } + $sthA->finish(); + + $queuemetrics_socket_url =~ s/^VAR//gi; + $queuemetrics_socket_url =~ s/--A--lead_id--B--/$insert_lead_id/gi; + $queuemetrics_socket_url =~ s/--A--vendor_id--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--vendor_lead_code--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--list_id--B--/$list_id/gi; + $queuemetrics_socket_url =~ s/--A--phone_number--B--/$phone_number/gi; + $queuemetrics_socket_url =~ s/--A--title--B--/$title/gi; + $queuemetrics_socket_url =~ s/--A--first_name--B--/$first_name/gi; + $queuemetrics_socket_url =~ s/--A--middle_initial--B--/$middle_initial/gi; + $queuemetrics_socket_url =~ s/--A--last_name--B--/$last_name/gi; + $queuemetrics_socket_url =~ s/--A--postal_code--B--/$postal_code/gi; + $queuemetrics_socket_url =~ s/ /+/gi; + $queuemetrics_socket_url =~ s/&/\\&/gi; + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$now_date_epoch&call_id=$YqueryCID&queue=$channel_group&agent=Agent/$VDADuser&verb=CONNECT&data1=$drop_timer&data2=&data3=&data4=$dataSS"; if ($queuemetrics_socket_url =~ /\?/) diff --git a/agi/agi-VDAD_ALL_outbound.agi b/agi/agi-VDAD_ALL_outbound.agi index 490e8c21..1fb3e428 100644 --- a/agi/agi-VDAD_ALL_outbound.agi +++ b/agi/agi-VDAD_ALL_outbound.agi @@ -107,6 +107,7 @@ # 130425-0657 - Added survey_no_response option to drop to campaign drop action # 131209-1735 - Added called_count logging # 140126-1128 - Added VMAIL_NO_INST options +# 140215-2121 - Added several variable options for QM socket URL # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -1713,6 +1714,44 @@ if ($call_handle_method =~ /SURVEY/) if ( ($queuemetrics_socket =~ /CONNECT_COMPLETE/) and (length($queuemetrics_socket_url) > 10) ) { + if ($queuemetrics_socket_url =~ /--A--/) + { + ########## FIND vicidial_list lead data ########## + $stmtA = "SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$CIDlead_id' LIMIT 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='01109'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vendor_lead_code = $aryA[0]; + $list_id = $aryA[1]; + $phone_code = $aryA[2]; + $phone_number = $aryA[3]; + $title = $aryA[4]; + $first_name = $aryA[5]; + $middle_initial = $aryA[6]; + $last_name = $aryA[7]; + $postal_code = $aryA[8]; + } + $sthA->finish(); + + $queuemetrics_socket_url =~ s/^VAR//gi; + $queuemetrics_socket_url =~ s/--A--lead_id--B--/$CIDlead_id/gi; + $queuemetrics_socket_url =~ s/--A--vendor_id--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--vendor_lead_code--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--list_id--B--/$list_id/gi; + $queuemetrics_socket_url =~ s/--A--phone_number--B--/$phone_number/gi; + $queuemetrics_socket_url =~ s/--A--title--B--/$title/gi; + $queuemetrics_socket_url =~ s/--A--first_name--B--/$first_name/gi; + $queuemetrics_socket_url =~ s/--A--middle_initial--B--/$middle_initial/gi; + $queuemetrics_socket_url =~ s/--A--last_name--B--/$last_name/gi; + $queuemetrics_socket_url =~ s/--A--postal_code--B--/$postal_code/gi; + $queuemetrics_socket_url =~ s/ /+/gi; + $queuemetrics_socket_url =~ s/&/\\&/gi; + } #### run for CONNECT $socket_send_data_begin='?'; $socket_send_data = "time_id=$now_date_epoch&call_id=$callerid&queue=$VDADcampaign&agent=Agent/VDAD&verb=CONNECT&data1=0&data2=&data3=&data4="; @@ -2485,6 +2524,44 @@ while ($drop_timer <= $DROP_TIME) if ( ($queuemetrics_socket =~ /CONNECT_COMPLETE/) and (length($queuemetrics_socket_url) > 10) ) { + if ($queuemetrics_socket_url =~ /--A--/) + { + ########## FIND vicidial_list lead data ########## + $stmtA = "SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$CIDlead_id' LIMIT 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='01110'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vendor_lead_code = $aryA[0]; + $list_id = $aryA[1]; + $phone_code = $aryA[2]; + $phone_number = $aryA[3]; + $title = $aryA[4]; + $first_name = $aryA[5]; + $middle_initial = $aryA[6]; + $last_name = $aryA[7]; + $postal_code = $aryA[8]; + } + $sthA->finish(); + + $queuemetrics_socket_url =~ s/^VAR//gi; + $queuemetrics_socket_url =~ s/--A--lead_id--B--/$CIDlead_id/gi; + $queuemetrics_socket_url =~ s/--A--vendor_id--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--vendor_lead_code--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--list_id--B--/$list_id/gi; + $queuemetrics_socket_url =~ s/--A--phone_number--B--/$phone_number/gi; + $queuemetrics_socket_url =~ s/--A--title--B--/$title/gi; + $queuemetrics_socket_url =~ s/--A--first_name--B--/$first_name/gi; + $queuemetrics_socket_url =~ s/--A--middle_initial--B--/$middle_initial/gi; + $queuemetrics_socket_url =~ s/--A--last_name--B--/$last_name/gi; + $queuemetrics_socket_url =~ s/--A--postal_code--B--/$postal_code/gi; + $queuemetrics_socket_url =~ s/ /+/gi; + $queuemetrics_socket_url =~ s/&/\\&/gi; + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$now_date_epoch&call_id=$callerid&queue=$VDADcampaign&agent=Agent/$VDADuser&verb=CONNECT&data1=$drop_timer&data2=&data3=&data4=$queuemetrics_phone_environment$pe_append"; if ($queuemetrics_socket_url =~ /\?/) @@ -3052,6 +3129,44 @@ while ($drop_timer <= $DROP_TIME) if ( ($queuemetrics_socket =~ /CONNECT_COMPLETE/) and (length($queuemetrics_socket_url) > 10) ) { + if ($queuemetrics_socket_url =~ /--A--/) + { + ########## FIND vicidial_list lead data ########## + $stmtA = "SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$CIDlead_id' LIMIT 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='01111'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vendor_lead_code = $aryA[0]; + $list_id = $aryA[1]; + $phone_code = $aryA[2]; + $phone_number = $aryA[3]; + $title = $aryA[4]; + $first_name = $aryA[5]; + $middle_initial = $aryA[6]; + $last_name = $aryA[7]; + $postal_code = $aryA[8]; + } + $sthA->finish(); + + $queuemetrics_socket_url =~ s/^VAR//gi; + $queuemetrics_socket_url =~ s/--A--lead_id--B--/$CIDlead_id/gi; + $queuemetrics_socket_url =~ s/--A--vendor_id--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--vendor_lead_code--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--list_id--B--/$list_id/gi; + $queuemetrics_socket_url =~ s/--A--phone_number--B--/$phone_number/gi; + $queuemetrics_socket_url =~ s/--A--title--B--/$title/gi; + $queuemetrics_socket_url =~ s/--A--first_name--B--/$first_name/gi; + $queuemetrics_socket_url =~ s/--A--middle_initial--B--/$middle_initial/gi; + $queuemetrics_socket_url =~ s/--A--last_name--B--/$last_name/gi; + $queuemetrics_socket_url =~ s/--A--postal_code--B--/$postal_code/gi; + $queuemetrics_socket_url =~ s/ /+/gi; + $queuemetrics_socket_url =~ s/&/\\&/gi; + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$now_date_epoch&call_id=$callerid&queue=$VDADcampaign&agent=Agent/$VDADuser&verb=CONNECT&data1=$drop_timer&data2=&data3=&data4=$queuemetrics_phone_environment$pe_append"; if ($queuemetrics_socket_url =~ /\?/) diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index 8bf3f7e3..3ad15897 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -25,7 +25,7 @@ # exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}) # # -# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 61010-1007 - First test build @@ -69,6 +69,7 @@ # 130802-0739 - Added CAMPCUST dialplan variable definition for outbound calls # 130925-1820 - Added variable filter to prevent DID SQL injection attack # 131209-1559 - Added called_count logging +# 140215-2118 - Added several variable options for QM socket URL # # defaults for PreFork @@ -1181,6 +1182,43 @@ sub process_request if ( ($queuemetrics_socket =~ /CONNECT_COMPLETE/) and (length($queuemetrics_socket_url) > 10) ) { + if ($queuemetrics_socket_url =~ /--A--/) + { + ########## vicidial_list lead data ########## + $stmtA = "SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$VD_lead_id' LIMIT 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $vendor_lead_code = $aryA[0]; + $list_id = $aryA[1]; + $phone_code = $aryA[2]; + $phone_number = $aryA[3]; + $title = $aryA[4]; + $first_name = $aryA[5]; + $middle_initial = $aryA[6]; + $last_name = $aryA[7]; + $postal_code = $aryA[8]; + } + $sthA->finish(); + + $queuemetrics_socket_url =~ s/^VAR//gi; + $queuemetrics_socket_url =~ s/--A--lead_id--B--/$VD_lead_id/gi; + $queuemetrics_socket_url =~ s/--A--vendor_id--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--vendor_lead_code--B--/$vendor_lead_code/gi; + $queuemetrics_socket_url =~ s/--A--list_id--B--/$list_id/gi; + $queuemetrics_socket_url =~ s/--A--phone_number--B--/$phone_number/gi; + $queuemetrics_socket_url =~ s/--A--title--B--/$title/gi; + $queuemetrics_socket_url =~ s/--A--first_name--B--/$first_name/gi; + $queuemetrics_socket_url =~ s/--A--middle_initial--B--/$middle_initial/gi; + $queuemetrics_socket_url =~ s/--A--last_name--B--/$last_name/gi; + $queuemetrics_socket_url =~ s/--A--postal_code--B--/$postal_code/gi; + $queuemetrics_socket_url =~ s/ /+/gi; + $queuemetrics_socket_url =~ s/&/\\&/gi; + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$secX&call_id=$VD_callerid&queue=$VD_campaign_id&agent=$VD_agent&verb=COMPLETECALLER&data1=$VD_stage&data2=$VD_call_length&data3=$queue_position&data4=$data_four"; if ($queuemetrics_socket_url =~ /\?/) diff --git a/docs/AGENT_API.txt b/docs/AGENT_API.txt index 8cdac7f4..f31d47d6 100644 --- a/docs/AGENT_API.txt +++ b/docs/AGENT_API.txt @@ -15,6 +15,7 @@ external_hangup - sends command to hangup the current phone call for one specifi external_status - sends command to set the disposition for one specific agent and move on to next call external_pause - sends command to pause/resume an agent now if not on a call, or pause after their next call if on call external_dial - sends command to manually dial a number on the agent's screen +preview_dial_action - sends a SKIP, DIALONLY, ALTDIAL, ADR3DIAL or FINISH when a lead is being previewed or manual alt dial external_add_lead - Adds a lead in the manual dial list of the campaign for logged-in agent change_ingroups - changes the selected in-groups for a logged-in agent update_fields - changes values for selected data fields in the agent interface @@ -268,6 +269,36 @@ SUCCESS: external_dial function set - 7275551212|6666|1|YES|NO|YES|123456|123202 +-------------------------------------------------------------------------------- +preview_dial_action - + +DESCRIPTION: +sends a SKIP, DIALONLY, ALTDIAL, ADR3DIAL or FINISH when a lead is being previewed or in Manual Alt Dial + +VALUES: +agent_user - + REQUIRED alphanumeric string for active agent user + +value - + One of the following actions (SKIP, DIALONLY, ALTDIAL, ADR3DIAL or FINISH) + +EXAMPLE URLS: +http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=preview_dial_action&value=SKIP + +RESPONSES: +ERROR: preview_dial_action not valid - 7275551212|1|YES|6666 +ERROR: no user found - 6666 +ERROR: agent_user is not logged in - 6666 +ERROR: agent_user is not allowed to place manual dial calls - 6666 +ERROR: preview dialing not allowed on this campaign - 6666|TESTING|DISABLED +ERROR: preview dial skipping not allowed on this campaign - 6666|TESTING|PREVIEW_ONLY +ERROR: alt number dialing not allowed on this campaign - 6666|TESTING|N +SUCCESS: preview_dial_action function set - DIALONLY|6666|DIALONLY + + + + + -------------------------------------------------------------------------------- external_add_lead - @@ -641,7 +672,7 @@ ERROR: agent_user is not logged in - 6666 ERROR: agent_user does not have a live call - 6666 ERROR: caller_id_number from group_alias is not valid - 6666|TESTING|123 ERROR: group_alias is not valid - 6666|TESTING -SUCCESS: transfer_conference function set - LOCAL_CLOSER|SALESLINE||YES|6666 +SUCCESS: transfer_conference function set - LOCAL_CLOSER|SALESLINE||YES|6666|M2141842580000000044| diff --git a/www/agc/api.php b/www/agc/api.php index 585b7b73..b5786284 100644 --- a/www/agc/api.php +++ b/www/agc/api.php @@ -70,10 +70,11 @@ # 130802-1000 - Changed to PHP mysqli functions # 140107-2140 - Added webserver and url logging # 140126-0701 - Added pause_code function +# 140214-1736 - Added preview_dial_action function # -$version = '2.8-36'; -$build = '140126-0701'; +$version = '2.8-37'; +$build = '140214-1736'; $startMS = microtime(); @@ -1423,6 +1424,156 @@ if ($function == 'external_dial') +################################################################################ +### BEGIN - preview_dial_action - sends a SKIP, DIALONLY, ALTDIAL, ADR3DIAL or FINISH when a lead is being previewed or manual alt dial +################################################################################ +if ($function == 'preview_dial_action') + { + $value = preg_replace("/[^A-Z0-9]/","",$value); + + if ( (strlen($value)<4) or ( (strlen($agent_user)<2) and (strlen($alt_user)<2) ) or ( ($value != 'SKIP') and ($value != 'DIALONLY') and ($value != 'ALTDIAL') and ($value != 'ADR3DIAL') and ($value != 'FINISH') ) ) + { + $result = 'ERROR'; + $result_reason = "preview_dial_action not valid"; + $data = ""; + echo "$result: $result_reason - $value|$data|$agent_user|$alt_user\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + if (strlen($alt_user)>1) + { + $stmt = "select count(*) from vicidial_users where custom_three='$alt_user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "select user from vicidial_users where custom_three='$alt_user' order by user;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $agent_user = $row[0]; + } + else + { + $result = 'ERROR'; + $result_reason = "no user found"; + echo "$result: $result_reason - $alt_user\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + $stmt = "select count(*) from vicidial_live_agents where user='$agent_user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "SELECT campaign_id,status FROM vicidial_live_agents where user='$agent_user';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vlac_conf_ct = mysqli_num_rows($rslt); + if ($vlac_conf_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vac_campaign_id = $row[0]; + $vac_status = $row[1]; + } + $stmt = "SELECT manual_preview_dial,alt_number_dialing FROM vicidial_campaigns where campaign_id='$vac_campaign_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vcc_conf_ct = mysqli_num_rows($rslt); + if ($vcc_conf_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $manual_preview_dial = $row[0]; + $alt_number_dialing = $row[1]; + } + if ($manual_preview_dial == 'DISABLED') + { + $result = 'ERROR'; + $result_reason = "preview dialing not allowed on this campaign"; + $data = "$vac_campaign_id|$manual_preview_dial"; + echo "$result: $result_reason - $agent_user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + if ( ($manual_preview_dial == 'PREVIEW_ONLY') and ($value == 'SKIP') ) + { + $result = 'ERROR'; + $result_reason = "preview dial skipping not allowed on this campaign"; + $data = "$vac_campaign_id|$manual_preview_dial"; + echo "$result: $result_reason - $agent_user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + if ( ($alt_number_dialing == 'N') and ( ($value == 'ALTDIAL') or ($value == 'ADR3DIAL') or ($value == 'FINISH') ) ) + { + $result = 'ERROR'; + $result_reason = "alt number dialing not allowed on this campaign"; + $data = "$vac_campaign_id|$alt_number_dialing"; + echo "$result: $result_reason - $agent_user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + + $stmt = "select count(*) from vicidial_live_agents where user='$agent_user' and status='PAUSED';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $agent_ready = $row[0]; + + if ($agent_ready > 0) + { + $stmt = "select count(*) from vicidial_users where user='$agent_user' and agentcall_manual='1';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="UPDATE vicidial_live_agents set external_dial='$value' where user='$agent_user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_to_mysqli($stmt, $link); + + if ($format=='debug') {echo "\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $result = 'SUCCESS'; + $result_reason = "preview_dial_action function set"; + $data = "$value"; + echo "$result: $result_reason - $value|$agent_user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'ERROR'; + $result_reason = "agent_user is not allowed to place manual dial calls"; + echo "$result: $result_reason - $agent_user\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'ERROR'; + $result_reason = "agent_user is not paused"; + echo "$result: $result_reason - $agent_user\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'ERROR'; + $result_reason = "agent_user is not logged in"; + echo "$result: $result_reason - $agent_user\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + } +################################################################################ +### END - preview_dial_action +################################################################################ + + + + + ################################################################################ ### BEGIN - external_add_lead - add lead in manual dial list of the campaign for logged-in agent ################################################################################ @@ -2609,6 +2760,38 @@ if ($function == 'ra_call_control') if ( ($queuemetrics_socket == 'CONNECT_COMPLETE') and (strlen($queuemetrics_socket_url) > 10) ) { + if (preg_match("/--A--/",$queuemetrics_socket_url)) + { + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vendor_id = urlencode(trim($row[0])); + $list_id = urlencode(trim($row[1])); + $phone_code = urlencode(trim($row[2])); + $phone_number = urlencode(trim($row[3])); + $title = urlencode(trim($row[4])); + $first_name = urlencode(trim($row[5])); + $middle_initial = urlencode(trim($row[6])); + $last_name = urlencode(trim($row[7])); + $postal_code = urlencode(trim($row[8])); + } + $queuemetrics_socket_url = preg_replace('/^VAR/','',$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--list_id--B--/i',"$list_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--title--B--/i',"$title",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--first_name--B--/i',"$first_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--last_name--B--/i',"$last_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$queuemetrics_socket_url); + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$StarTtime&call_id=$value&queue=$campaign_id&agent=Agent/$ra_user&verb=COMPLETEAGENT&data1=$ra_stage&data2=$ra_length&data3=$queue_position$data4SS"; if (preg_match("/\?/",$queuemetrics_socket_url)) @@ -3031,7 +3214,8 @@ if ($function == 'transfer_conference') $rslt=mysql_to_mysqli($stmt, $link); $result = 'SUCCESS'; $result_reason = "transfer_conference function set"; - echo "$result: $result_reason - $value|$ingroup_choices|$phone_number|$consultative|$agent_user\n"; + $data = "$callerid"; + echo "$result: $result_reason - $value|$ingroup_choices|$phone_number|$consultative|$agent_user|$data|\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); } } diff --git a/www/agc/manager_send.php b/www/agc/manager_send.php index 78b218c7..e054c5a0 100644 --- a/www/agc/manager_send.php +++ b/www/agc/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -118,12 +118,13 @@ # 130705-1521 - Added optional encrypted passwords compatibility # 130802-1021 - Changed to PHP mysqli functions # 130926-1755 - Added queuemetrics_record_hold option +# 140215-2057 - Added several variable options for QM socket URL # -$version = '2.8-65'; -$build = '130926-1755'; +$version = '2.8-66'; +$build = '140215-2057'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=127; +$mysql_log_count=128; $one_mysql_log=0; require_once("dbconnect_mysqli.php"); @@ -775,6 +776,39 @@ if ($ACTION=="Hangup") if ( ($queuemetrics_socket == 'CONNECT_COMPLETE') and (strlen($queuemetrics_socket_url) > 10) ) { + if (preg_match("/--A--/",$queuemetrics_socket_url)) + { + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$CLlead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02128',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vendor_id = urlencode(trim($row[0])); + $list_id = urlencode(trim($row[1])); + $phone_code = urlencode(trim($row[2])); + $phone_number = urlencode(trim($row[3])); + $title = urlencode(trim($row[4])); + $first_name = urlencode(trim($row[5])); + $middle_initial = urlencode(trim($row[6])); + $last_name = urlencode(trim($row[7])); + $postal_code = urlencode(trim($row[8])); + } + $queuemetrics_socket_url = preg_replace('/^VAR/','',$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--list_id--B--/i',"$list_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--title--B--/i',"$title",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--first_name--B--/i',"$first_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--last_name--B--/i',"$last_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$queuemetrics_socket_url); + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$StarTtime&call_id=$CalLCID&queue=$CLcampaign_id&agent=Agent/$user&verb=COMPLETEAGENT&data1=$CLstage&data2=$secondS&data3=$CLqueue_position$data4SS"; if (preg_match("/\?/",$queuemetrics_socket_url)) diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 1afb5160..c82759d7 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -343,12 +343,14 @@ # 140124-1209 - Added error catching for start/dispo call URL logging # 140126-0727 - Added pause_code API code # 140207-0208 - Manager selected in-groups are now restricted to allowed campaign in-groups +# 140214-1852 - Added preview_dial_action API function +# 140215-2051 - Added several variable options for QM socket URL # -$version = '2.8-240'; -$build = '140207-0208'; +$version = '2.8-242'; +$build = '140215-2051'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=537; +$mysql_log_count=543; $one_mysql_log=0; require_once("dbconnect_mysqli.php"); @@ -2835,6 +2837,20 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($queuemetrics_socket == 'CONNECT_COMPLETE') and (strlen($queuemetrics_socket_url) > 10) ) { + if (preg_match("/--A--/",$queuemetrics_socket_url)) + { + $queuemetrics_socket_url = preg_replace('/^VAR/','',$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--list_id--B--/i',"$list_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--title--B--/i',"$title",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--first_name--B--/i',"$first_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--last_name--B--/i',"$last_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$queuemetrics_socket_url); + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$StarTtime&call_id=$MqueryCID&queue=$campaign&agent=Agent/$user&verb=CONNECT&data1=0$data4SS"; if (preg_match("/\?/",$queuemetrics_socket_url)) @@ -2845,7 +2861,6 @@ if ($ACTION == 'manDiaLnextCaLL') if ($DB > 0) {echo "$SCUfile[0]
\n";} } } - } ##### check if system is set to generate logfile for transfers @@ -3128,6 +3143,12 @@ if ($ACTION == 'manDiaLskip') } else { + ### set the api dial action to blank if used + $stmt = "UPDATE vicidial_live_agents set external_dial='' where user='$user' and external_dial='SKIP';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00538',$user,$server_ip,$session_name,$one_mysql_log);} + $called_count = ($called_count - 1); ### set the lead back to previous status and called_count $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; @@ -3178,6 +3199,12 @@ if ($ACTION == 'manDiaLonly') } } + ### set the api dial action to blank if used + $stmt = "UPDATE vicidial_live_agents set external_dial='' where user='$user' and external_dial IN('DIALONLY','ALTDIAL','ADR3DIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00539',$user,$server_ip,$session_name,$one_mysql_log);} + ##### grab number of calls today in this campaign and increment $stmt="SELECT calls_today,extension FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); @@ -3622,6 +3649,39 @@ if ($ACTION == 'manDiaLonly') if ( ($queuemetrics_socket == 'CONNECT_COMPLETE') and (strlen($queuemetrics_socket_url) > 10) ) { + if (preg_match("/--A--/",$queuemetrics_socket_url)) + { + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00540',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vendor_id = urlencode(trim($row[0])); + $list_id = urlencode(trim($row[1])); + $phone_code = urlencode(trim($row[2])); + $phone_number = urlencode(trim($row[3])); + $title = urlencode(trim($row[4])); + $first_name = urlencode(trim($row[5])); + $middle_initial = urlencode(trim($row[6])); + $last_name = urlencode(trim($row[7])); + $postal_code = urlencode(trim($row[8])); + } + $queuemetrics_socket_url = preg_replace('/^VAR/','',$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--list_id--B--/i',"$list_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--title--B--/i',"$title",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--first_name--B--/i',"$first_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--last_name--B--/i',"$last_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$queuemetrics_socket_url); + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$StarTtime&call_id=$MqueryCID&queue=$campaign&agent=Agent/$user&verb=CONNECT&data1=0$data4SS"; if (preg_match("/\?/",$queuemetrics_socket_url)) @@ -4536,6 +4596,39 @@ if ($stage == "end") if ( ($queuemetrics_socket == 'CONNECT_COMPLETE') and (strlen($queuemetrics_socket_url) > 10) ) { + if (preg_match("/--A--/",$queuemetrics_socket_url)) + { + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00541',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vendor_id = urlencode(trim($row[0])); + $list_id = urlencode(trim($row[1])); + $phone_code = urlencode(trim($row[2])); + $phone_number = urlencode(trim($row[3])); + $title = urlencode(trim($row[4])); + $first_name = urlencode(trim($row[5])); + $middle_initial = urlencode(trim($row[6])); + $last_name = urlencode(trim($row[7])); + $postal_code = urlencode(trim($row[8])); + } + $queuemetrics_socket_url = preg_replace('/^VAR/','',$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--list_id--B--/i',"$list_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--title--B--/i',"$title",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--first_name--B--/i',"$first_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--last_name--B--/i',"$last_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$queuemetrics_socket_url); + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$StarTtime&call_id=$MDnextCID&queue=$VDcampaign_id&agent=Agent/$user&verb=COMPLETEAGENT&data1=$CLstage&data2=$length_in_sec&data3=$CLqueue_position$data4SS"; if (preg_match("/\?/",$queuemetrics_socket_url)) @@ -4777,6 +4870,39 @@ if ($stage == "end") if ( ($queuemetrics_socket == 'CONNECT_COMPLETE') and (strlen($queuemetrics_socket_url) > 10) ) { + if (preg_match("/--A--/",$queuemetrics_socket_url)) + { + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00542',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vendor_id = urlencode(trim($row[0])); + $list_id = urlencode(trim($row[1])); + $phone_code = urlencode(trim($row[2])); + $phone_number = urlencode(trim($row[3])); + $title = urlencode(trim($row[4])); + $first_name = urlencode(trim($row[5])); + $middle_initial = urlencode(trim($row[6])); + $last_name = urlencode(trim($row[7])); + $postal_code = urlencode(trim($row[8])); + } + $queuemetrics_socket_url = preg_replace('/^VAR/','',$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--list_id--B--/i',"$list_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--title--B--/i',"$title",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--first_name--B--/i',"$first_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--last_name--B--/i',"$last_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$queuemetrics_socket_url); + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$StarTtime&call_id=$MDnextCID&queue=$VDcampaign_id&agent=Agent/$user&verb=COMPLETEAGENT&data1=$CLstage&data2=$length_in_sec&data3=$VDqueue_position$data4SS"; if (preg_match("/\?/",$queuemetrics_socket_url)) @@ -9277,6 +9403,39 @@ if ($ACTION == 'updateDISPO') if ( ($queuemetrics_socket == 'CONNECT_COMPLETE') and (strlen($queuemetrics_socket_url) > 10) ) { + if (preg_match("/--A--/",$queuemetrics_socket_url)) + { + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT vendor_lead_code,list_id,phone_code,phone_number,title,first_name,middle_initial,last_name,postal_code FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00543',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $vendor_id = urlencode(trim($row[0])); + $list_id = urlencode(trim($row[1])); + $phone_code = urlencode(trim($row[2])); + $phone_number = urlencode(trim($row[3])); + $title = urlencode(trim($row[4])); + $first_name = urlencode(trim($row[5])); + $middle_initial = urlencode(trim($row[6])); + $last_name = urlencode(trim($row[7])); + $postal_code = urlencode(trim($row[8])); + } + $queuemetrics_socket_url = preg_replace('/^VAR/','',$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--list_id--B--/i',"$list_id",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--title--B--/i',"$title",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--first_name--B--/i',"$first_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--last_name--B--/i',"$last_name",$queuemetrics_socket_url); + $queuemetrics_socket_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$queuemetrics_socket_url); + } $socket_send_data_begin='?'; $socket_send_data = "time_id=$QLcomplete_time&call_id=$MDnextCID&queue=$stage&agent=Agent/$user&verb=COMPLETEAGENT&data1=$QLconnect_one&data2=$QLcomplete_length&data3=$QLcomplete_position&data4=$QLconnect_four"; if (preg_match("/\?/",$queuemetrics_socket_url)) diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 972965b7..7c554ed3 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -419,10 +419,11 @@ # 140107-2034 - Added webserver/url login logging # 140126-0741 - Added pause code API function # 140204-1230 - Added check for valid date in call log view +# 140214-1851 - Added preview_dial_action API function # -$version = '2.8-388c'; -$build = '140204-1230'; +$version = '2.8-389c'; +$build = '140214-1851'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=79; $one_mysql_log=0; @@ -4924,6 +4925,29 @@ function set_length(SLnumber,SLlength_goal,SLdirection) {NeWManuaLDiaLCalLSubmiT('NOW');} } } + if ( (in_lead_preview_state==1) || (alt_dial_status_display==1) ) + { + if ( (in_lead_preview_state==1) && (APIDiaL == 'SKIP') ) + { + ManualDialSkip(); + } + if (APIDiaL == 'DIALONLY') + { + ManualDialOnly('MaiNPhonE'); + } + if (APIDiaL == 'ALTDIAL') + { + ManualDialOnly('ALTPhonE'); + } + if (APIDiaL == 'ADR3DIAL') + { + ManualDialOnly('AddresS3'); + } + if ( (alt_dial_status_display==1) && (APIDiaL == 'FINISH') ) + { + ManualDialAltDonE(); + } + } if ( (CheckDEADcall > 0) && (VD_live_customer_call==1) ) { @@ -7359,10 +7383,22 @@ function set_length(SLnumber,SLlength_goal,SLdirection) reselect_preview_dial = 1; in_lead_preview_state = 1; var man_preview = 'YES'; - var man_status = "Preview the Lead then DIAL LEAD or SKIP LEAD"; - if (manual_preview_dial=='PREVIEW_ONLY') + + if (alt_phone_dialing == 1) { - var man_status = "Preview the Lead then DIAL LEAD"; + var man_status = "Preview the Lead then DIAL LEAD or SKIP LEAD           ALT PHONE or ADDRESS3"; + if (manual_preview_dial=='PREVIEW_ONLY') + { + var man_status = "Preview the Lead then DIAL LEAD           ALT PHONE or ADDRESS3"; + } + } + else + { + var man_status = "Preview the Lead then DIAL LEAD or SKIP LEAD"; + if (manual_preview_dial=='PREVIEW_ONLY') + { + var man_status = "Preview the Lead then DIAL LEAD"; + } } } else diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index b38a9cee..c764f44c 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -28680,7 +28680,7 @@ if ($ADD==311111111111111) echo "QueueMetrics Phone Environment Phone Append: $NWB#settings-queuemetrics_pe_phone_append$NWE\n"; echo "QueueMetrics Hold Call Log: $NWB#settings-queuemetrics_record_hold$NWE\n"; echo "QueueMetrics Socket Send: $NWB#settings-queuemetrics_socket$NWE\n"; - echo "QueueMetrics Socket Send URL: $NWB#settings-queuemetrics_socket_url$NWE\n"; + echo "QueueMetrics Socket Send URL: $NWB#settings-queuemetrics_socket_url$NWE\n"; echo "Enable Vtiger Integration: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Click here to Synchronize users with Vtiger\n";