diff --git a/docs/AGENT_MULTI-CAMPAIGN_DIALING.txt b/docs/AGENT_MULTI-CAMPAIGN_DIALING.txt
index 0fa8dff6..462cf2b9 100644
--- a/docs/AGENT_MULTI-CAMPAIGN_DIALING.txt
+++ b/docs/AGENT_MULTI-CAMPAIGN_DIALING.txt
@@ -122,13 +122,13 @@ Another much more complex development option would be to add a new campaign dial
How a "SHARED_RATIO" dial method would work:
-1. New code added to the AST_VDadapt.pl and AST_VDauto_dial.pl(and FILL) scripts that would for agents logged into shared-dialing campaigns, for dialing purposes only, rotate them among the campaigns that they are able to take calls from, while still allowing them to have calls from any of those campaigns sent to them any time they are available.
-2. Change the dialing algorithm, for campaigns with this dial method only, to use a count of calls placed by all shared campaigns on the system as a total, instead of only each campaign. This would prevent over-dialing as agents are rotated from dialing-campaign to dialing-campaign.
+1. New code added to the AST_VDadapt.pl and AST_VDauto_dial.pl(and FILL) scripts that would(for agents logged into shared-dialing campaigns, for dialing purposes only) rotate them among the campaigns that they are able to take calls from, while still allowing them to have calls from any of those campaigns sent to them any time they are available.
+2. Change the dialing algorithm(for campaigns with a "SHARED_" dial method only) to use a count of calls placed by all shared campaigns on the system as a total, instead of only each campaign. This would prevent over-dialing as agents are rotated from dialing-campaign to dialing-campaign.
3. The agent-dialing-campaign-rotation process would attempt to balance agents by time(round-robin-like) across the campaigns that they are assigned to take calls from.
4. New database fields/tables to store the temporary dialing campaign designations for each agent and what other campaigns they had just been assigned to
5. New debug Admin Utilities report that would show everything that is going on for shared campaigns in the process of agent rotation and shared ratio dialing
-Agent rotation steps: (see new database changes below for details on the DB storage of this data)
+Agent rotation steps, added to the AST_VDadapt.pl script: (see new database changes below for details on the DB storage of this data)
- runs once every interval[2.5 sec, 15 sec, 1 minute] <- haven't decided this yet
- for each agent, gather all campaigns they can dial for, and their current dial_campaign
- delete from vicidial_agent_dial_campaigns any campaigns agent is no longer dialing for, update validate_time for others
@@ -143,7 +143,9 @@ Shared campaigns outbound dialing steps:
-DATABASE CHANGES:
+DATABASE CHANGES: !!!!!! FOR DOCUMENTATION PURPOSES ONLY !!!!!
+
+ALTER TABLE system_settings ADD allow_shared_dial ENUM('0','1') default '0';
CREATE TABLE vicidial_agent_dial_campaigns (
campaign_id VARCHAR(8),
@@ -161,4 +163,3 @@ ALTER TABLE vicidial_live_agents ADD dial_campaign_id VARCHAR(8) default '';
ALTER TABLE vicidial_campaigns ADD shared_dial_rank TINYINT(3) default '0';
ALTER TABLE vicidial_campaigns MODIFY dial_method ENUM('MANUAL','RATIO','ADAPT_HARD_LIMIT','ADAPT_TAPERED','ADAPT_AVERAGE','INBOUND_MAN','SHARED_RATIO','SHARED_ADAPT_HARD_LIMIT','SHARED_ADAPT_TAPERED','SHARED_ADAPT_AVERAGE') default 'MANUAL';
-ALTER TABLE system_settings ADD allow_shared_dial ENUM('0','1') default '0';
diff --git a/www/agc/agc_agent_manager_chat_interface.php b/www/agc/agc_agent_manager_chat_interface.php
index f06d1703..2235f07e 100644
--- a/www/agc/agc_agent_manager_chat_interface.php
+++ b/www/agc/agc_agent_manager_chat_interface.php
@@ -171,7 +171,8 @@ asort($chat_managers_array);
asort($chat_reload_id_number_array);
$ChatReloadIDNumber="";
-while (list($key, $id_number) = each($chat_reload_id_number_array)) {
+#while (list($key, $id_number) = each($chat_reload_id_number_array)) {
+foreach($chat_reload_id_number_array as $key => $id_number) {
$ChatReloadIDNumber.="$id_number.";
}
$ChatReloadIDNumber=substr($ChatReloadIDNumber,0,-1);
@@ -738,7 +739,8 @@ echo "
\n";
if (empty($chat_managers_array)) {
echo "\t
"._QXZ("NO OPEN CHATS")."\n";
} else {
- while (list($manager_chat_id, $text) = each($chat_managers_array)) {
+# while (list($manager_chat_id, $text) = each($chat_managers_array)) {
+ foreach($chat_managers_array as $manager_chat_id => $text) {
$manager_chat_subid=$chat_subid_array[$manager_chat_id];
if (!empty($unread_chats_array) && in_array($manager_chat_id, $unread_chats_array)) {$cclass="unreadchat";} else {$cclass="viewedchat";}
echo "\t
Chat #".$manager_chat_id."\n"; # $chat_managers_array[$manager_chat_id]
diff --git a/www/agc/chat_db_query.php b/www/agc/chat_db_query.php
index 741682bf..4d46fbc4 100644
--- a/www/agc/chat_db_query.php
+++ b/www/agc/chat_db_query.php
@@ -231,7 +231,8 @@ if ($action=="CreateAgentToAgentChat" && $agent_manager && $agent_user && $manag
# post message to each user, use $error_msg variable to ensure every insert command worked
$error_msg="";
- while (list($key, $val) = each($participants_array)) {
+# while (list($key, $val) = each($participants_array)) {
+ foreach($participants_array as $key => $val) {
$participant=$val;
$ins_chat_stmt="insert into vicidial_manager_chat_log(manager_chat_id, manager_chat_subid, manager, user, message, message_id, message_date, message_posted_by) VALUES('$manager_chat_id', '$subid', '$agent_manager', '$participant', '".mysqli_real_escape_string($link, $manager_message)."', '$message_id', '$message_date', '$agent_manager')";
$ins_chat_rslt=mysql_to_mysqli($ins_chat_stmt, $link);
@@ -451,7 +452,8 @@ if ($action=="RefreshActiveChatView" && $user) {
#########
asort($chat_reload_id_number_array);
$new_ChatReloadIDNumber="";
- while (list($key, $id_number) = each($chat_reload_id_number_array)) {
+# while (list($key, $id_number) = each($chat_reload_id_number_array)) {
+ foreach ($chat_reload_id_number_array as $key => $id_number) {
$new_ChatReloadIDNumber.="$id_number.";
}
$new_ChatReloadIDNumber=substr($new_ChatReloadIDNumber,0,-1);
@@ -491,7 +493,8 @@ if ($action=="RefreshActiveChatView" && $user) {
if (empty($chat_managers_array)) {
echo "\t
"._QXZ("NO OPEN CHATS")."\n";
} else {
- while (list($manager_chat_id, $text) = each($chat_managers_array)) {
+# while (list($manager_chat_id, $text) = each($chat_managers_array)) {
+ foreach($chat_managers_array as $manager_chat_id => $text) {
$manager_chat_subid=$chat_subid_array[$manager_chat_id];
if (!empty($unread_chats_array) && in_array($manager_chat_id, $unread_chats_array)) {$cclass="unreadchat";} else {$cclass="viewedchat";}
echo "\t
Chat #".$manager_chat_id."\n"; # $chat_managers_array[$manager_chat_id]
@@ -701,7 +704,8 @@ if ($action=="add_agent_to_existing_chat" && $agent_to_add && $manager_chat_id &
# post message to each user, use $error_msg variable to ensure every insert command worked
$error_msg="";
- while (list($key, $val) = each($participants_array)) {
+# while (list($key, $val) = each($participants_array)) {
+ foreach($participants_array as $key => $val) {
$participant=$val;
$ins_chat_stmt="insert into vicidial_manager_chat_log(manager_chat_id, manager_chat_subid, manager, user, message, message_id, message_date, message_posted_by) VALUES('$manager_chat_id', '$manager_chat_subid', '$manager', '$participant', 'Agent $invited has been added to the chat by $invitee', '$message_id', '$message_date', '$message_posted_by')";
$ins_chat_rslt=mysql_to_mysqli($ins_chat_stmt, $link);
@@ -747,7 +751,8 @@ if ($action=="SendMgrChatMessage" && $manager_chat_id && $manager_chat_subid) {
if ($internal_chat_type=="AGENT") {
# post message to each user, use $error_msg variable to ensure every insert command worked.
$error_msg="";
- while (list($key, $val) = each($participants_array)) {
+# while (list($key, $val) = each($participants_array)) {
+ foreach($participants_array as $key => $val) {
$participant=$val;
$ins_chat_stmt="insert into vicidial_manager_chat_log(manager_chat_id, manager_chat_subid, manager, user, message, message_id, message_date, message_posted_by) VALUES('$manager_chat_id', '$manager_chat_subid', '$manager', '$participant', '".mysqli_real_escape_string($link, $chat_message)."', '$message_id', '$message_date', '$user')";
@@ -1324,7 +1329,8 @@ if ($action=="show_live_chats" && $user) {
if ($active_chats) {
echo "
"._QXZ("Live Chats").":";
- while (list($key, $val)=each($active_chats)) {
+# while (list($key, $val)=each($active_chats)) {
+ foreach($active_chats as $key => $val) {
# PREVENT CLICKING ON UNAVAILABLE CHAT ROOMS
if ($val[0][3]!="NONE") {
echo "