diff --git a/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi b/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi index 1cc94d10..b7107274 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_LB_transfer.agi @@ -137,6 +137,7 @@ $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $SQLdateBEGIN = $SQLdate; +$secX = time(); $BDtarget = ($secX - 5); ($Bsec,$Bmin,$Bhour,$Bmday,$Bmon,$Byear,$Bwday,$Byday,$Bisdst) = localtime($BDtarget); $Byear = ($Byear + 1900); @@ -288,7 +289,7 @@ if ($affected_rows > 0) $sthA->finish(); ### Grab campaign values from the database - $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; + $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten,concurrent_transfers 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; @@ -299,6 +300,7 @@ if ($affected_rows > 0) $DBdrop_call_seconds = "$aryA[0]"; $DBsafe_harbor_message = "$aryA[1]"; $DBsafe_harbor_exten = "$aryA[2]"; + $DBconcurrent_transfers = "$aryA[3]"; if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;} if ($DBsafe_harbor_message) {$safe_harbor_message = $DBsafe_harbor_message;} if ($DBsafe_harbor_exten) {$safe_harbor_exten = $DBsafe_harbor_exten;} @@ -369,7 +371,29 @@ while ($sthArows > $rec_count) $rec_count++; } $sthA->finish(); -if ($rec_countWAIT < 1) +if ($DBconcurrent_transfers =~ /AUTO/) + { + $active_agents=1; + $stmtA = "SELECT count(*) FROM vicidial_live_agents where campaign_id = '$VDADcampaign' and last_update_time > '$BDtsSQLdate';"; + 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; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $active_agents = "$aryA[0]"; + $rec_count++; + } + + $DBconcurrent_transfers = ($active_agents / 10); + $DBconcurrent_transfers = sprintf("%.0f", $DBconcurrent_transfers); + $DBconcurrent_transfers++; + if ($AGILOG) {$agi_string = "|CONCURRENT TRANSFERS AUTO SETTING: $DBconcurrent_transfers ($active_agents)|"; &agi_output;} + } +$sthA->finish(); +if ($rec_countWAIT < $DBconcurrent_transfers) { $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid' where status = 'READY' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi b/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi index 226ba4e9..d7a5c5d4 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_LO_transfer.agi @@ -137,6 +137,7 @@ $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $SQLdateBEGIN = $SQLdate; +$secX = time(); $BDtarget = ($secX - 5); ($Bsec,$Bmin,$Bhour,$Bmday,$Bmon,$Byear,$Bwday,$Byday,$Bisdst) = localtime($BDtarget); $Byear = ($Byear + 1900); @@ -288,7 +289,7 @@ if ($affected_rows > 0) $sthA->finish(); ### Grab campaign values from the database - $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; + $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten,concurrent_transfers 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; @@ -299,6 +300,7 @@ if ($affected_rows > 0) $DBdrop_call_seconds = "$aryA[0]"; $DBsafe_harbor_message = "$aryA[1]"; $DBsafe_harbor_exten = "$aryA[2]"; + $DBconcurrent_transfers = "$aryA[3]"; if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;} if ($DBsafe_harbor_message) {$safe_harbor_message = $DBsafe_harbor_message;} if ($DBsafe_harbor_exten) {$safe_harbor_exten = $DBsafe_harbor_exten;} @@ -369,7 +371,30 @@ while ($sthArows > $rec_count) $rec_count++; } $sthA->finish(); -if ($rec_countWAIT < 1) +if ($DBconcurrent_transfers =~ /AUTO/) + { + $active_agents=1; + $stmtA = "SELECT count(*) FROM vicidial_live_agents where server_ip='$VARserver_ip' and campaign_id = '$VDADcampaign' and last_update_time > '$BDtsSQLdate';"; + 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; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $active_agents = "$aryA[0]"; + $rec_count++; + } + + $concurrent_transfers = ($active_agents / 10); + $concurrent_transfers = sprintf("%.0f", $concurrent_transfers); + $concurrent_transfers++; + if ($AGILOG) {$agi_string = "|CONCURRENT TRANSFERS AUTO SETTING: $concurrent_transfers ($active_agents)|"; &agi_output;} + } +else {$concurrent_transfers = $DBconcurrent_transfers;} +$sthA->finish(); +if ($rec_countWAIT < $concurrent_transfers) { $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid' where status = 'READY' and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; $affected_rows = $dbhA->do($stmtA); @@ -448,7 +473,30 @@ while ($sthArows > $rec_count) $rec_count++; } $sthA->finish(); -if ($rec_countWAITrem < 1) +if ($DBconcurrent_transfers =~ /AUTO/) + { + $active_agents=1; + $stmtA = "SELECT count(*) FROM vicidial_live_agents where server_ip!='$VARserver_ip' and campaign_id = '$VDADcampaign' and last_update_time > '$BDtsSQLdate';"; + 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; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $active_agents = "$aryA[0]"; + $rec_count++; + } + + $concurrent_transfers = ($active_agents / 10); + $concurrent_transfers = sprintf("%.0f", $concurrent_transfers); + $concurrent_transfers++; + if ($AGILOG) {$agi_string = "|CONCURRENT TRANSFERS AUTO SETTING: $concurrent_transfers ($active_agents)|"; &agi_output;} + } +else {$concurrent_transfers = $DBconcurrent_transfers;} +$sthA->finish(); +if ($rec_countWAITrem < $concurrent_transfers) { $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid' where status = 'READY' and server_ip!='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/agi/agi-VDADtransfer.agi b/agc_2-X/trunk/agi/agi-VDADtransfer.agi index 4eccf3a5..9e777a52 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransfer.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransfer.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDADtransfer.agi version 0.6 *DBI-version* +# agi-VDADtransfer.agi version 0.7 *DBI-version* # # runs when a call comes in from the VICIDIAL_auto_dialer. This script will # send the calls out to the reps that are logged in. @@ -25,7 +25,8 @@ # 60816-1036 - added output options check from database # - changed look for agent every 0.5 second for first 4 sec on hold # 60905-1047 - changed look for agent every 0.25 second for first 4 sec on hold -# +# 70109-1715 - added option for concurrent_transfers +# $script = 'agi-VDADtransfer.agi'; @@ -127,6 +128,7 @@ $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $SQLdateBEGIN = $SQLdate; +$secX = time(); $BDtarget = ($secX - 5); ($Bsec,$Bmin,$Bhour,$Bmday,$Bmon,$Byear,$Bwday,$Byday,$Bisdst) = localtime($BDtarget); $Byear = ($Byear + 1900); @@ -278,7 +280,7 @@ if ($affected_rows > 0) $sthA->finish(); ### Grab campaign values from the database - $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; + $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten,concurrent_transfers 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; @@ -289,6 +291,7 @@ if ($affected_rows > 0) $DBdrop_call_seconds = "$aryA[0]"; $DBsafe_harbor_message = "$aryA[1]"; $DBsafe_harbor_exten = "$aryA[2]"; + $DBconcurrent_transfers = "$aryA[3]"; if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;} if ($DBsafe_harbor_message) {$safe_harbor_message = $DBsafe_harbor_message;} if ($DBsafe_harbor_exten) {$safe_harbor_exten = $DBsafe_harbor_exten;} @@ -359,7 +362,29 @@ while ($sthArows > $rec_count) $rec_count++; } $sthA->finish(); -if ($rec_countWAIT < 1) +if ($DBconcurrent_transfers =~ /AUTO/) + { + $active_agents=1; + $stmtA = "SELECT count(*) FROM vicidial_live_agents where server_ip='$VARserver_ip' and campaign_id = '$VDADcampaign' and last_update_time > '$BDtsSQLdate';"; + 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; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $active_agents = "$aryA[0]"; + $rec_count++; + } + + $DBconcurrent_transfers = ($active_agents / 10); + $DBconcurrent_transfers = sprintf("%.0f", $DBconcurrent_transfers); + $DBconcurrent_transfers++; + if ($AGILOG) {$agi_string = "|CONCURRENT TRANSFERS AUTO SETTING: $DBconcurrent_transfers ($active_agents)|"; &agi_output;} + } +$sthA->finish(); +if ($rec_countWAIT < $DBconcurrent_transfers) { $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid' where status = 'READY' and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi b/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi index 8a2318cf..c5f64725 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransferBROADCAST.agi @@ -128,6 +128,7 @@ $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $SQLdateBEGIN = $SQLdate; +$secX = time(); $BDtarget = ($secX - 5); ($Bsec,$Bmin,$Bhour,$Bmday,$Bmon,$Byear,$Bwday,$Byday,$Bisdst) = localtime($BDtarget); $Byear = ($Byear + 1900); @@ -284,7 +285,7 @@ if ($affected_rows > 0) $sthA->finish(); ### Grab campaign values from the database - $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; + $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten,concurrent_transfers 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; @@ -295,6 +296,7 @@ if ($affected_rows > 0) $DBdrop_call_seconds = "$aryA[0]"; $DBsafe_harbor_message = "$aryA[1]"; $DBsafe_harbor_exten = "$aryA[2]"; + $DBconcurrent_transfers = "$aryA[3]"; if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;} if ($DBsafe_harbor_message) {$safe_harbor_message = $DBsafe_harbor_message;} if ($DBsafe_harbor_exten) {$safe_harbor_exten = $DBsafe_harbor_exten;} @@ -365,7 +367,29 @@ while ($sthArows > $rec_count) $rec_count++; } $sthA->finish(); -if ($rec_countWAIT < 1) +if ($DBconcurrent_transfers =~ /AUTO/) + { + $active_agents=1; + $stmtA = "SELECT count(*) FROM vicidial_live_agents where server_ip='$VARserver_ip' and campaign_id = '$VDADcampaign' and last_update_time > '$BDtsSQLdate';"; + 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; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $active_agents = "$aryA[0]"; + $rec_count++; + } + + $DBconcurrent_transfers = ($active_agents / 10); + $DBconcurrent_transfers = sprintf("%.0f", $DBconcurrent_transfers); + $DBconcurrent_transfers++; + if ($AGILOG) {$agi_string = "|CONCURRENT TRANSFERS AUTO SETTING: $DBconcurrent_transfers ($active_agents)|"; &agi_output;} + } +$sthA->finish(); +if ($rec_countWAIT < $DBconcurrent_transfers) { $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid' where status = 'READY' and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi b/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi index 6d888ae1..b81373c1 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransferSURVEY.agi @@ -127,6 +127,7 @@ $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $SQLdateBEGIN = $SQLdate; +$secX = time(); $BDtarget = ($secX - 5); ($Bsec,$Bmin,$Bhour,$Bmday,$Bmon,$Byear,$Bwday,$Byday,$Bisdst) = localtime($BDtarget); $Byear = ($Byear + 1900); @@ -315,7 +316,7 @@ if ($affected_rows > 0) $sthA->finish(); ### Grab campaign values from the database - $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; + $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten,concurrent_transfers 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; @@ -326,6 +327,7 @@ if ($affected_rows > 0) $DBdrop_call_seconds = "$aryA[0]"; $DBsafe_harbor_message = "$aryA[1]"; $DBsafe_harbor_exten = "$aryA[2]"; + $DBconcurrent_transfers = "$aryA[3]"; if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;} if ($DBsafe_harbor_message) {$safe_harbor_message = $DBsafe_harbor_message;} if ($DBsafe_harbor_exten) {$safe_harbor_exten = $DBsafe_harbor_exten;} @@ -396,7 +398,29 @@ while ($sthArows > $rec_count) $rec_count++; } $sthA->finish(); -if ($rec_countWAIT < 1) +if ($DBconcurrent_transfers =~ /AUTO/) + { + $active_agents=1; + $stmtA = "SELECT count(*) FROM vicidial_live_agents where server_ip='$VARserver_ip' and campaign_id = '$VDADcampaign' and last_update_time > '$BDtsSQLdate';"; + 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; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $active_agents = "$aryA[0]"; + $rec_count++; + } + + $DBconcurrent_transfers = ($active_agents / 10); + $DBconcurrent_transfers = sprintf("%.0f", $DBconcurrent_transfers); + $DBconcurrent_transfers++; + if ($AGILOG) {$agi_string = "|CONCURRENT TRANSFERS AUTO SETTING: $DBconcurrent_transfers ($active_agents)|"; &agi_output;} + } +$sthA->finish(); +if ($rec_countWAIT < $DBconcurrent_transfers) { $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid' where status = 'READY' and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi b/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi index e81bddf0..9544f64c 100644 --- a/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi +++ b/agc_2-X/trunk/agi/agi-VDADtransferTEST.agi @@ -129,6 +129,7 @@ $tsSQLdate = "$year$mon$mday$hour$min$sec"; $SQLdate = "$year-$mon-$mday $hour:$min:$sec"; $SQLdateBEGIN = $SQLdate; +$secX = time(); $BDtarget = ($secX - 5); ($Bsec,$Bmin,$Bhour,$Bmday,$Bmon,$Byear,$Bwday,$Byday,$Bisdst) = localtime($BDtarget); $Byear = ($Byear + 1900); @@ -280,7 +281,7 @@ if ($affected_rows > 0) $sthA->finish(); ### Grab campaign values from the database - $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten FROM vicidial_campaigns where campaign_id = '$VDADcampaign';"; + $stmtA = "SELECT drop_call_seconds,safe_harbor_message,safe_harbor_exten,concurrent_transfers 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; @@ -291,6 +292,7 @@ if ($affected_rows > 0) $DBdrop_call_seconds = "$aryA[0]"; $DBsafe_harbor_message = "$aryA[1]"; $DBsafe_harbor_exten = "$aryA[2]"; + $DBconcurrent_transfers = "$aryA[3]"; if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;} if ($DBsafe_harbor_message) {$safe_harbor_message = $DBsafe_harbor_message;} if ($DBsafe_harbor_exten) {$safe_harbor_exten = $DBsafe_harbor_exten;} @@ -361,7 +363,29 @@ while ($sthArows > $rec_count) $rec_count++; } $sthA->finish(); -if ($rec_countWAIT < 1) +if ($DBconcurrent_transfers =~ /AUTO/) + { + $active_agents=1; + $stmtA = "SELECT count(*) FROM vicidial_live_agents where server_ip='$VARserver_ip' and campaign_id = '$VDADcampaign' and last_update_time > '$BDtsSQLdate';"; + 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; + $rec_count=0; + while ($sthArows > $rec_count) + { + @aryA = $sthA->fetchrow_array; + $active_agents = "$aryA[0]"; + $rec_count++; + } + + $DBconcurrent_transfers = ($active_agents / 10); + $DBconcurrent_transfers = sprintf("%.0f", $DBconcurrent_transfers); + $DBconcurrent_transfers++; + if ($AGILOG) {$agi_string = "|CONCURRENT TRANSFERS AUTO SETTING: $DBconcurrent_transfers ($active_agents)|"; &agi_output;} + } +$sthA->finish(); +if ($rec_countWAIT < $DBconcurrent_transfers) { $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid' where status = 'READY' and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index ac0688f4..95956afb 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -493,7 +493,8 @@ adaptive_dropped_percentage SMALLINT(3) default '3', adaptive_maximum_level VARCHAR(6) default '3.0', adaptive_latest_server_time VARCHAR(4) default '2100', adaptive_intensity VARCHAR(6) default '0', -adaptive_dl_diff_target SMALLINT(3) default '0' +adaptive_dl_diff_target SMALLINT(3) default '0', +concurrent_transfers ENUM('AUTO','1','2','3','4','5','6','7','8','9','10') default 'AUTO' ); CREATE TABLE vicidial_lists ( diff --git a/agc_2-X/trunk/extras/upgrade_2.0.2.sql b/agc_2-X/trunk/extras/old_upgrade/upgrade_2.0.2.sql similarity index 100% rename from agc_2-X/trunk/extras/upgrade_2.0.2.sql rename to agc_2-X/trunk/extras/old_upgrade/upgrade_2.0.2.sql diff --git a/agc_2-X/trunk/extras/upgrade_2.0.3.sql b/agc_2-X/trunk/extras/upgrade_2.0.3.sql new file mode 100644 index 00000000..22a38a9e --- /dev/null +++ b/agc_2-X/trunk/extras/upgrade_2.0.3.sql @@ -0,0 +1 @@ +ALTER TABLE vicidial_campaigns ADD concurrent_transfers ENUM('AUTO','1','2','3','4','5','6','7','8','9','10') default 'AUTO'; diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt index b29e2f2d..a7e8cb3b 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt @@ -3,6 +3,8 @@ ADAPT OVERRIDE|| The ADAPT OVERRIDE checkbox allows you to force a new dial level even though the dial method is in an ADAPT mode. This is useful if there is a dramatic shift in the quality of leads and you want to drastically change the dial_level manually.|| There are two special HotKey options that you can use in conjunction with Alternate Phone number dialing, ALTPH2 - Alternate Phone Hot Dial and ADDR3-----Address3 Hot Dial allow an agent to use a hotkey to hangup their call, stay on the same lead, and dial another contact number from that lead.|| +Concurrent Transfers|| +Concurrent Transfers -<\/B> This setting is used to define the number of calls that can be sent to agents at the same time. It is recommended that this setting is left at AUTO. This field is not used by the MANUAL dial method|| ############################################################ CLIENT diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 09803a20..3ac60efc 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -462,7 +462,8 @@ if (isset($_GET["campaigns"])) {$campaigns=$_GET["campaigns"];} elseif (isset($_POST["campaigns"])) {$campaigns=$_POST["campaigns"];} if (isset($_GET["dial_level_override"])) {$dial_level_override=$_GET["dial_level_override"];} elseif (isset($_POST["dial_level_override"])) {$dial_level_override=$_POST["dial_level_override"];} - +if (isset($_GET["concurrent_transfers"])) {$concurrent_transfers=$_GET["concurrent_transfers"];} + elseif (isset($_POST["concurrent_transfers"])) {$concurrent_transfers=$_POST["concurrent_transfers"];} @@ -602,6 +603,7 @@ $ADD = ereg_replace("[^0-9a-zA-Z]","",$ADD); $dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix); $state_call_time_state = ereg_replace("[^0-9a-zA-Z]","",$state_call_time_state); $scheduled_callbacks = ereg_replace("[^0-9a-zA-Z]","",$scheduled_callbacks); +$concurrent_transfers = ereg_replace("[^0-9a-zA-Z]","",$concurrent_transfers); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -803,12 +805,12 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70108-1405 - Added ADAPT OVERRIDE to allow for forced dial_level changes in ADAPT dial methods # - Screen width definable at top of script, merged server_stats into this script # 70109-1638 - Added ALTPH2 and ADDR3 hotkey options for alt number dialing with HotKeys -# +# 70109-1716 - Added concurrent_transfers option to vicidial_campaigns # 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 -$version = '2.0.75'; -$build = '70109-1638'; +$version = '2.0.76'; +$build = '70109-1716'; $STARTtime = date("U"); @@ -1546,6 +1548,11 @@ echo "