diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index ef9c3a1e..ccb95f8e 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -48,6 +48,7 @@ # 71029-1726 - Changed CLOSER-type campaigns to use new campaign_allow_inbound field # 71030-0713 - fixed after-hours logging # 71030-0939 - fixed issue where MoH was still playing, added ding and wait before transfer +# 71103-2305 - added group rank and fewest calls options to next_agent_call # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -348,10 +349,10 @@ while ($sthArows > $cbc) $agent_alert_exten = "$aryA[9]"; $agent_alert_delay = "$aryA[10]"; $drop_call_seconds = "$aryA[11]"; - $drop_message = "$aryA[11]"; - $drop_exten = "$aryA[12]"; - $CAMP_callorder = "$aryA[13]"; - $VDADvoicemail_ext = "$aryA[14]"; + $drop_message = "$aryA[12]"; + $drop_exten = "$aryA[13]"; + $CAMP_callorder = "$aryA[14]"; + $VDADvoicemail_ext = "$aryA[15]"; $VDADvoicemail_ext =~ s/\D//gi; $cbc++; } @@ -631,15 +632,18 @@ if ($channel_status < 1) } } - $agent_call_order='order by last_call_finish'; - if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by user_level desc,last_call_finish';} - if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} - if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} - if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} - - $rec_countCUSTDATA=0; + $rec_countCUSTDATA=0; $rec_countWAIT=0; $cbc=0; + $aco_sub=0; + $agent_call_order='order by last_call_finish'; + if ($CAMP_callorder =~ /overall_user_level/i) {$agent_call_order = 'order by user_level desc,last_call_finish';} + if ($CAMP_callorder =~ /oldest_call_start/i) {$agent_call_order = 'order by last_call_time';} + if ($CAMP_callorder =~ /oldest_call_finish/i) {$agent_call_order = 'order by last_call_finish';} + if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';} + if ($CAMP_callorder =~ /inbound_group_rank/i) {$aco_sub=1; $agent_call_order = 'order by group_weight desc';} + if ($CAMP_callorder =~ /fewest_calls/i) {$aco_sub=1; $agent_call_order = 'order by calls_today';} + ##### Attempt to send call to an agent on this server only ##### if ($agent_search_method =~ /^SO|^LO/) @@ -660,30 +664,69 @@ if ($agent_search_method =~ /^SO|^LO/) if ($rec_countWAIT < 1) { - $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$insert_lead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid' where status IN('CLOSER','READY') and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and closer_campaigns LIKE \"% $channel_group %\" and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; - my $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDAD get agent: |$affected_rows|$channel_group|$stmtA|"; &agi_output;} - if ($affected_rows > 0) + if ($aco_sub>0) { - $cbc=0; - $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status = 'QUEUE' and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; + $stmtA = "LOCK TABLES vicidial_live_agents WRITE, vicidial_live_inbound_agents WRITE;"; + my $LOCKaffected_rows = $dbhA->do($stmtA); + + $stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension from vicidial_live_agents JOIN vicidial_live_inbound_agents ON vicidial_live_agents.user=vicidial_live_inbound_agents.user WHERE status IN('CLOSER','READY') and server_ip='$VARserver_ip' and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; - $rec_countCUSTDATA=0; - while ($sthArows > $cbc) + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; $VDADconf_exten = "$aryA[0]"; $VDADuser = "$aryA[1]"; $VDADextension = "$aryA[2]"; - - $cbc++; } $sthA->finish(); + if ($sthArows > 0) + { + $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$insert_lead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid' where user='$VDADuser';"; + my $affected_rows = $dbhA->do($stmtA); + } + else + { + $affected_rows=0; + } + + $stmtA = "UNLOCK TABLES;"; + my $LOCKaffected_rows = $dbhA->do($stmtA); + } + else + { + $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$insert_lead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid' where status IN('CLOSER','READY') and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and closer_campaigns LIKE \"% $channel_group %\" and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; + my $affected_rows = $dbhA->do($stmtA); + } + if ($AGILOG) {$agi_string = "-- VDAD get agent: |$affected_rows|$channel_group|$stmtA|"; &agi_output;} + if ($affected_rows > 0) + { + if ($aco_sub<1) + { + $cbc=0; + $stmtA = "SELECT conf_exten,user,extension FROM vicidial_live_agents where status = 'QUEUE' and server_ip='$VARserver_ip' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_countCUSTDATA=0; + while ($sthArows > $cbc) + { + @aryA = $sthA->fetchrow_array; + + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + + $cbc++; + } + $sthA->finish(); + } + $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER : |$affected_rows|$callerid\n|$stmtA|"; &agi_output;} @@ -694,7 +737,6 @@ if ($agent_search_method =~ /^SO|^LO/) if ($AGILOG) {$agi_string = "$affected_rows|VDAC-reinsert|$stmtA|"; &agi_output;} } - if ($call_handle_method =~ /CLOSER|DIGITID$/) { $stmtA = "UPDATE vicidial_xfer_log set closer='$VDADuser' where lead_id = '$insert_lead_id' order by call_date desc limit 1;"; @@ -723,7 +765,30 @@ if ($agent_search_method =~ /^SO|^LO/) $AGI->stream_file('ding'); # stop music-on-hold process - sleep(1); + ### update calls_today for vicidial_live_inbound_agents ### + $stmtA = "SELECT calls_today from vicidial_inbound_group_agents WHERE user='$VDADuser' and group_id='$channel_group';"; + 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; + $calls_today = "$aryA[0]"; + $calls_today++; + } + $sthA->finish(); + + if ($sthArows > 0) + { + $stmtA = "UPDATE vicidial_live_inbound_agents set calls_today='$calls_today' WHERE user='$VDADuser' and group_id='$channel_group';"; + my $affected_rows = $dbhA->do($stmtA); + $stmtA = "UPDATE vicidial_inbound_group_agents set calls_today='$calls_today' WHERE user='$VDADuser' and group_id='$channel_group';"; + my $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDLIA agent calls: |$calls_today|$VDADuser|$channel_group|"; &agi_output;} + } + + usleep(1*500*1000); print "SET CONTEXT $ext_context\n"; checkresult($result); @@ -786,29 +851,69 @@ if ($agent_search_method =~ /^LO|^LB/) if ($rec_countWAITrem < 1) { - $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$insert_lead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid', call_server_ip='$VARserver_ip' where status IN('CLOSER','READY') and campaign_id IN($INBOUNDcampsSQL) and closer_campaigns LIKE \"% $channel_group %\" and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; - my $affected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDAD get agent: |$DROP_TIME|$drop_timer|$affected_rows|update of vla table: $channel_group|\n|$stmtA|"; &agi_output;} - if ($affected_rows > 0) + if ($aco_sub>0) { - $cbc=0; - $stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where status = 'QUEUE' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; + $stmtA = "LOCK TABLES vicidial_live_agents WRITE, vicidial_live_inbound_agents WRITE;"; + my $LOCKaffected_rows = $dbhA->do($stmtA); + + $stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip from vicidial_live_agents JOIN vicidial_live_inbound_agents ON vicidial_live_agents.user=vicidial_live_inbound_agents.user WHERE status IN('CLOSER','READY') and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; $rec_countCUSTDATA=0; - while ($sthArows > $cbc) + if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; $VDADuser = "$aryA[1]"; $VDADextension = "$aryA[2]"; $VDADserver_ip = "$aryA[3]"; - $cbc++; } $sthA->finish(); + if ($sthArows > 0) + { + $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$insert_lead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid', call_server_ip='$VARserver_ip' where user='$VDADuser';"; + my $affected_rows = $dbhA->do($stmtA); + } + else + { + $affected_rows=0; + } + + $stmtA = "UNLOCK TABLES;"; + my $LOCKaffected_rows = $dbhA->do($stmtA); + } + else + { + $stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$insert_lead_id',uniqueid='$unique_id', channel='$channel', callerid='$callerid', call_server_ip='$VARserver_ip' where status IN('CLOSER','READY') and campaign_id IN($INBOUNDcampsSQL) and closer_campaigns LIKE \"% $channel_group %\" and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;"; + my $affected_rows = $dbhA->do($stmtA); + } + if ($AGILOG) {$agi_string = "-- VDAD get agent: |$DROP_TIME|$drop_timer|$affected_rows|update of vla table: $channel_group|\n|$stmtA|"; &agi_output;} + if ($affected_rows > 0) + { + if ($aco_sub<1) + { + $cbc=0; + $stmtA = "SELECT conf_exten,user,extension,server_ip FROM vicidial_live_agents where status = 'QUEUE' and campaign_id IN($INBOUNDcampsSQL) and callerid='$callerid' and channel='$channel' order by last_call_time limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $rec_countCUSTDATA=0; + while ($sthArows > $cbc) + { + @aryA = $sthA->fetchrow_array; + $VDADconf_exten = "$aryA[0]"; + $VDADuser = "$aryA[1]"; + $VDADextension = "$aryA[2]"; + $VDADserver_ip = "$aryA[3]"; + $cbc++; + } + $sthA->finish(); + } $stmtA = "UPDATE vicidial_auto_calls set status='CLOSER', stage='CLOSER-$drop_timer' where callerid='$callerid';"; my $affected_rows = $dbhA->do($stmtA); if ($AGILOG) {$agi_string = "-- VDCL XFER REMOTE: |$affected_rows|update of vac table: $callerid\n|$stmtA|"; &agi_output;} @@ -858,7 +963,30 @@ if ($agent_search_method =~ /^LO|^LB/) $AGI->stream_file('ding'); # stop music-on-hold process - sleep(1); + ### update calls_today for vicidial_live_inbound_agents ### + $stmtA = "SELECT calls_today from vicidial_inbound_group_agents WHERE user='$VDADuser' and group_id='$channel_group';"; + 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; + $calls_today = "$aryA[0]"; + $calls_today++; + } + $sthA->finish(); + + if ($sthArows > 0) + { + $stmtA = "UPDATE vicidial_live_inbound_agents set calls_today='$calls_today' WHERE user='$VDADuser' and group_id='$channel_group';"; + my $affected_rows = $dbhA->do($stmtA); + $stmtA = "UPDATE vicidial_inbound_group_agents set calls_today='$calls_today' WHERE user='$VDADuser' and group_id='$channel_group';"; + my $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDLIA agent calls: |$calls_today|$VDADuser|$channel_group|"; &agi_output;} + } + + usleep(1*500*1000); print "SET CONTEXT $ext_context\n"; checkresult($result); diff --git a/agc_2-X/trunk/docs/BASE_INSTALL.txt b/agc_2-X/trunk/docs/BASE_INSTALL.txt index 3e1d51d5..88b9db0d 100644 --- a/agc_2-X/trunk/docs/BASE_INSTALL.txt +++ b/agc_2-X/trunk/docs/BASE_INSTALL.txt @@ -242,8 +242,8 @@ to use our new mysql script file to add the tables to the database: create database asterisk; -GRANT SELECT,INSERT,UPDATE,DELETE on asterisk.* TO cron@'%' IDENTIFIED BY '1234'; -GRANT SELECT,INSERT,UPDATE,DELETE on asterisk.* TO cron@localhost IDENTIFIED BY '1234'; +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'; use asterisk; @@ -251,10 +251,6 @@ use asterisk; or you may need to run this if you get an error: \. /usr/src/astguiclient/astguiclient/MySQL_AST_CREATE_tables.sql -GRANT SELECT on asterisk.phones TO idcheck@'%' IDENTIFIED BY '1234'; -GRANT SELECT on asterisk.phones TO idcheck@localhost IDENTIFIED BY '1234'; - - ##### make sure on these queries that you change the server_ip "10.10.10.15" ##### to the server IP that you are using diff --git a/agc_2-X/trunk/docs/SCRATCH_INSTALL.txt b/agc_2-X/trunk/docs/SCRATCH_INSTALL.txt index 67026470..01b7012c 100644 --- a/agc_2-X/trunk/docs/SCRATCH_INSTALL.txt +++ b/agc_2-X/trunk/docs/SCRATCH_INSTALL.txt @@ -1648,8 +1648,8 @@ to use our new mysql script file to add the tables to the database: ######------ BEGIN Mysql data entry(you can copy and paste this into terminal) # create database asterisk; -GRANT SELECT,INSERT,UPDATE,DELETE on asterisk.* TO cron@'%' IDENTIFIED BY '1234'; -GRANT SELECT,INSERT,UPDATE,DELETE on asterisk.* TO cron@localhost IDENTIFIED BY '1234'; +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'; # 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'; @@ -1660,9 +1660,6 @@ use asterisk; or you may need to run this if you get an error: \. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql -GRANT SELECT on asterisk.phones TO idcheck@'%' IDENTIFIED BY '1234'; -GRANT SELECT on asterisk.phones TO idcheck@localhost IDENTIFIED BY '1234'; - 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.17'); insert into server_updater values('10.10.10.15',''); 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 da7a60ae..6faae70a 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -592,7 +592,7 @@ group_color VARCHAR(7), active ENUM('Y','N'), web_form_address VARCHAR(255), voicemail_ext VARCHAR(10), -next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level') default 'oldest_call_finish', +next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level','inbound_group_rank','fewest_calls') default 'oldest_call_finish', fronter_display ENUM('Y','N') default 'Y', ingroup_script VARCHAR(10), get_call_launch ENUM('NONE','SCRIPT','WEBFORM') default 'NONE', diff --git a/agc_2-X/trunk/extras/upgrade_2.0.4.sql b/agc_2-X/trunk/extras/upgrade_2.0.4.sql index d54d45d5..e04804b8 100644 --- a/agc_2-X/trunk/extras/upgrade_2.0.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.0.4.sql @@ -113,7 +113,6 @@ ALTER TABLE vicidial_campaigns ADD manual_dial_list_id BIGINT(14) UNSIGNED defau ALTER TABLE vicidial_hopper ADD priority TINYINT(2) default '0'; - CREATE TABLE vicidial_live_inbound_agents ( user VARCHAR(20), group_id VARCHAR(20), @@ -125,6 +124,10 @@ index (group_id), index (group_weight) ); +ALTER TABLE vicidial_inbound_groups MODIFY next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level','inbound_group_rank','fewest_calls') default 'oldest_call_finish'; + +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'; #!!!!!!! CHANGES BELOW THIS LINE ARE NOT FOR PRODUCTION USE YET, DO NOT APPLY THEM!!!!!!!!!!!!!!!!!!!!! diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt index d7517da0..e489a0d1 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.4.txt @@ -109,6 +109,8 @@ Allow Inbound and Blended -<\/B> This is where you can set whether the users of Allow Inbound and Blended: || Manual Dial List ID -<\/B> The default list_id to be used when an agent placces a manual call and a new lead record is created in vicidial_list. Default is 999. This field can contain digits only|| Manual Dial List ID: || +inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest|| +fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first|| ############################################################ CLIENT diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index 592c1100..5a0d7b93 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -382,29 +382,33 @@ if ($ACTION == 'regCLOSER') $rslt=mysql_query($stmt, $link); } - $in_groups = explode(" ",$closer_choice); + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); $in_groups_ct = count($in_groups); $k=1; while ($k < $in_groups_ct) { - $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $viga_ct = mysql_num_rows($rslt); - if ($viga_ct > 0) + if (strlen($in_groups[$k])>1) { - $row=mysql_fetch_row($rslt); - $group_weight = $row[0]; - $calls_today = $row[1]; + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); } - else - { - $group_weight = 0; - $calls_today = 0; - } - $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); $k++; } diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 97b2ed94..5c4ba2e3 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -1117,12 +1117,13 @@ $list_mix_container = ereg_replace(";","",$list_mix_container); # 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name # - Added 5th NEW and 6th NEW to the dial order options # 71030-2010 - Added Manual Dial List ID field to campaigns table +# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options # # # 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.4-113'; -$build = '71030-2010'; +$admin_version = '2.0.4-114'; +$build = '71103-2207'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2307,6 +2308,8 @@ echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
  - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall.
  - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call.
  - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. +
  - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest. +
  - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
@@ -4033,7 +4036,7 @@ if ($ADD==1111) echo "
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script:
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: