added campaign-specific DNC feature, affected 11 scripts

updated docs for new versions

git-svn-id: svn://192.168.202.10@948 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2008-09-10 05:26:13 +00:00
parent f1e314125d
commit 3900544b99
21 changed files with 610 additions and 143 deletions
+7 -2
View File
@@ -149,8 +149,13 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
34. Added new alternate number dialing method which allows for over 65,000 alt
phone numbers per lead. Currently these extra numbers are only available for
auto dialing. These extra alternate number leads must be imported with the
CLI lead loader(VICIDIAL_IN_new_leads_file.pl)
auto dialing, not manual dial. These extra alternate number leads must be
imported either with the CLI lead loader(VICIDIAL_IN_new_leads_file.pl) or
the non-agent API script.
35. Added campaign-specific DNC to the system
+19 -6
View File
@@ -49,11 +49,12 @@
#
# changes:
# 80218-2027 - First Build
# 80302-0232 - added drop_action and transfer to in-group
# 80430-1144 - added term_reason to vicidial_log, QUEUETIMEOUT
# 80520-0059 - added SURVEY ability and digit maps
# 80527-2329 - added SURVEYCAMP ability to pull settings from database
# 80831-0353 - added logging of alt_dial field
# 80302-0232 - Added drop_action and transfer to in-group
# 80430-1144 - Added term_reason to vicidial_log, QUEUETIMEOUT
# 80520-0059 - Added SURVEY ability and digit maps
# 80527-2329 - Added SURVEYCAMP ability to pull settings from database
# 80831-0353 - Added logging of alt_dial field
# 80909-0603 - Added campaign-specific dnc option for outbound survey
#
$script = 'agi-VDAD_ALL_outbound.agi';
@@ -362,7 +363,7 @@ if ($affected_rows > 0)
$sthA->finish();
### Grab campaign values from the database
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -381,6 +382,7 @@ if ($affected_rows > 0)
$VDADvoicemail_ext = "$aryA[5]";
$drop_inbound_group = "$aryA[6]";
$use_internal_dnc = "$aryA[7]";
$use_campaign_dnc = "$aryA[8]";
$rec_count++;
}
$sthA->finish();
@@ -587,6 +589,17 @@ if ($call_handle_method =~ /SURVEY/)
&agi_output;
}
}
if (($use_campaign_dnc =~ /Y/) && ($survey_ni_status eq "DNC"))
{
$stmtA = "INSERT INTO vicidial_campaign_dnc set phone_number='$VDADphone', campaign_id='$VDADcampaign';";
if ($AGILOG) { $agi_string = "|$stmtA|"; &agi_output; }
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG)
{
$agi_string = "-- VDAD vicidial_campaign_dnc insert: $affected_rows|$VDADphone|$VDADcampaign";
&agi_output;
}
}
$AGI->hangup();
+49 -35
View File
@@ -6,17 +6,22 @@
# play a message and take input to automatically change customer lead to NI or DNC.
# *** This version detects inbound callerID over PRI ***
#
# Flag Options:
# 1- default to insert into the vicidial_dnc table for DNC selections (Default=YES)
# 2- campaign to take dnc settings from(overrides option 1)
#
# ;inbound call from outbound CID callbacks from VICIDIAL calls:
#exten => 1234,1,Ringing ; call ringing
#exten => 1234,2,Wait(1) ; Wait 1 second for CID delivery from PRI
#exten => 1234,3,Answer ; Answer the line
#exten => 1234,4,AGI(agi-VDADinbound_NI_DNC_CIDlookup.agi)
#exten => 1234,4,AGI(agi-VDADinbound_NI_DNC_CIDlookup.agi,YES-----TESTCAMP)
#exten => 1234,5,Hangup
#
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# changes:
# 60914-1051 - First draft
# 80909-0614 - Added optional field for campaign so that vicidial_campaign_dnc could be used
#
$script = 'agi-VDADinbound_NI_DNC_CIDlookup.agi';
@@ -117,7 +122,7 @@ $sthA->finish();
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
{
if ($AGILOG) {$agi_string = "Perl Environment Dump:"; &agi_output;}
$i=0;
while ($#ARGV >= $i)
@@ -130,36 +135,12 @@ if (length($ARGV[0])>1)
### list of command-line array arguments:
@ARGV_vars = split(/-----/, $ARGV[0]);
if ($args =~ /--help/i)
{
print "allowed run time options:\n [-q] = quiet\n [-t] = test\n [-debug] = verbose debug messages\n\n";
$dnc_default = $ARGV_vars[0];
$campaign_id = $ARGV_vars[1];
}
else
{
if ($args =~ /-V/i)
{
$V=1;
}
if ($args =~ /-debug/i)
{
$DG=1;
}
if ($args =~ /-dbAVS/i)
{
$DGA=1;
}
if ($args =~ /-q/i)
{
$q=1;
$Q=1;
}
if ($args =~ /-t/i)
{
$TEST=1;
$T=1;
}
}
}
if (length($dnc_default) < 2)
{$dnc_default = 'YES';}
$|=1;
while(<STDIN>) {
@@ -288,10 +269,43 @@ if ($pin =~ /3/) # set the phone_number to DNC
if ($AGILOG) {$agi_string = "$affected_rows|$stmtA|"; &agi_output;}
}
### add the number to the vicidial_dnc table
$stmtA = "INSERT INTO vicidial_dnc SET phone_number='$phone_number';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "$affected_rows|$stmtA|"; &agi_output;}
if (length($campaign_id)>1)
{
### Grab DNC settings from campaign
$stmtA = "SELECT use_internal_dnc,use_campaign_dnc FROM vicidial_campaigns where campaign_id = '$campaign_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
$use_internal_dnc = "$aryA[0]";
$use_campaign_dnc = "$aryA[1]";
$sthA->finish();
if ($use_internal_dnc =~ /Y/)
{
### add the number to the vicidial_dnc table
$stmtA = "INSERT INTO vicidial_dnc SET phone_number='$phone_number';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "$affected_rows|$stmtA|"; &agi_output;}
}
if ($use_campaign_dnc =~ /Y/)
{
### add the number to the vicidial_campaign_dnc table
$stmtA = "INSERT INTO vicidial_campaign_dnc SET phone_number='$phone_number',campaign_id='$campaign_id';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "$affected_rows|$stmtA|"; &agi_output;}
}
}
else
{
if ($dnc_default =~ /YES/)
{
### add the number to the vicidial_dnc table
$stmtA = "INSERT INTO vicidial_dnc SET phone_number='$phone_number';";
$affected_rows = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "$affected_rows|$stmtA|"; &agi_output;}
}
}
$AGI->stream_file("$processed_file");
}
+12
View File
@@ -15,6 +15,7 @@
# 71030-2020 - Added deletions of stats and inbound live agents
# 71109-1725 - fixed vicidial_campaign_stats bug
# 71215-0410 - fixed UPDATE/DELETE results
# 80909-0555 - added vicidial_campaign_dnc table
#
# default path to astguiclient configuration file:
@@ -205,6 +206,17 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
$sthA->finish();
}
$stmtA = "optimize table vicidial_campaign_dnc;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@aryA = $sthA->fetchrow_array;
if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
$sthA->finish();
}
$stmtA = "optimize table vicidial_callbacks;";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {
+1 -1
View File
@@ -1014,7 +1014,7 @@ if ($DBX) {print "$campaign_id[$i]|$VCSdrops_five_pct[$i]|$VCSdrops_today_pct[$i
# DETERMINE WHETHER TO GATHER STATUS CATEGORY STATISTICS
$VSC_categories=0;
$VSCupdateSQL='';
$stmtA = "SELECT vsc_id from vicidial_status_categories where tovdad_display='Y';";
$stmtA = "SELECT vsc_id from vicidial_status_categories where tovdad_display='Y' limit 4;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
+45 -1
View File
@@ -69,6 +69,7 @@
# 80525-1040 - Added IVR vac status compatibility for inbound calls
# 80713-0624 - Added vicidial_list_last_local_call_time field
# 80829-2359 - Added extended alt dial and dnc checkon all alt dial hopper insertions
# 80909-0845 - Added support for campaign-specific DNC lists
#
@@ -1076,7 +1077,7 @@ while($one_day_interval > 0)
### 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,use_internal_dnc FROM vicidial_campaigns where campaign_id='$CLcampaign_id';";
$stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses,use_internal_dnc,use_campaign_dnc 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;
@@ -1088,6 +1089,7 @@ while($one_day_interval > 0)
$VD_auto_alt_dial = "$aryA[0]";
$VD_auto_alt_dial_statuses = "$aryA[1]";
$VD_use_internal_dnc = "$aryA[2]";
$VD_use_campaign_dnc = "$aryA[3]";
$epc_countCAMPDATA++;
}
$sthA->finish();
@@ -1131,6 +1133,20 @@ while($one_day_interval > 0)
$sthA->finish();
}
else {$VD_alt_dnc_count=0;}
if ($VD_use_campaign_dnc =~ /Y/)
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_alt_phone' and 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;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_alt_dnc_count = ($VD_alt_dnc_count + $aryA[0]);
}
$sthA->finish();
}
if ($VD_alt_dnc_count < 1)
{
$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='',priority='25';";
@@ -1183,6 +1199,20 @@ while($one_day_interval > 0)
$sthA->finish();
}
else {$VD_alt_dnc_count=0;}
if ($VD_use_campaign_dnc =~ /Y/)
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_address3' and 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;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_alt_dnc_count = ($VD_alt_dnc_count + $aryA[0]);
}
$sthA->finish();
}
if ($VD_alt_dnc_count < 1)
{
$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='',priority='20';";
@@ -1270,6 +1300,20 @@ while($one_day_interval > 0)
$sthA->finish();
}
else {$VD_alt_dnc_count=0;}
if ($VD_use_campaign_dnc =~ /Y/)
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and 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;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_alt_dnc_count = ($VD_alt_dnc_count + $aryA[0]);
}
$sthA->finish();
}
if ($VD_alt_dnc_count < 1)
{
if ($alt_dial_phones_count == $Xlast)
+24
View File
@@ -49,6 +49,7 @@
# 80112-0221 - Added 2nd, 3rd,... NEW for LAST NAME/PHONE Sort
# 80125-0821 - Added detail logging of each lead inserted
# 80713-0028 - Changed Recycling methodology
# 80909-1901 - Added support for campaign-specific DNC lists
#
# constants
@@ -413,6 +414,7 @@ while ($sthArows > $rec_count)
$adaptive_dropped_percentage[$rec_count] = $aryA[48];
$adaptive_maximum_level[$rec_count] = $aryA[49];
$dial_statuses[$rec_count] = $aryA[61];
$use_campaign_dnc[$rec_count] = $aryA[95];
$rec_count++;
}
@@ -1448,6 +1450,28 @@ foreach(@campaign_id)
if ($DBX) {print "Flagging DNC lead: $affected_rows $phone_to_hopper[$h]\n";}
}
}
if ( ($use_campaign_dnc[$i] =~ /Y/) && ($DNClead == '0') )
{
if ($DB) {print "Doing CAMP DNC Check: $phone_to_hopper[$h] - $use_campaign_dnc[$i]\n";}
$stmtA = "SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_to_hopper[$h]' and campaign_id='$campaign_id[$i]';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$DNClead = "$aryA[0]";
$rec_count++;
}
$sthA->finish();
if ($DNClead != '0')
{
$stmtA = "UPDATE vicidial_list SET status='DNCC' where lead_id='$leads_to_hopper[$h]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "Flagging DNC lead: $affected_rows $phone_to_hopper[$h] $campaign_id[$i]\n";}
}
}
if ($DNClead == '0')
{
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0');";
+24
View File
@@ -51,6 +51,7 @@
# 80112-0221 - Added 2nd, 3rd,... NEW for LAST NAME/PHONE Sort
# 80125-0821 - Added detail logging of each lead inserted
# 80713-0028 - Changed Recycling methodology
# 80909-1901 - Added support for campaign-specific DNC lists
#
# constants
@@ -416,6 +417,7 @@ while ($sthArows > $rec_count)
$adaptive_maximum_level[$rec_count] = $aryA[49];
$dial_statuses[$rec_count] = $aryA[61];
$list_order_mix[$rec_count] = $aryA[64];
$use_campaign_dnc[$rec_count] = $aryA[95];
$rec_count++;
}
@@ -1568,6 +1570,28 @@ foreach(@campaign_id)
if ($DBX) {print "Flagging DNC lead: $affected_rows $phone_to_hopper[$h]\n";}
}
}
if ( ($use_campaign_dnc[$i] =~ /Y/) && ($DNClead == '0') )
{
if ($DB) {print "Doing CAMP DNC Check: $phone_to_hopper[$h] - $use_campaign_dnc[$i]\n";}
$stmtA = "SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_to_hopper[$h]' and campaign_id='$campaign_id[$i]';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$DNClead = "$aryA[0]";
$rec_count++;
}
$sthA->finish();
if ($DNClead != '0')
{
$stmtA = "UPDATE vicidial_list SET status='DNCC' where lead_id='$leads_to_hopper[$h]';";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print "Flagging DNC lead: $affected_rows $phone_to_hopper[$h] $campaign_id[$i]\n";}
}
}
if ($DNClead == '0')
{
$stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state,priority) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]','0');";
+45 -1
View File
@@ -40,6 +40,7 @@
# 80510-2058 - Fixed status override bug
# 80525-1040 - Added IVR vac status compatibility for inbound calls
# 80830-0035 - Added auto alt dialing for EXTERNAL leads for each lead
# 80909-0843 - Added support for campaign-speccific DNC lists
#
@@ -855,7 +856,7 @@ sub process_request {
### 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,use_internal_dnc FROM vicidial_campaigns where campaign_id='$VD_campaign_id';";
$stmtA="SELECT auto_alt_dial,auto_alt_dial_statuses,use_internal_dnc,use_campaign_dnc 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;
@@ -867,6 +868,7 @@ sub process_request {
$VD_auto_alt_dial = "$aryA[0]";
$VD_auto_alt_dial_statuses = "$aryA[1]";
$VD_use_internal_dnc = "$aryA[2]";
$VD_use_campaign_dnc = "$aryA[3]";
$epc_countCAMPDATA++;
}
$sthA->finish();
@@ -910,6 +912,20 @@ sub process_request {
$sthA->finish();
}
else {$VD_alt_dnc_count=0;}
if ($VD_use_campaign_dnc =~ /Y/)
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_alt_phone' and 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;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_alt_dnc_count = ($VD_alt_dnc_count + $aryA[0]);
}
$sthA->finish();
}
if ($VD_alt_dnc_count < 1)
{
$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='',priority='25';";
@@ -962,6 +978,20 @@ sub process_request {
$sthA->finish();
}
else {$VD_alt_dnc_count=0;}
if ($VD_use_campaign_dnc =~ /Y/)
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_address3' and 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;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_alt_dnc_count = ($VD_alt_dnc_count + $aryA[0]);
}
$sthA->finish();
}
if ($VD_alt_dnc_count < 1)
{
$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='',priority='20';";
@@ -1049,6 +1079,20 @@ sub process_request {
$sthA->finish();
}
else {$VD_alt_dnc_count=0;}
if ($VD_use_campaign_dnc =~ /Y/)
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and 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;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VD_alt_dnc_count = ($VD_alt_dnc_count + $aryA[0]);
}
$sthA->finish();
}
if ($VD_alt_dnc_count < 1)
{
if ($alt_dial_phones_count eq '$Xlast')
+18 -13
View File
@@ -31,16 +31,16 @@ PHASE 1: INSTALLING ASTERISK
1. follow these command line steps:
mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.27.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.25.tar.gz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.30.2.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.27.tar.gz
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.7.tar.gz
gunzip asterisk-1.2.27.tar.gz
tar xvf asterisk-1.2.27.tar
gunzip zaptel-1.2.25.tar.gz
tar xvf zaptel-1.2.25.tar
gunzip asterisk-1.2.30.2.tar.gz
tar xvf asterisk-1.2.30.2.tar
gunzip zaptel-1.2.27.tar.gz
tar xvf zaptel-1.2.27.tar
gunzip libpri-1.2.7.tar.gz
tar xvf libpri-1.2.7.tar
cd ./zaptel-1.2.25
cd ./zaptel-1.2.27
wget http://downloads.vicidial.com/packages/newt-0.51.6.tar.gz
gunzip newt-0.51.6.tar.gz
tar xvf newt-0.51.6.tar
@@ -58,7 +58,7 @@ cd ../libpri-1.2.7
make clean
make
make install
cd ../asterisk-1.2.27
cd ../asterisk-1.2.30.2
(1.2 tree) If you want to include Answering Machine Detection ability
you will need to download app_amd.c and amd.conf and alter the
apps/Makefile to compile it properly
@@ -73,11 +73,11 @@ cd ../asterisk-1.2.27
wget http://www.eflo.net/files/amd2.conf
mkdir /etc/asterisk
mv amd2.conf /etc/asterisk/amd.conf
*OPTIONAL*(1.2.23 thru 1.2.27) apply the meetme DTMF passthru patch
*OPTIONAL*(1.2.23 thru 1.2.30.2) apply the meetme DTMF passthru patch
wget http://www.eflo.net/files/meetme_DTMF_passthru-1.2.23.patch
patch -p1 < ./meetme_DTMF_passthru-1.2.23.patch
- File to patch: app_meetme.c
*OPTIONAL*(1.2.12.1 thru 1.2.27) apply the meetme volume control patch
*OPTIONAL*(1.2.12.1 thru 1.2.30.2) apply the meetme volume control patch
*Different patches available for 1.2.7.1 through 1.2.14
wget http://www.eflo.net/files/meetme_volume_control_1.2.16.patch
patch -p1 < ./meetme_volume_control_1.2.16.patch
@@ -89,7 +89,7 @@ cd ../asterisk-1.2.27
patch -p1 < ./cli_chan_concise_delimiter.patch
- File to patch: cli.c
*OPTIONAL*(1.2.14 thru 1.2.27) rewrite of waitforsilence
*OPTIONAL*(1.2.14 thru 1.2.30.2) rewrite of waitforsilence
wget http://www.eflo.net/files/app_waitforsilence.c
mv -f app_waitforsilence.c apps/app_waitforsilence.c
@@ -270,11 +270,16 @@ to use our new mysql script file to add the tables to the database:
(make sure you put your IP address in place of "10.10.10.15" in the queries below)
######------ BEGIN Mysql data entry(you can copy and paste this into terminal) #
create database asterisk;
CREATE DATABASE `asterisk` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
use asterisk;
\. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
@@ -466,7 +471,7 @@ PHASE 6: ADDING CRONTAB ENTRIES FOR ASTGUICLIENT/VICIDIAL SCRIPTS
2 0 * * 0 /usr/share/astguiclient/AST_agent_week.pl
### remove old recordings more than 7 days old
24 0 * * * /usr/bin/find /var/spool/asterisk/monitor -maxdepth 2 -type f -mtime +7 -print | xargs rm -f
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitor -maxdepth 2 -type f -mtime +7 -print | xargs rm -f
### remove old vicidial logs and asterisk logs more than 2 days old
28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -print | xargs rm -f
+3 -3
View File
@@ -30,15 +30,15 @@ extensions.conf additions:
; TEST_IN_DE - German - option 4
[default]
exten => 7275551111,1,Goto(TEST_IN,1,1)
exten => 7275551111,1,Goto(TEST_IN,s,1)
[TEST_IN]
exten => s,1,AGI(agi-VDAD_inbound_calltime_check.agi,TEST_IN-----YES)
exten => s,2,Background(test_in_menu)
exten => s.n.WaitExten(10)
exten => s,n,WaitExten(10)
exten => s,n,Background(test_in_menu)
exten => s.n.WaitExten(10)
exten => s,n,WaitExten(10)
exten => s,n,Playback(vm-goodbye)
exten => s,n,hangup
+30 -3
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT 2008-07-24
NON-AGENT API DOCUMENT Started: 2008-07-24
This document describes the functions of an API(Application Programming Interface)
for all functions NOT relating to the VICIDIAL Agent screen. This functionality
@@ -17,13 +17,25 @@ New scripts:
API Functions:
API Functions: ('function' variable)
NOTE: Just as with the Agent API, the non-agent API requires the user and pass of a
valid api-enabled vicidial_users account to execute actions.
--------------------------------------------------------------------------------
version - shows version and build of the API, along with the date/time
Example URL strings for API calls:
http://server/vicidial/non_agent_api.php?function=version
Example responses:
VERSION: 2.0.5-4|BUILD: 80910-0020|DATE: 2008-09-10 00:26:43|EPOCH: 1221020803
--------------------------------------------------------------------------------
add_lead - adds a new lead to the vicidial_list table with several fields and options
NOTE: api user for this function must have modify_leads set to 1
@@ -35,11 +47,14 @@ list_id - must be all numbers, 3-12 digits, defaults to 999 if not set
SETTINGS FIELDS-
dnc_check - Y or N, default is N
campaign_dnc_check - Y or N, default is N
campaign_id - 2-8 Character campaign ID, required if using campaign_dnc_check
add_to_hopper - Y or N, default is N
hopper_priority - 99 to -99, the higher number the higher priority, default is 0
hopper_local_call_time_check - Y or N, default is N. Validate the local call time before inserting lead in the hopper
OPTIONAL FIELDS-
(for fields with spaces in the values, you can replace the space with a plus + sign[address, city, first_name, etc...])
OPTIONAL FIELDS-
vendor_lead_code - 1-20 characters
source_id - 1-50 characters
gmt_offset_now - overridden by auto-lookup of phone_code and area_code portion of phone number if applicable
@@ -61,6 +76,14 @@ alt_phone - 1-12 characters
email - 1-70 characters
security_phrase - 1-100 characters
comments - 1-255 characters
multi_alt_phones - 5-1024 characters (see examples for more info)
Multi-ALT-Phones format:
7275551212_1_work!7275551213_1_sister+house!1234567890_1_neighbor
The multi-alt-phones field is formatted as a field of phone-number/phone-code/phone-note set of data(phone code and alt_note are both optional and the phone code can be overridden by the force phone code flag). The record delimiter is an exclamation point with the optional phone code and note delimited within the record by an underscore character _.
Example URL strings for API calls:
@@ -70,6 +93,7 @@ http://server/vicidial/non_agent_api.php?user=6666&pass=1234&function=add_lead&p
http://server/vicidial/non_agent_api.php?user=6666&pass=1234&function=add_lead&phone_number=7275551111&phone_code=1&list_id=999&dnc_check=N&first_name=Bob&last_name=Wilson&add_to_hopper=Y&hopper_local_call_time_check=Y
http://server/vicidial/non_agent_api.php?user=6666&pass=1234&function=add_lead&phone_number=7275551111&phone_code=1&list_id=999&dnc_check=N&campaign_dnc_check=Y&campaign_id=TESTCAMP&first_name=Bob&last_name=Wilson&address1=1234+Main+St.&city=Chicago+Heights&state=IL&add_to_hopper=Y&hopper_local_call_time_check=Y&multi_alt_phones=7275551212_1_work!7275551213_1_sister+house!1234567890_1_neighbor
Example responses:
@@ -77,8 +101,11 @@ SUCCESS: add_lead LEAD HAS BEEN ADDED - 7275551111|6666|999|193715|-4
NOTICE: add_lead ADDED TO HOPPER - 7275551111|6666|193715|1677922
SUCCESS: add_lead LEAD HAS BEEN ADDED - 7275551111|6666|999|193716|-4
NOTICE: add_lead MULTI-ALT-PHONE NUMBERS LOADED - 3|6666|193716
NOTICE: add_lead NOT ADDED TO HOPPER, OUTSIDE OF LOCAL TIME - 7275551111|6666|193716|-4|0
ERROR: add_lead INVALID PHONE NUMBER - 72755|6666
ERROR: add_lead USER DOES NOT HAVE PERMISSION TO ADD LEADS TO THE SYSTEM - 6666|0
ERROR: NO FUNCTION SPECIFIED
+8 -8
View File
@@ -337,16 +337,16 @@ make install
mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.27.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.25.tar.gz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.30.2.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.27.tar.gz
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.7.tar.gz
gunzip asterisk-1.2.27.tar.gz
tar xvf asterisk-1.2.27.tar
gunzip zaptel-1.2.25.tar.gz
tar xvf zaptel-1.2.25.tar
gunzip asterisk-1.2.30.2.tar.gz
tar xvf asterisk-1.2.30.2.tar
gunzip zaptel-1.2.27.tar.gz
tar xvf zaptel-1.2.27.tar
gunzip libpri-1.2.7.tar.gz
tar xvf libpri-1.2.7.tar
cd ./zaptel-1.2.25
cd ./zaptel-1.2.27
wget http://downloads.vicidial.com/packages/newt-0.51.6.tar.gz
gunzip newt-0.51.6.tar.gz
tar xvf newt-0.51.6.tar
@@ -364,7 +364,7 @@ cd ../libpri-1.2.7
make clean
make
make install
cd ../asterisk-1.2.27
cd ../asterisk-1.2.30.2
cd apps
wget http://www.eflo.net/files/app_amd2.c
mv app_amd2.c app_amd.c
+20 -15
View File
@@ -875,8 +875,8 @@ PHASE 4: INSTALLING ASTERISK
OK, all the prep work is done, now it's time to start having fun with Asterisk.
There are two basic ways to install Asterisk, an official release(at the time of
this writing the official release is 1.2.27) and the SVN_DEV version(development
branch). We recommend using Asterisk 1.2.27. These instructions are how we get
this writing the official release is 1.2.30.2) and the SVN_DEV version(development
branch). We recommend using Asterisk 1.2.30.2. These instructions are how we get
our Asterisk system with it's T1 line installed with our 2 SIP VOIP devices and
one IAX2 softphone.
@@ -896,13 +896,13 @@ with the following patch:
- mkdir /usr/src/asterisk
- cd /usr/src/asterisk
A. if you want 1.2 release (reliable with new features):
- wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.27.tar.gz
- wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.25.tar.gz
- wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.30.2.tar.gz
- wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.27.tar.gz
- wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.5.tar.gz
- gunzip asterisk-1.2.27.tar.gz
- tar xvf asterisk-1.2.27.tar
- gunzip zaptel-1.2.25.tar.gz
- tar xvf zaptel-1.2.25.tar
- gunzip asterisk-1.2.30.2.tar.gz
- tar xvf asterisk-1.2.30.2.tar
- gunzip zaptel-1.2.27.tar.gz
- tar xvf zaptel-1.2.27.tar
- gunzip libpri-1.2.5.tar.gz
- tar xvf libpri-1.2.5.tar
B. if you want latest SVN_1.2 version (release tree with new patches)
@@ -927,7 +927,7 @@ with the following patch:
edit this line at the top and just add a hash # in front of it as shown:
#PBX_LIBS+=$(shell $(CROSS_COMPILE_BIN)gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
- cd ./zaptel-1.2.25
- cd ./zaptel-1.2.27
- make clean
- make
- make install
@@ -935,7 +935,7 @@ with the following patch:
- make clean
- make
- make install
- cd ../asterisk-1.2.27
- cd ../asterisk-1.2.30.2
- (1.2 tree) If you want to include Answering Machine Detection ability
you will need to download app_amd.c and amd.conf and alter the
apps/Makefile to compile it properly
@@ -950,11 +950,11 @@ with the following patch:
- wget http://www.eflo.net/files/amd2.conf
- mkdir /etc/asterisk
- mv amd2.conf /etc/asterisk/amd.conf
*OPTIONAL*(1.2.23 thru 1.2.27) apply the meetme DTMF passthru patch
*OPTIONAL*(1.2.23 thru 1.2.30.2) apply the meetme DTMF passthru patch
- wget http://www.eflo.net/files/meetme_DTMF_passthru-1.2.23.patch
- patch -p1 < ./meetme_DTMF_passthru-1.2.23.patch
- File to patch: app_meetme.c
*OPTIONAL*(1.2.12.1 thru 1.2.27) apply the meetme volume control patch
*OPTIONAL*(1.2.12.1 thru 1.2.30.2) apply the meetme volume control patch
*Different patches available for 1.2.7.1 through 1.2.14
- wget http://www.eflo.net/files/meetme_volume_control_1.2.16.patch
- patch -p1 < ./meetme_volume_control_1.2.16.patch
@@ -966,7 +966,7 @@ with the following patch:
- patch -p1 < ./cli_chan_concise_delimiter.patch
- File to patch: cli.c
*OPTIONAL*(1.2.14 thru 1.2.27) rewrite of waitforsilence
*OPTIONAL*(1.2.14 thru 1.2.30.2) rewrite of waitforsilence
- wget http://www.eflo.net/files/app_waitforsilence.c
- mv -f app_waitforsilence.c apps/app_waitforsilence.c
@@ -1744,6 +1744,11 @@ can use the following query to create the database:
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
# NOTE: if using MySQL 4.1.12 or higher you may need to run this query too:
UPDATE mysql.user set password=OLD_PASSWORD('1234') where user='cron';
@@ -1765,7 +1770,7 @@ use asterisk;
\. /usr/src/astguiclient/astguiclient/sip-iax_phones.sql
insert into servers (server_id,server_description,server_ip,active,asterisk_version)values('TESTasterisk','Test install of Asterisk server', '10.10.10.15','Y','1.2.27');
insert into servers (server_id,server_description,server_ip,active,asterisk_version)values('TESTasterisk','Test install of Asterisk server', '10.10.10.15','Y','1.2.30.2');
insert into server_updater values('10.10.10.15','');
@@ -2847,7 +2852,7 @@ SUBPHASE 6.5: setting up astguiclient scripts for continuous running
#42 0 * * * /usr/share/astguiclient/AST_sourceID_summary_export.pl
### remove old recordings more than 7 days old
24 0 * * * /usr/bin/find /var/spool/asterisk/monitor -maxdepth 2 -type f -mtime +7 -print | xargs rm -f
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitor -maxdepth 2 -type f -mtime +7 -print | xargs rm -f
### remove old vicidial logs and asterisk logs more than 2 days old
28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -print | xargs rm -f
+22 -10
View File
@@ -251,7 +251,7 @@ list_id BIGINT(14) UNSIGNED,
gmt_offset_now DECIMAL(4,2) DEFAULT '0.00',
called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10') default 'N',
phone_code VARCHAR(10),
phone_number VARCHAR(12),
phone_number VARCHAR(18) NOT NULL,
title VARCHAR(4),
first_name VARCHAR(30),
middle_initial VARCHAR(1),
@@ -335,7 +335,7 @@ uniqueid VARCHAR(20),
callerid VARCHAR(20),
channel VARCHAR(100),
phone_code VARCHAR(10),
phone_number VARCHAR(12),
phone_number VARCHAR(18),
call_time DATETIME,
call_type ENUM('IN','OUT','OUTBALANCE') default 'OUT',
stage VARCHAR(20) default 'START',
@@ -359,7 +359,7 @@ end_epoch INT(10) UNSIGNED,
length_in_sec INT(10),
status VARCHAR(6),
phone_code VARCHAR(10),
phone_number VARCHAR(12),
phone_number VARCHAR(18),
user VARCHAR(20),
comments VARCHAR(255),
processed ENUM('Y','N'),
@@ -381,7 +381,7 @@ end_epoch INT(10) UNSIGNED,
length_in_sec INT(10),
status VARCHAR(6),
phone_code VARCHAR(10),
phone_number VARCHAR(12),
phone_number VARCHAR(18),
user VARCHAR(20),
comments VARCHAR(255),
processed ENUM('Y','N'),
@@ -400,7 +400,7 @@ list_id BIGINT(14) UNSIGNED,
campaign_id VARCHAR(20),
call_date DATETIME,
phone_code VARCHAR(10),
phone_number VARCHAR(12),
phone_number VARCHAR(18),
user VARCHAR(20),
closer VARCHAR(20),
index (lead_id),
@@ -584,7 +584,8 @@ disable_alter_custphone ENUM('Y','N') default 'Y',
display_queue_count ENUM('Y','N') default 'Y',
manual_dial_filter VARCHAR(50) default 'NONE',
agent_clipboard_copy VARCHAR(50) default 'NONE',
agent_extended_alt_dial ENUM('Y','N') default 'N'
agent_extended_alt_dial ENUM('Y','N') default 'N',
use_campaign_dnc ENUM('Y','N') default 'N'
);
CREATE TABLE vicidial_lists (
@@ -813,7 +814,7 @@ index (callback_time)
CREATE TABLE vicidial_list_pins (
pins_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
entry_time DATETIME,
phone_number VARCHAR(12),
phone_number VARCHAR(18),
lead_id INT(9) UNSIGNED,
campaign_id VARCHAR(20),
product_code VARCHAR(20),
@@ -916,7 +917,7 @@ status_category_count_4 INT(9) UNSIGNED default '0'
);
CREATE TABLE vicidial_dnc (
phone_number VARCHAR(12) PRIMARY KEY NOT NULL
phone_number VARCHAR(18) PRIMARY KEY NOT NULL
);
CREATE TABLE vicidial_lead_recycle (
@@ -1020,7 +1021,7 @@ inbound_number VARCHAR(12),
recording_id INT(9) UNSIGNED,
recording_filename VARCHAR(50),
company_id VARCHAR(12),
phone_number VARCHAR(12),
phone_number VARCHAR(18),
lead_id INT(9) UNSIGNED,
campaign_id VARCHAR(20),
product_code VARCHAR(20),
@@ -1200,6 +1201,13 @@ index (lead_id),
index (phone_number)
);
CREATE TABLE vicidial_campaign_dnc (
phone_number VARCHAR(18) NOT NULL,
campaign_id VARCHAR(8) NOT NULL,
index (phone_number),
UNIQUE INDEX phonecamp (phone_number, campaign_id)
);
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
ALTER TABLE live_channels ENGINE=HEAP;
@@ -1254,5 +1262,9 @@ INSERT INTO vicidial_shifts SET shift_id='24HRMIDNIGHT',shift_name='24 hours 7 d
UPDATE system_settings SET qc_last_pull_time=NOW();
UPDATE system_settings SET db_schema_version='1104';
UPDATE system_settings SET db_schema_version='1105';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
+32
View File
@@ -369,3 +369,35 @@ ALTER TABLE vicidial_log ADD alt_dial VARCHAR(6) default 'NONE';
ALTER TABLE vicidial_campaigns ADD agent_extended_alt_dial ENUM('Y','N') default 'N';
UPDATE system_settings SET db_schema_version='1104';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
ALTER TABLE vicidial_dnc MODIFY phone_number VARCHAR(18) NOT NULL;
ALTER TABLE vicidial_list MODIFY phone_number VARCHAR(18) NOT NULL;
ALTER TABLE vicidial_auto_calls MODIFY phone_number VARCHAR(18);
ALTER TABLE vicidial_log MODIFY phone_number VARCHAR(18);
ALTER TABLE vicidial_closer_log MODIFY phone_number VARCHAR(18);
ALTER TABLE vicidial_xfer_log MODIFY phone_number VARCHAR(18);
ALTER TABLE vicidial_list_pins MODIFY phone_number VARCHAR(18);
ALTER TABLE vicidial_ivr MODIFY phone_number VARCHAR(18);
ALTER TABLE vicidial_campaigns ADD use_campaign_dnc ENUM('Y','N') default 'N';
CREATE TABLE vicidial_campaign_dnc (
phone_number VARCHAR(18) NOT NULL,
campaign_id VARCHAR(8) NOT NULL,
index (phone_number),
UNIQUE INDEX phonecamp (phone_number, campaign_id)
);
UPDATE system_settings SET db_schema_version='1105';
@@ -242,6 +242,11 @@ Agent Screen Clipboard Copy||
EXTENDED alternate numbers are numbers loaded into the system outside of the standard lead information screen. Using EXTENDED you can have hundreds of phone numbers for a single customer record.||
Agent Screen Extended Alt Dial -<\/B> This feature allows for agents to access extended alternate phone numbers for leads beyond the standard Alt Phone and Address3 fields that can be used in VICIDIAL for phone numbers beyond the main phone number. The Extended phone numbers can be dialed automatically using the Auto-Alt-Dial feature in VICIDIAL Campaign settings, but enabling this Agent Screen feature will also allow for the agent to call these numbers from their agent screen as well as edit their information||
Agent Screen Extended Alt Dial:||
Use Campaign DNC List -<\/B> This defines whether this campaign is to filter leads against a DNC list that is specific to that campaign only. If it is set to Y, the hopper will look for each phone number in the campaign-specific DNC list before placing it in the hopper. If it is in the campaign-specific DNC list then it will change that lead status to DNCC so it cannot be dialed. Default is N.||
Use Campaign DNC List||
and possibly the campaign-specific DNC list||
There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them||
NOTE: Copying a campaign will copy all settings from the master campaign you select, but it will not copy a campaign-specific DNC list if there was one on the selected master campaign||
############################################################ CLIENT
+67 -7
View File
@@ -67,6 +67,7 @@
# - $recipient - ('ANYONE,'USERONLY')
# - $callback_id - ('12345','12346',...)
# - $use_internal_dnc - ('Y','N')
# - $use_campaign_dnc - ('Y','N')
# - $omit_phone_code - ('Y','N')
# - $no_delete_sessions - ('0','1')
# - $LogouTKicKAlL - ('0','1');
@@ -159,10 +160,11 @@
# 80719-1147 - Changed recording conf prefix
# 80815-1019 - Added manual dial list restriction option
# 80831-0545 - Added extended alt dial number info display support
# 80909-1710 - Added support for campaign-specific DNC lists
#
$version = '2.0.5-81';
$build = '80831-0545';
$version = '2.0.5-82';
$build = '80909-1710';
require("dbconnect.php");
@@ -287,6 +289,8 @@ if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];}
elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];}
if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];}
elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];}
if (isset($_GET["use_campaign_dnc"])) {$use_campaign_dnc=$_GET["use_campaign_dnc"];}
elseif (isset($_POST["use_campaign_dnc"])) {$use_campaign_dnc=$_POST["use_campaign_dnc"];}
if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];}
elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];}
if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];}
@@ -599,6 +603,16 @@ if ($ACTION == 'manDiaLnextCaLL')
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
echo "DNC NUMBER\n";
exit;
}
$stmt="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
echo "DNC NUMBER\n";
@@ -1441,7 +1455,7 @@ if ($stage == "end")
else {$alt_phone = '';}
if (strlen($alt_phone)>5)
{
if (ereg("Y",$VD_use_internal_dnc))
if (ereg("Y",$use_internal_dnc))
{
$stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$alt_phone';";
$rslt=mysql_query($stmt, $link);
@@ -1454,6 +1468,18 @@ if ($stage == "end")
}
}
else {$VD_alt_dnc_count=0;}
if (ereg("Y",$use_campaign_dnc))
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$alt_phone' and campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VLAP_cdnc_ct = mysql_num_rows($rslt);
if ($VLAP_cdnc_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]);
}
}
if ($VD_alt_dnc_count < 1)
{
### insert record into vicidial_hopper for alt_phone call attempt
@@ -1488,7 +1514,7 @@ if ($stage == "end")
else {$address3 = '';}
if (strlen($address3)>5)
{
if (ereg("Y",$VD_use_internal_dnc))
if (ereg("Y",$use_internal_dnc))
{
$stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$address3';";
$rslt=mysql_query($stmt, $link);
@@ -1501,6 +1527,18 @@ if ($stage == "end")
}
}
else {$VD_alt_dnc_count=0;}
if (ereg("Y",$use_campaign_dnc))
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$address3' and campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VLAP_cdnc_ct = mysql_num_rows($rslt);
if ($VLAP_cdnc_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]);
}
}
if ($VD_alt_dnc_count < 1)
{
### insert record into vicidial_hopper for address3 call attempt
@@ -1570,7 +1608,7 @@ if ($stage == "end")
if (ereg("Y",$VD_altdial_active))
{
if (ereg("Y",$VD_use_internal_dnc))
if (ereg("Y",$use_internal_dnc))
{
$stmtA="SELECT count(*) FROM vicidial_dnc where phone_number='$VD_altdial_phone';";
$rslt=mysql_query($stmt, $link);
@@ -1583,6 +1621,18 @@ if ($stage == "end")
}
}
else {$VD_alt_dnc_count=0;}
if (ereg("Y",$use_campaign_dnc))
{
$stmtA="SELECT count(*) FROM vicidial_campaign_dnc where phone_number='$VD_altdial_phone' and campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VLAP_cdnc_ct = mysql_num_rows($rslt);
if ($VLAP_cdnc_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VD_alt_dnc_count = ($VD_alt_dnc_count + $row[0]);
}
}
if ($VD_alt_dnc_count < 1)
{
if ($alt_dial_phones_count == $Xlast)
@@ -1650,7 +1700,7 @@ if ($stage == "end")
### delete call record from vicidial_auto_calls
$stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and uniqueid='$uniqueid';";
$stmt = "DELETE from vicidial_auto_calls where lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -1702,7 +1752,7 @@ if ($stage == "end")
$affected_rows = mysql_affected_rows($linkB);
}
$stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and uniqueid='$uniqueid';";
$stmt = "DELETE from vicidial_auto_calls lead_id='$lead_id' and campaign_id='$campaign' and uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -2593,6 +2643,16 @@ if ($ACTION == 'updateDISPO')
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
}
if ( ($use_campaign_dnc=='Y') and ($dispo_choice=='DNC') )
{
$stmt = "select phone_number from vicidial_list where lead_id='$lead_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
}
}
$dispo_sec=0;
+8 -5
View File
@@ -188,10 +188,11 @@
# 80815-1014 - Added manual dial list restriction option
# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature)
# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls
# 80909-1717 - Added support for campaign-specific DNC lists
#
$version = '2.0.5-166';
$build = '80831-0548';
$version = '2.0.5-167';
$build = '80909-1717';
require("dbconnect.php");
@@ -791,7 +792,7 @@ $VDloginDISPLAY=0;
$HKstatusnames = substr("$HKstatusnames", 0, -1);
##### grab the campaign settings
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$row=mysql_fetch_row($rslt);
@@ -832,6 +833,7 @@ $VDloginDISPLAY=0;
$display_queue_count = $row[34];
$manual_dial_filter = $row[35];
$CopY_tO_ClipboarD = $row[36];
$use_campaign_dnc = $row[37];
if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) )
@@ -1955,6 +1957,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var wrapup_counter = 0;
var wrapup_waiting = 0;
var use_internal_dnc = '<? echo $use_internal_dnc ?>';
var use_campaign_dnc = '<? echo $use_campaign_dnc ?>';
var allcalls_delay = '<? echo $allcalls_delay ?>';
var omit_phone_code = '<? echo $omit_phone_code ?>';
var no_delete_sessions = '<? echo $no_delete_sessions ?>';
@@ -3579,7 +3582,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
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=" + dial_prefix + "&campaign_cid=" + campaign_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 + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter;
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=" + dial_prefix + "&campaign_cid=" + campaign_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;
// 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');
@@ -5268,7 +5271,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs;
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&comments=" + CallBackCommenTs;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(DSupdate_query);
+65 -17
View File
@@ -471,6 +471,8 @@ if (isset($_GET["updater_check_enabled"])) {$updater_check_enabled=$_GET["update
elseif (isset($_POST["updater_check_enabled"])) {$updater_check_enabled=$_POST["updater_check_enabled"];}
if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];}
elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];}
if (isset($_GET["use_campaign_dnc"])) {$use_campaign_dnc=$_GET["use_campaign_dnc"];}
elseif (isset($_POST["use_campaign_dnc"])) {$use_campaign_dnc=$_POST["use_campaign_dnc"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];}
@@ -975,6 +977,7 @@ $selectable = ereg_replace("[^NY]","",$selectable);
$reset_list = ereg_replace("[^NY]","",$reset_list);
$fronter_display = ereg_replace("[^NY]","",$fronter_display);
$use_internal_dnc = ereg_replace("[^NY]","",$use_internal_dnc);
$use_campaign_dnc = ereg_replace("[^NY]","",$use_campaign_dnc);
$omit_phone_code = ereg_replace("[^NY]","",$omit_phone_code);
$available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tally);
$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log);
@@ -1363,11 +1366,12 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir);
# 80823-2124 - Added copy to clipboard campaign option
# 80829-2359 - Added EXTENDED auto_alt_dial options
# 80831-0406 - Added agent screen extended alt-dial option to campaigns
# 80909-0553 - Added campaign-specific DNC list option and add
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.0.5-141';
$build = '80831-0406';
$admin_version = '2.0.5-142';
$build = '80909-0553';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -2747,6 +2751,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR>
<B>Use Internal DNC List -</B> This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N.
<BR>
<A NAME="vicidial_campaigns-use_campaign_dnc">
<BR>
<B>Use Campaign DNC List -</B> This defines whether this campaign is to filter leads against a DNC list that is specific to that campaign only. If it is set to Y, the hopper will look for each phone number in the campaign-specific DNC list before placing it in the hopper. If it is in the campaign-specific DNC list then it will change that lead status to DNCC so it cannot be dialed. Default is N.
<BR>
<A NAME="vicidial_campaigns-closer_campaigns">
<BR>
@@ -2875,7 +2884,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR>
<A NAME="vicidial_campaigns-survey_ni_status">
<BR>
<B>Survey Not Interested Status -</B> This field is where you select the status to be used for Not Interested. If DNC is used and the campaign is set to use DNC then the phone number will be automatically added to the VICIDIAL internal DNC list.
<B>Survey Not Interested Status -</B> This field is where you select the status to be used for Not Interested. If DNC is used and the campaign is set to use DNC then the phone number will be automatically added to the VICIDIAL internal DNC list and possibly the campaign-specific DNC list.
<BR>
<A NAME="vicidial_campaigns-survey_opt_in_audio_file">
@@ -2963,7 +2972,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR>
<A NAME="vicidial_list-dnc">
<BR>
<B>VICIDIAL DNC List -</B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add numbers to this list so that they will not be called by campaigns that use the internal DNC list.
<B>VICIDIAL DNC List -</B> This Do Not Call list contains every lead that has been set to a status of DNC in the system. Through the LISTS - ADD NUMBER TO DNC page you are able to manually add numbers to this list so that they will not be called by campaigns that use the internal DNC list. There is also the option to add leads to the campaign-specific DNC lists for those campaigns that have them.
@@ -4984,6 +4993,7 @@ if ($ADD==12)
echo "</select>$NWB#vicidial_campaigns-campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>NOTE: Copying a campaign will copy all settings from the master campaign you select, but it will not copy a campaign-specific DNC list if there was one on the selected master campaign.</td></tr>\n";
echo "</TABLE></center>\n";
}
else
@@ -5019,11 +5029,12 @@ if ($ADD==111)
$campaigns_list='';
$o=0;
while ($campaigns_to_print > $o) {
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
}
echo "$campaigns_list";
echo "<option SELECTED>$campaign_id</option>\n";
echo "</select>$NWB#vicidial_lists-campaign_id$NWE</td></tr>\n";
@@ -5048,6 +5059,20 @@ if ($ADD==121)
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$campaigns_list = "<option SELECTED value=\"SYSTEM_INTERNAL\">SYSTEM_INTERNAL - INTERNAL VICIDIAL DNC LIST</option>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc='Y' order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";
$o++;
}
if (strlen($phone_numbers) > 2)
{
$PN = explode("\n",$phone_numbers);
@@ -5055,18 +5080,35 @@ if (strlen($phone_numbers) > 2)
$p=0;
while ($p < $PNct)
{
$stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p]\n";}
if (ereg('SYSTEM_INTERNAL',$campaign_id))
{
$stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p]\n";}
else
{
$stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>DNC ADDED: $PN[$p]</B>\n";
}
}
else
{
$stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');";
$stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p] $campaign_id\n";}
else
{
$stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$PN[$p]','$campaign_id');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>DNC ADDED: $PN[$p]</B>\n";
echo "<br><B>DNC ADDED: $PN[$p] $campaign_id</B>\n";
}
}
$p++;
}
@@ -5075,7 +5117,7 @@ if (strlen($phone_numbers) > 2)
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number'|\n");
fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number','$campaign_id'|\n");
fclose($fp);
}
}
@@ -5083,6 +5125,9 @@ if (strlen($phone_numbers) > 2)
echo "<br>ADD NUMBERS TO THE DNC LIST<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=121>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>List: </td><td align=left><select size=1 name=campaign_id>\n";
echo "$campaigns_list";
echo "</select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Numbers: <BR><BR> (one phone number per line only)<BR>$NWB#vicidial_list-dnc$NWE</td><td align=left><TEXTAREA name=phone_numbers ROWS=20 COLS=20></TEXTAREA></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
@@ -5865,7 +5910,7 @@ if ($ADD==20)
{
echo "<br><B>CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id</B>\n";
$stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial from vicidial_campaigns where campaign_id='$source_campaign_id';";
$stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc from vicidial_campaigns where campaign_id='$source_campaign_id';";
$rslt=mysql_query($stmt, $link);
$stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');";
@@ -7155,7 +7200,7 @@ if ($ADD==41)
if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) )
{$hopper_level='100';}
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial' where campaign_id='$campaign_id';";
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmtA, $link);
if ($reset_hopper == 'Y')
@@ -10468,6 +10513,7 @@ if ($ADD==31)
$manual_dial_filter = $row[92];
$agent_clipboard_copy = $row[93];
$agent_extended_alt_dial = $row[94];
$use_campaign_dnc = $row[95];
if (ereg("DISABLED",$list_order_mix))
{$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;}
@@ -10876,6 +10922,8 @@ if ($ADD==31)
echo "<tr bgcolor=#B6D3FC><td align=right>Use Internal DNC List: </td><td align=left><select size=1 name=use_internal_dnc><option>Y</option><option>N</option><option SELECTED>$use_internal_dnc</option></select>$NWB#vicidial_campaigns-use_internal_dnc$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Use Campaign DNC List: </td><td align=left><select size=1 name=use_campaign_dnc><option>Y</option><option>N</option><option SELECTED>$use_campaign_dnc</option></select>$NWB#vicidial_campaigns-use_campaign_dnc$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Pause Codes Active: </td><td align=left><select size=1 name=agent_pause_codes_active><option>Y</option><option>N</option><option SELECTED>$agent_pause_codes_active</option></select>$NWB#vicidial_campaigns-agent_pause_codes_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign Stats Refresh: </td><td align=left><select size=1 name=campaign_stats_refresh><option>Y</option><option>N</option><option SELECTED>$campaign_stats_refresh</option></select>$NWB#vicidial_campaigns-campaign_stats_refresh$NWE</td></tr>\n";
+106 -16
View File
@@ -9,16 +9,18 @@
# required variables:
# - $user
# - $pass
# - $function - ('add_lead')
# - $function - ('add_lead','version')
# - $format - ('text','debug')
# CHANGELOG:
# 80724-0021 - First build of script
# 80801-0047 - Added gmt lookup and hopper insert time validation
# 80909-2012 - Added support for campaign-specific DNC lists
# 80910-0020 - Added support for multi-alt-phones, added version function
#
$version = '2.0.5-2';
$build = '80801-0047';
$version = '2.0.5-4';
$build = '80910-0020';
require("dbconnect.php");
@@ -81,12 +83,18 @@ if (isset($_GET["comments"])) {$comments=$_GET["comments"];}
elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];}
if (isset($_GET["dnc_check"])) {$dnc_check=$_GET["dnc_check"];}
elseif (isset($_POST["dnc_check"])) {$dnc_check=$_POST["dnc_check"];}
if (isset($_GET["campaign_dnc_check"])) {$campaign_dnc_check=$_GET["campaign_dnc_check"];}
elseif (isset($_POST["campaign_dnc_check"])) {$campaign_dnc_check=$_POST["campaign_dnc_check"];}
if (isset($_GET["add_to_hopper"])) {$add_to_hopper=$_GET["add_to_hopper"];}
elseif (isset($_POST["add_to_hopper"])) {$add_to_hopper=$_POST["add_to_hopper"];}
if (isset($_GET["hopper_priority"])) {$hopper_priority=$_GET["hopper_priority"];}
elseif (isset($_POST["hopper_priority"])) {$hopper_priority=$_POST["hopper_priority"];}
if (isset($_GET["hopper_local_call_time_check"])) {$hopper_local_call_time_check=$_GET["hopper_local_call_time_check"];}
elseif (isset($_POST["hopper_local_call_time_check"])) {$hopper_local_call_time_check=$_POST["hopper_local_call_time_check"];}
if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];}
elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];}
if (isset($_GET["multi_alt_phones"])) {$multi_alt_phones=$_GET["multi_alt_phones"];}
elseif (isset($_POST["multi_alt_phones"])) {$multi_alt_phones=$_POST["multi_alt_phones"];}
header ("Content-type: text/html; charset=utf-8");
@@ -119,30 +127,48 @@ if ($non_latin < 1)
$phone_code = ereg_replace("[^0-9]","",$phone_code);
$phone_number = ereg_replace("[^0-9]","",$phone_number);
$vendor_lead_code = ereg_replace(";","",$vendor_lead_code);
$vendor_lead_code = ereg_replace("\+"," ",$vendor_lead_code);
$source_id = ereg_replace(";","",$source_id);
$source_id = ereg_replace("\+"," ",$source_id);
$gmt_offset_now = ereg_replace("-\_\.0-9","",$gmt_offset_now);
$title = ereg_replace("[^- \_\.0-9a-zA-Z]","",$title);
$first_name = ereg_replace("[^- \_\.0-9a-zA-Z]","",$first_name);
$first_name = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$first_name);
$first_name = ereg_replace("\+"," ",$first_name);
$middle_initial = ereg_replace("[^0-9a-zA-Z]","",$middle_initial);
$last_name = ereg_replace("[^- \_\.0-9a-zA-Z]","",$last_name);
$address1 = ereg_replace("[^- \.\:\/\@\_0-9a-zA-Z]","",$address1);
$address2 = ereg_replace("[^- \.\:\/\@\_0-9a-zA-Z]","",$address2);
$address3 = ereg_replace("[^- \.\:\/\@\_0-9a-zA-Z]","",$address3);
$city = ereg_replace("[^- \.\:\/\@\_0-9a-zA-Z]","",$city);
$last_name = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$last_name);
$last_name = ereg_replace("\+"," ",$last_name);
$address1 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address1);
$address2 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address2);
$address3 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address3);
$address1 = ereg_replace("\+"," ",$address1);
$address2 = ereg_replace("\+"," ",$address2);
$address3 = ereg_replace("\+"," ",$address3);
$city = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$city);
$city = ereg_replace("\+"," ",$city);
$state = ereg_replace("[^- 0-9a-zA-Z]","",$state);
$province = ereg_replace("[^- \.\_0-9a-zA-Z]","",$province);
$postal_code = ereg_replace("[^- 0-9a-zA-Z]","",$postal_code);
$province = ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$province);
$province = ereg_replace("\+"," ",$province);
$postal_code = ereg_replace("[^- \+0-9a-zA-Z]","",$postal_code);
$postal_code = ereg_replace("\+"," ",$postal_code);
$country_code = ereg_replace("[^A-Z]","",$country_code);
$gender = ereg_replace("[^A-Z]","",$gender);
$date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth);
$alt_phone = ereg_replace("[^- \_\.0-9a-zA-Z]","",$alt_phone);
$email = ereg_replace("[^- \.\:\/\@\_0-9a-zA-Z]","",$email);
$security_phrase = ereg_replace("[^- \.\:\/\@\_0-9a-zA-Z]","",$security_phrase);
$alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone);
$alt_phone = ereg_replace("\+"," ",$alt_phone);
$email = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email);
$email = ereg_replace("\+"," ",$email);
$security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase);
$security_phrase = ereg_replace("\+"," ",$security_phrase);
$comments = ereg_replace(";","",$comments);
$comments = ereg_replace("\+"," ",$comments);
$dnc_check = ereg_replace("[^A-Z]","",$dnc_check);
$campaign_dnc_check = ereg_replace("[^A-Z]","",$campaign_dnc_check);
$add_to_hopper = ereg_replace("[^A-Z]","",$add_to_hopper);
$hopper_priority = ereg_replace("-0-9","",$hopper_priority);
$hopper_local_call_time_check = ereg_replace("[^A-Z]","",$hopper_local_call_time_check);
$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id);
$multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones);
$multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones);
}
if (strlen($list_id)<1) {$list_id='999';}
@@ -204,6 +230,18 @@ $LOCAL_GMT_OFF_STD = $SERVER_GMT;
################################################################################
### version - show version and date information for the API
################################################################################
if ($function == 'version')
{
echo "VERSION: $version|BUILD: $build|DATE: $NOW_TIME|EPOCH: $StarTtime\n";
exit;
}
################################################################################
### add_lead - inserts a lead into the vicidial_list table
################################################################################
@@ -243,10 +281,25 @@ if ($function == 'add_lead')
exit;
}
}
if ($campaign_dnc_check == 'Y')
{
$stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$phone_number' and campaign_id='$campaign_id';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$dnc_found=$row[0];
if ($dnc_found > 0)
{
echo "ERROR: add_lead PHONE NUMBER IN CAMPAIGN DNC - $phone_number|$campaign_id|$user\n";
exit;
}
}
### get current gmt_offset of the phone_number
$gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code);
### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='NEW',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',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',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME';";
if ($DB) {echo "$stmt\n";}
@@ -258,6 +311,39 @@ if ($function == 'add_lead')
echo "SUCCESS: add_lead LEAD HAS BEEN ADDED - $phone_number|$user|$list_id|$lead_id|$gmt_offset\n";
if (strlen($multi_alt_phones) > 5)
{
$map=$MT; $ALTm_phone_code=$MT; $ALTm_phone_number=$MT; $ALTm_phone_note=$MT;
$map = explode('!', $multi_alt_phones);
$map_count = count($map);
if ($DB) {echo "multi-al-entry: $a|$map_count|$multi_alt_phones\n";}
$g++;
$r=0; $s=0; $inserted_alt_phones=0;
while ($r < $map_count)
{
$s++;
$ncn=$MT;
$ncn = explode('_', $map[$r]);
print "$ncn[0]|$ncn[1]|$ncn[2]";
if (strlen($forcephonecode) > 0)
{$ALTm_phone_code[$r] = $forcephonecode;}
else
{$ALTm_phone_code[$r] = $ncn[1];}
if (strlen($ALTm_phone_code[$r]) < 1)
{$ALTm_phone_code[$r]='1';}
$ALTm_phone_number[$r] = $ncn[0];
$ALTm_phone_note[$r] = $ncn[2];
$stmt = "INSERT INTO vicidial_list_alt_phones (lead_id,phone_code,phone_number,alt_phone_note,alt_phone_count) values('$lead_id','$ALTm_phone_code[$r]','$ALTm_phone_number[$r]','$ALTm_phone_note[$r]','$s');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$Zaffected_rows = mysql_affected_rows($link);
$inserted_alt_phones = ($inserted_alt_phones + $Zaffected_rows);
$r++;
}
echo "NOTICE: add_lead MULTI-ALT-PHONE NUMBERS LOADED - $inserted_alt_phones|$user|$lead_id\n";
}
if ($add_to_hopper == 'Y')
{
$dialable=1;
@@ -267,7 +353,7 @@ if ($function == 'add_lead')
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$local_call_time=$row[0];
$campaign_id=$row[1];
$VD_campaign_id=$row[1];
if ($hopper_local_call_time_check == 'Y')
{
@@ -283,7 +369,7 @@ if ($function == 'add_lead')
### code to insert into hopper goes here
### insert record into vicidial_hopper for alt_phone call attempt
$stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign_id',status='READY',list_id='$list_id',gmt_offset_now='$gmt_offset',state='$state',user='',priority='$hopper_priority';";
$stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$VD_campaign_id',status='READY',list_id='$list_id',gmt_offset_now='$gmt_offset',state='$state',user='',priority='$hopper_priority';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$Haffected_rows = mysql_affected_rows($link);
@@ -306,11 +392,15 @@ if ($function == 'add_lead')
}
}
}
exit;
}
echo "ERROR: NO FUNCTION SPECIFIED\n";