From 17d55137f2313d68e4e9db8ca7b84df429ccd955 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 30 Mar 2017 13:36:05 +0000 Subject: [PATCH] populate new lead with field data from dropped lead in AST_droplist_process.pl script git-svn-id: svn://192.168.202.10@2717 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/AST_droplist_process.pl | 46 +++++++++++++++++++-- agc_2-X/trunk/docs/CALLER_ID_NAME_CODES.txt | 4 +- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/agc_2-X/trunk/bin/AST_droplist_process.pl b/agc_2-X/trunk/bin/AST_droplist_process.pl index afba399d..9df38029 100644 --- a/agc_2-X/trunk/bin/AST_droplist_process.pl +++ b/agc_2-X/trunk/bin/AST_droplist_process.pl @@ -12,6 +12,7 @@ # # CHANGES # 170326-1541 - First version +# 170330-0934 - populate new lead with field data from dropped lead # $US = '_'; @@ -373,7 +374,6 @@ while ($sthDROProws > $q) } if ($duplicate < 1) { - ### BEGIN figure out the timezone of the phone number ### $PC_processed=0; ### UNITED STATES ### @@ -550,10 +550,50 @@ while ($sthDROProws > $q) if ($DBX) {print " DST: 0\n";} $AC_processed++; } - ### END figure out the timezone of the phone number ### - $stmtC="INSERT INTO vicidial_list set entry_date=NOW(),user='',phone_number='$Aphone_number[$q]',phone_code='$Aphone_code[$q]',list_id='$list_id',last_local_call_time='$Adrop_date[$q]',comments='$Acampaign_id[$q] - $ingroup_name - $Adrop_date[$q]',source_id='$Alead_id[$q]',status='NEW',called_since_last_reset='N',gmt_offset_now='$gmt_offset';"; + ### BEGIN gather existing field data for lead ### + $stmtB = "SELECT vendor_lead_code,source_id,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,rank,owner from vicidial_list where lead_id='$Alead_id[$q]';"; + $sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthBrows=$sthA->rows; + if ($sthBrows > 0) + { + @aryA = $sthA->fetchrow_array; + $vendor_lead_code = $aryA[0]; + $source_id = $aryA[1]; + $title = $aryA[2]; + $first_name = $aryA[3]; + $middle_initial = $aryA[4]; + $last_name = $aryA[5]; + $address1 = $aryA[6]; + $address2 = $aryA[7]; + $address3 = $aryA[8]; + $city = $aryA[9]; + $state = $aryA[10]; + $province = $aryA[11]; + $postal_code = $aryA[12]; + $country_code = $aryA[13]; + $gender = $aryA[14]; + $date_of_birth = $aryA[15]; + $alt_phone = $aryA[16]; + $email = $aryA[17]; + $security_phrase = $aryA[18]; + $comments = $aryA[19]; + $rank = $aryA[20]; + $owner = $aryA[21]; + } + $sthA->finish(); + + if (length($comments)>0) + {$comments .= " $Acampaign_id[$q] - $ingroup_name - $Adrop_date[$q]";} + else + {$comments = "$Acampaign_id[$q] - $ingroup_name - $Adrop_date[$q]";} + if (length($source_id)<1) + {$source_id = "$Alead_id[$q]";} + ### END gather existing field data for lead ### + + $stmtC="INSERT INTO vicidial_list set entry_date=NOW(),user='',phone_number='$Aphone_number[$q]',phone_code='$Aphone_code[$q]',list_id='$list_id',last_local_call_time='$Adrop_date[$q]',status='NEW',called_since_last_reset='N',gmt_offset_now='$gmt_offset',vendor_lead_code='$vendor_lead_code',source_id='$source_id',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',rank='$rank',owner='$owner';"; $Caffected_rows = $dbhA->do($stmtC); $insert_counter++; diff --git a/agc_2-X/trunk/docs/CALLER_ID_NAME_CODES.txt b/agc_2-X/trunk/docs/CALLER_ID_NAME_CODES.txt index bc166d88..11855b98 100644 --- a/agc_2-X/trunk/docs/CALLER_ID_NAME_CODES.txt +++ b/agc_2-X/trunk/docs/CALLER_ID_NAME_CODES.txt @@ -1,4 +1,4 @@ -CALLER ID NAME CODES DOC Started: 2013-07-15 Updated: 2017-02-22 +CALLER ID NAME CODES DOC Started: 2013-07-15 Updated: 2017-03-29 This document is meant for reference only, and it does not contain all CID name codes possible, but more will be added over time. @@ -17,7 +17,7 @@ FX - Xfer Back to session From Park (FXvdcW14529553216666) VH - Inbound Agent Alert (VH7152252518600051) RH - Recording Hangup (RH1234514529553690) CX - Consultative Transfer (CXAR2420160116094751) -XLvdc - Agent ReQueue Call (XLvdcW13739431946666) [epoch + user...] +XLvdc - Agent Local Closer or ReQueue Call (XLvdcW13739431946666) [epoch + user...] XBvdc - Agent blind transfer (XBvdcW14528875091001100110011001) [epoch + user...] AGMON - Remote Agent Monitor (AGMON715224918000001) HLvdcW - Hangup of customer call from agent screen (HLvdcW1475524272tluc)