From 318aec1b38b0fe105a881933f391b3bf8cf1366c Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 16 Jan 2007 21:37:51 +0000 Subject: [PATCH] final AST_VDauto_dial, FastAGI_log and admin.php changes for the auto alt dial functionality on the server side docs updated git-svn-id: svn://192.168.202.10@467 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 5 +- bin/AST_VDauto_dial.pl | 107 ++++++++++++++++-- bin/FastAGI_log.pl | 93 ++++++++++++++- docs/ALTERNATE_NUMBER_DIALING.txt | 2 +- .../TO_BE_TRANSLATED_2.0.3.txt | 2 + www/agc/vdc_db_query.php | 4 +- www/vicidial/admin.php | 18 +-- 7 files changed, 203 insertions(+), 28 deletions(-) diff --git a/UPGRADE b/UPGRADE index 0006c4c4..68bb473a 100644 --- a/UPGRADE +++ b/UPGRADE @@ -32,8 +32,9 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 8. You can now use BLEND/INBND/*_C/*_B/*_I to define a campaign a a CLOSER campaign capable of taking inbound calls. -9. IN PROCESS- Adding ability to dial alternate numbers per lead in auto-dial - mode. +9. In Auto-dialing campaigns(RATIO and ADAPT) you can now configure the dialer + to dial up to two alternate numbers per lead automatically + diff --git a/bin/AST_VDauto_dial.pl b/bin/AST_VDauto_dial.pl index af254733..58c0761b 100644 --- a/bin/AST_VDauto_dial.pl +++ b/bin/AST_VDauto_dial.pl @@ -37,8 +37,8 @@ # 50620-1349 - Added custom vdad transfer AGI extension per campaign # 50810-1610 - Added database server variable definitions lookup # 50810-1630 - Added max_vicidial_trunks server limiter on active lines -# 50812-0957 - corrected max_trunks logic, added update of server every 25 sec -# 60120-1522 - corrected time error for hour variable, caused agi problems +# 50812-0957 - Corrected max_trunks logic, added update of server every 25 sec +# 60120-1522 - Corrected time error for hour variable, caused agi problems # 60427-1223 - Fixed Blended in/out CLOSER campaign issue # 60608-1134 - Altered vac table field of call_type for IN OUT distinction # 60612-1324 - Altered dead call section to accept BUSY detection from VD_hangup @@ -46,15 +46,16 @@ # 60614-1142 - Added code to work with recycled leads, multi called_since_last_reset values # - Removed gmt lead validation because it is already done by VDhopper # 60807-1438 - Changed to DBI -# - changed to use /etc/astguiclient.conf for configs -# 60814-1749 - added option for no logging to file -# 60821-1546 - added option to not dial phone_code per campaign -# 60824-1437 - added available_only_ratio_tally option -# 61003-1353 - added restrictions for server trunks -# 61113-1625 - added code for clearing VDAC LIVE jams -# 61115-1725 - added OUTBALANCE to call calculation for call_type for balance dialing -# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns -# 70115-1635 - added auto-alt-dial functionality +# - Changed to use /etc/astguiclient.conf for configs +# 60814-1749 - Added option for no logging to file +# 60821-1546 - Added option to not dial phone_code per campaign +# 60824-1437 - Added available_only_ratio_tally option +# 61003-1353 - Added restrictions for server trunks +# 61113-1625 - Added code for clearing VDAC LIVE jams +# 61115-1725 - Added OUTBALANCE to call calculation for call_type for balance dialing +# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70115-1635 - Added initial auto-alt-dial functionality +# 70116-1619 - Added VDAD Ring-No-Answer Auto Alt Dial code # @@ -854,7 +855,7 @@ while($one_day_interval > 0) { $CLlead_id=''; $auto_call_id=''; $CLstatus=''; $CLcampaign_id=''; $CLphone_number=''; $CLphone_code=''; - $stmtA = "SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code FROM vicidial_auto_calls where callerid='$KLcallerid[$kill_vac]'"; + $stmtA = "SELECT auto_call_id,lead_id,phone_number,status,campaign_id,phone_code,alt_dial FROM vicidial_auto_calls where callerid='$KLcallerid[$kill_vac]'"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -869,6 +870,7 @@ while($one_day_interval > 0) $CLstatus = "$aryA[3]"; $CLcampaign_id = "$aryA[4]"; $CLphone_code = "$aryA[5]"; + $CLalt_dial = "$aryA[6]"; $rec_count++; } $sthA->finish(); @@ -912,6 +914,87 @@ while($one_day_interval > 0) $event_string = "| dead call vla agent PAUSED $affected_rows|$CLlead_id|$CLphone_number|$CLstatus|"; &event_logger; + + ##### BEGIN AUTO ALT PHONE DIAL SECTION ##### + ### check to see if campaign has alt_dial enabled + $VD_auto_alt_dial = 'NONE'; + $VD_auto_alt_dial_statuses=''; + $stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses FROM vicidial_campaigns where campaign_id='$CLcampaign_id';"; + 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; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_auto_alt_dial = "$aryA[0]"; + $VD_auto_alt_dial_statuses = "$aryA[1]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + if ($VD_auto_alt_dial_statuses =~ / $CLnew_status /) + { + if ( ($VD_auto_alt_dial =~ /(ALT_ONLY|ALT_AND_ADDR3)/) && ($CLalt_dial =~ /NONE|MAIN/) ) + { + $VD_alt_phone=''; + $stmtA="SELECT alt_phone,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$CLlead_id';"; + 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; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_phone = "$aryA[0]"; + $VD_alt_phone =~ s/\D//gi; + $VD_gmt_offset_now = "$aryA[1]"; + $VD_state = "$aryA[2]"; + $VD_list_id = "$aryA[3]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + if (length($VD_alt_phone)>5) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CLlead_id',campaign_id='$CLcampaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ALT',user='';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + } + if ( ( ($VD_auto_alt_dial =~ /(ADDR3_ONLY)/) && ($CLalt_dial =~ /NONE|MAIN/) ) || ( ($VD_auto_alt_dial =~ /(ALT_AND_ADDR3)/) && ($CLalt_dial =~ /ALT/) ) ) + { + $VD_address3=''; + $stmtA="SELECT address3,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$CLlead_id';"; + 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; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_address3 = "$aryA[0]"; + $VD_address3 =~ s/\D//gi; + $VD_gmt_offset_now = "$aryA[1]"; + $VD_state = "$aryA[2]"; + $VD_list_id = "$aryA[3]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + if (length($VD_address3)>5) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CLlead_id',campaign_id='$CLcampaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ADDR3',user='';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + } + } + ##### END AUTO ALT PHONE DIAL SECTION ##### + + + + } else { diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index 46906e58..94074f8f 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -30,6 +30,7 @@ # # CHANGES # 61010-1007 - First test build +# 70116-1619 - Added Auto Alt Dial code # @@ -566,7 +567,8 @@ sub process_request { { ########## FIND AND DELETE vicidial_auto_calls ########## - $stmtA = "SELECT lead_id,callerid FROM vicidial_auto_calls where uniqueid = '$uniqueid' limit 1;"; + $VD_alt_dial = 'NONE'; + $stmtA = "SELECT lead_id,callerid,campaign_id,alt_dial FROM vicidial_auto_calls where uniqueid = '$uniqueid' 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; @@ -575,8 +577,10 @@ sub process_request { while ($sthArows > $rec_countCUSTDATA) { @aryA = $sthA->fetchrow_array; - $VD_lead_id = "$aryA[0]"; - $VD_callerid = "$aryA[1]"; + $VD_lead_id = "$aryA[0]"; + $VD_callerid = "$aryA[1]"; + $VD_campaign_id = "$aryA[2]"; + $VD_alt_dial = "$aryA[3]"; $rec_countCUSTDATA++; } $sthA->finish(); @@ -692,6 +696,89 @@ sub process_request { } } } + + + ##### BEGIN AUTO ALT PHONE DIAL SECTION ##### + ### check to see if campaign has alt_dial enabled + $VD_auto_alt_dial = 'NONE'; + $VD_auto_alt_dial_statuses=''; + $stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses FROM vicidial_campaigns where campaign_id='$VD_campaign_id';"; + 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; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_auto_alt_dial = "$aryA[0]"; + $VD_auto_alt_dial_statuses = "$aryA[1]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + if ($VD_auto_alt_dial_statuses =~ / $VD_status | $VDL_status /) + { + if ( ($VD_auto_alt_dial =~ /(ALT_ONLY|ALT_AND_ADDR3)/) && ($VD_alt_dial =~ /NONE|MAIN/) ) + { + $VD_alt_phone=''; + $stmtA="SELECT alt_phone,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$VD_lead_id';"; + 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; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_alt_phone = "$aryA[0]"; + $VD_alt_phone =~ s/\D//gi; + $VD_gmt_offset_now = "$aryA[1]"; + $VD_state = "$aryA[2]"; + $VD_list_id = "$aryA[3]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + if (length($VD_alt_phone)>5) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$VD_lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ALT',user='';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + } + if ( ( ($VD_auto_alt_dial =~ /(ADDR3_ONLY)/) && ($VD_alt_dial =~ /NONE|MAIN/) ) || ( ($VD_auto_alt_dial =~ /(ALT_AND_ADDR3)/) && ($VD_alt_dial =~ /ALT/) ) ) + { + $VD_address3=''; + $stmtA="SELECT address3,gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$VD_lead_id';"; + 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; + $epc_countCAMPDATA=0; + while ($sthArows > $epc_countCAMPDATA) + { + @aryA = $sthA->fetchrow_array; + $VD_address3 = "$aryA[0]"; + $VD_address3 =~ s/\D//gi; + $VD_gmt_offset_now = "$aryA[1]"; + $VD_state = "$aryA[2]"; + $VD_list_id = "$aryA[3]"; + $epc_countCAMPDATA++; + } + $sthA->finish(); + if (length($VD_address3)>5) + { + $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$VD_lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$VD_list_id',gmt_offset_now='$VD_gmt_offset_now',state='$VD_state',alt_dial='ADDR3',user='';"; + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDH record inserted: |$affected_rows| |$stmtA|"; &agi_output;} + } + } + } + ##### END AUTO ALT PHONE DIAL SECTION ##### + + + + + $dbhA->disconnect(); } ################################################################### diff --git a/docs/ALTERNATE_NUMBER_DIALING.txt b/docs/ALTERNATE_NUMBER_DIALING.txt index 6d7aff2b..3640bf8f 100644 --- a/docs/ALTERNATE_NUMBER_DIALING.txt +++ b/docs/ALTERNATE_NUMBER_DIALING.txt @@ -1,6 +1,6 @@ ALTERNATE NUMBER DIALING Summary and Overview 2007-01-15 -*** ALTERNATE NUMBER DIALING IN AUTODIAL MODE WILL BE ADDED IN THE 2.0.3 RELEASE *** +*** ALTERNATE NUMBER DIALING IN AUTODIAL MODE HAS BEEN ADDED IN THE 2.0.3 RELEASE *** This document will outline the methods used to automatically dial the alt_phone and/or address3 fields containing phone numbers for a lead while in Auto-dial modes(RATIO or ADAPT*). This feature does not function for leads dialed with the MANUAL dial_method. diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt index 49152c8f..68305401 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt @@ -17,6 +17,8 @@ AUTO ALT DIAL STATUS ADDED|| AUTO ALT DIAL STATUS NOT DELETED|| AUTO ALT DIAL STATUS DELETED|| this auto alt dial status is not in this campaign|| +New Auto Alt Dial Status|| +Delete Auto Alt Dial Status|| ############################################################ CLIENT diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 9cb7b8a0..5c88b470 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -905,7 +905,7 @@ if ($stage == "end") } else {$alt_dial = 'NONE';} - if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) { $stmt="SELECT alt_phone,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); @@ -928,7 +928,7 @@ if ($stage == "end") $rslt=mysql_query($stmt, $link); } } - if ( (eregi("(ALT)",$alt_dial)) and (eregi("(ADDR3_ONLY|ALT_AND_ADDR3)",$auto_alt_dial)) ) + if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) ) { $stmt="SELECT address3,gmt_offset_now,state FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 28fbd0cf..4b9ba12c 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -930,6 +930,7 @@ if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";} +if ($ADD==26) {$hh='campaigns'; echo "New Auto Alt Dial Status";} if ($ADD==211) {$hh='lists'; echo "New List Addition";} if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} @@ -1002,6 +1003,7 @@ if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} if ($ADD==63) {$hh='campaigns'; echo "Emergency VDAC Jam Clear";} if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";} +if ($ADD==66) {$hh='campaigns'; echo "Delete Auto Alt Dial Status";} if ($ADD==611) {$hh='lists'; echo "Delete List";} if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} @@ -1034,9 +1036,9 @@ if ($ADD==10000000000) {$hh='server'; echo "PHONE LIST";} if ($ADD==100000000000) {$hh='server'; echo "SERVER LIST";} if ($ADD==1000000000000) {$hh='server'; echo "CONFERENCE LIST";} if ($ADD==10000000000000) {$hh='server'; echo "VICIDIAL CONFERENCE LIST";} -if ($ADD==55) {$hh='users'; echo "Search Form";} +if ($ADD==550) {$hh='users'; echo "Search Form";} if ($ADD==551) {$hh='users'; echo "SEARCH PHONES";} -if ($ADD==66) {$hh='users'; echo "Search Results";} +if ($ADD==660) {$hh='users'; echo "Search Results";} if ($ADD==661) {$hh='users'; echo "SEARCH PHONES RESULTS";} if ($ADD==99999) {$hh='users'; echo "HELP";} if ($ADD==999999) {$hh='reports'; echo "REPORTS";} @@ -2819,7 +2821,7 @@ echo "\n"; 1) { ?> -   LIST USERS     |     ADD A NEW USER     |     SEARCH FOR A USER +   LIST USERS     |     ADD A NEW USER     |     SEARCH FOR A USER 1) { ?> @@ -8199,16 +8201,16 @@ if ($LOGast_delete_phones > 0) ###################### -# ADD=55 search form +# ADD=550 search form ###################### -if ($ADD==55) +if ($ADD==550) { echo "
\n"; echo ""; echo "
SEARCH FOR A USER
\n"; -echo "\n"; +echo "\n"; echo "
\n"; echo "\n"; echo "\n"; @@ -8233,10 +8235,10 @@ echo "
User Number:
Full Name:
\n"; } ###################### -# ADD=66 user search results +# ADD=660 user search results ###################### -if ($ADD==66) +if ($ADD==660) { echo "
\n"; echo "";