Added no-agent-no-queue options for in-groups

Added display of in-group name in Real-time report

git-svn-id: svn://192.168.202.10@1166 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-06-27 10:36:43 +00:00
parent 4e70f47a4b
commit b7e4854049
12 changed files with 602 additions and 81 deletions
+6
View File
@@ -95,6 +95,12 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
prompt by separating them by pipes |. Also, changed the Agent Alert
Extention to a Filename in In-Groups
26. Added a conf_secret field to phones table to be used as sip.conf/iax.conf
password instead of the pass field. Please check that this is set
properly if you are having phone registration issues
27. Added no-agent-no-queueing options to In-Groups to send a call somewhere
else when there is no agent logged in(or active) to the in-group
+167 -11
View File
@@ -94,6 +94,7 @@
# 90115-0601 - Added AGENTDIRECT functionality
# 90607-1717 - Fix for AGENTDIRECT bug under certain configurations
# 90623-0724 - Changed prompts to multi-file prompts, changed agent alert exten to a prompt
# 90627-0546 - Added no-agent-no-queue options
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -460,7 +461,7 @@ $sthA->finish();
### Grab inbound groups values from the database
$cbc=0;
$stmtA = "SELECT call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,drop_call_seconds,drop_action,drop_exten,next_agent_call,voicemail_ext,queue_priority,drop_inbound_group,afterhours_xfer_group,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message FROM vicidial_inbound_groups where group_id = '$channel_group';";
$stmtA = "SELECT call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,drop_call_seconds,drop_action,drop_exten,next_agent_call,voicemail_ext,queue_priority,drop_inbound_group,afterhours_xfer_group,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,no_agent_no_queue,no_agent_action,no_agent_action_value FROM vicidial_inbound_groups where group_id = '$channel_group';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
@@ -504,6 +505,9 @@ while ($sthArows > $cbc)
if ($hold_time_option =~ /DROP_ACTION/)
{$hold_time_option = $drop_action;}
$play_welcome_message = "$aryA[30]";
$no_agent_no_queue = "$aryA[31]";
$no_agent_action = "$aryA[32]";
$no_agent_action_value = "$aryA[33]";
$cbc++;
}
@@ -712,17 +716,17 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
$cbc++;
}
$sthA->finish();
if ($AGILOG) {$agi_string = "-- VDCL vcl insert: |$affected_rows|$insert_lead_id|$insert_close_id|\n|$stmtA|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- AH VDCL vcl insert: |$affected_rows|$insert_lead_id|$insert_close_id|\n|$stmtA|"; &agi_output;}
$stmtA = "UPDATE vicidial_list set status='DROP' where lead_id = '$insert_lead_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02018'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDCL vl update: |$affected_rows|$insert_lead_id|\n|$stmtA|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- AH VDCL vl update: |$affected_rows|$insert_lead_id|\n|$stmtA|"; &agi_output;}
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' and server_ip='$VARserver_ip' order by call_time desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02019'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
if ($AGILOG) {$agi_string = "-- AH VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
if ($after_hours_action =~ /EXTENSION|VOICEMAIL|IN_GROUP/)
{
@@ -743,7 +747,8 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
{ ### if DROP extension is defined then send the dropped call there instead of hangup
if ($no_delay_call_route =~ /N/)
{
$AGI->stream_file('ding'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence');
sleep(1);
}
@@ -791,7 +796,7 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$VARserver_ip','','Hangup','$VHqueryCID','Channel: $channel','','','','','','','','','')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02021'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- VDCL call_hungup after hours: |$VHqueryCID|$VDADconf_exten|$channel|insert to vicidial_manager"; &agi_output;}
if ($AGILOG) {$agi_string = "-- AH VDCL call_hungup after hours: |$VHqueryCID|$VDADconf_exten|$channel|insert to vicidial_manager"; &agi_output;}
}
$dbhA->disconnect();
@@ -803,6 +808,152 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) )
##### BEGIN NO AGENT NO QUEUE CHECK #####
if ($no_agent_no_queue =~ /Y|NO_PAUSED/)
{
$NPsql='';
if ($no_agent_no_queue =~ /NO_PAUSED/)
{$NPsql = "and status NOT IN('PAUSED')";}
$stmtA = "SELECT count(*) FROM vicidial_live_agents where closer_campaigns LIKE \"% $channel_group %\" $NPsql;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02104'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$group_agents_count = "$aryA[0]";
}
$sthA->finish();
if ($group_agents_count < 1)
{
$VHqueryCID = "VA$CIDdate$hour$min$sec$sec";
$stmtA = "INSERT INTO vicidial_closer_log set status='DROP',start_epoch='$now_date_epoch',end_epoch='$now_date_epoch',length_in_sec='1',queue_seconds='0',lead_id = '$insert_lead_id',campaign_id='$channel_group',user='VDCL',list_id='$list_id',call_date='$now_date',phone_code='$phone_code',phone_number='$phone_number',comments='NO AGENT DROP',term_reason='NOAGENT',uniqueid='$uniqueid';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02105'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
$stmtB = "select LAST_INSERT_ID() LIMIT 1;";
$sthA = $dbhA->prepare($stmtB) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtB ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $stmtA=$stmtB; $mysql_count='02017'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$insert_close_id = "$aryA[0]";
$cbc++;
}
$sthA->finish();
if ($AGILOG) {$agi_string = "-- NA VDCL vcl insert: |$affected_rows|$insert_lead_id|$insert_close_id|\n|$stmtA|"; &agi_output;}
$stmtA = "UPDATE vicidial_list set status='DROP' where lead_id = '$insert_lead_id';";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02106'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- NA VDCL vl update: |$affected_rows|$insert_lead_id|\n|$stmtA|"; &agi_output;}
$stmtA = "DELETE FROM vicidial_auto_calls where callerid='$callerid' and server_ip='$VARserver_ip' order by call_time desc limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02107'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- NA VDCL vac record deleted: |$affected_rows| $VDADcampaign|"; &agi_output;}
if ($no_agent_action =~ /CALLMENU|INGROUP|DID|EXTENSION|VOICEMAIL/)
{
if ($no_agent_action =~ /EXTENSION/)
{
if (length($no_agent_action_value) < 3)
{$no_agent_action_value = '8304,default';}
@EXno_agent_action_value = split(/,/,$no_agent_action_value);
$DROPexten = $EXno_agent_action_value[0];
$ext_context = $EXno_agent_action_value[1];
}
if ($no_agent_action =~ /DID/)
{
if (length($no_agent_action_value) < 1)
{$no_agent_action_value = '6666';}
$DROPexten = $no_agent_action_value;
$ext_context = 'trunkinbound';
}
if ($no_agent_action =~ /CALLMENU/)
{
$DROPexten = 's';
$ext_context = $no_agent_action_value;
}
if ($no_agent_action =~ /VOICEMAIL/)
{
$DROPexten = "$voicemail_dump_exten$no_agent_action_value";
}
if ($no_agent_action =~ /INGROUP/)
{ # 90009*CL_uk3survy_*8301*10000123*universal*7275551212*1234*"
if (length($no_agent_action_value) < 10)
{$no_agent_action_value = 'SALESLINE,CID,LB,998,TESTCAMP,1';}
@IGno_agent_action_value = split(/,/,$no_agent_action_value);
$IGgroup_id = $IGno_agent_action_value[0];
$IGhandle_method = $IGno_agent_action_value[1];
$IGsearch_method = $IGno_agent_action_value[2];
$IGlist_id = $IGno_agent_action_value[3];
$IGcampaign_id = $IGno_agent_action_value[4];
$IGphone_code = $IGno_agent_action_value[5];
$S='*';
$DROPexten = "90009*$IGgroup_id$S$S$insert_lead_id$S$S$phone_number$S$fronter$S";
}
if (length($DROPexten)>0)
{ ### if DROP extension is defined then send the dropped call there instead of hangup
if ($no_delay_call_route =~ /N/)
{
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence');
sleep(1);
}
if ($AGILOG) {$agi_string = "exiting the VDAD app after hours, transferring call to $DROPexten"; &agi_output;}
print "SET CONTEXT $ext_context\n";
checkresult($result);
print "SET EXTENSION $DROPexten\n";
checkresult($result);
print "SET PRIORITY 1\n";
checkresult($result);
}
}
if ($no_agent_action =~ /MESSAGE/)
{
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
if ($no_agent_action_value =~ /\|/)
{
@no_agent_action_value_array = split(/\|/,$no_agent_action_value);
$w=0;
foreach(@no_agent_action_value_array)
{
if (length($no_agent_action_value_array[$w])>0)
{
$AGI->stream_file("$no_agent_action_value_array[$w]");
}
$w++;
}
}
else
{$AGI->stream_file("$no_agent_action_value");}
sleep(1);
### insert a NEW record to the vicidial_manager table to hangup the channel
$stmtA = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$VARserver_ip','','Hangup','$VHqueryCID','Channel: $channel','','','','','','','','','')";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='02021'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- NA VDCL call_hungup after hours: |$VHqueryCID|$VDADconf_exten|$channel|insert to vicidial_manager"; &agi_output;}
}
$dbhA->disconnect();
exit;
}
}
##### END NO AGENT NO QUEUE CHECK #####
##### PLAY WELCOME MESSAGE #####
if ( ($welcome_message_filename !~ /---NONE---/) && ( ($play_welcome_message =~ /ALWAYS/) || ( ($no_delay_call_route =~ /N/) && ($play_welcome_message =~ /YES_UNLESS_NODELAY/) ) ) )
@@ -1280,7 +1431,8 @@ if ( ($agent_search_method =~ /^SO|^LO/) && ($skipLOSO < 1) )
if ($no_delay_call_route =~ /N/)
{
$AGI->stream_file('ding'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence');
}
### update calls_today for vicidial_live_inbound_agents ###
@@ -1614,7 +1766,8 @@ if ($agent_search_method =~ /^LO|^LB/)
if ($no_delay_call_route =~ /N/)
{
$AGI->stream_file('ding'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence');
}
### update calls_today for vicidial_live_inbound_agents ###
@@ -1761,7 +1914,8 @@ if ($hold_recall_xfer_group !~ /NONE/)
if ($no_delay_call_route =~ /N/)
{
$AGI->stream_file('ding'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence');
sleep(1);
}
@@ -2213,7 +2367,8 @@ if ($wait_in_queue < 1)
if ($no_delay_call_route =~ /N/)
{
$AGI->stream_file('ding'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence');
sleep(1);
}
@@ -2457,7 +2612,8 @@ if ($AGILOG) {$agi_string = "-- VDCL DROP: |$drop_action|$DROPexten|"; &agi
if ($no_delay_call_route =~ /N/)
{
$AGI->stream_file('ding'); # stop music-on-hold process
$AGI->stream_file('sip-silence'); # stop music-on-hold process
$AGI->stream_file('sip-silence');
sleep(1);
}
+2 -2
View File
@@ -884,11 +884,11 @@ sub process_request
{$VDCLSQL_update = "term_reason='CALLER',";}
else
{
if ( ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT|AFTERHOURS|HOLDRECALLXFER|HOLDTIME/) && ( ($VD_user =~ /VDAD|VDCL/) || (length($VD_user) < 1) ) )
if ( ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT|AFTERHOURS|HOLDRECALLXFER|HOLDTIME|NOAGENT/) && ( ($VD_user =~ /VDAD|VDCL/) || (length($VD_user) < 1) ) )
{$VDCLSQL_term_reason = "term_reason='ABANDON',";}
else
{
if ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT|AFTERHOURS|HOLDRECALLXFER|HOLDTIME/)
if ($VD_term_reason !~ /AGENT|CALLER|QUEUETIMEOUT|AFTERHOURS|HOLDRECALLXFER|HOLDTIME|NOAGENT/)
{$VDCLSQL_term_reason = "term_reason='CALLER',";}
else
{$VDCLSQL_term_reason = '';}
@@ -414,7 +414,7 @@ processed ENUM('Y','N'),
queue_seconds DECIMAL(7,2) default '0',
user_group VARCHAR(20),
xfercallid INT(9) UNSIGNED,
term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','NONE') default 'NONE',
term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','HOLDRECALLXFER','HOLDTIME','NOAGENT','NONE') default 'NONE',
uniqueid VARCHAR(20) NOT NULL default '',
agent_only VARCHAR(20) default '',
index (lead_id),
@@ -778,7 +778,10 @@ no_delay_call_route ENUM('Y','N') default 'N',
play_welcome_message ENUM('ALWAYS','NEVER','IF_WAIT_ONLY','YES_UNLESS_NODELAY') default 'ALWAYS',
answer_sec_pct_rt_stat_one SMALLINT(5) UNSIGNED default '20',
answer_sec_pct_rt_stat_two SMALLINT(5) UNSIGNED default '30',
default_group_alias VARCHAR(30) default ''
default_group_alias VARCHAR(30) default '',
no_agent_no_queue ENUM('N','Y','NO_PAUSED') default 'N',
no_agent_action ENUM('CALLMENU','INGROUP','DID','MESSAGE','EXTENSION','VOICEMAIL') default 'MESSAGE',
no_agent_action_value VARCHAR(255) default 'nbdy-avail-to-take-call|vm-goodbye'
);
CREATE TABLE vicidial_stations (
@@ -1656,7 +1659,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number);
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
CREATE INDEX comment_a on live_inbound_log (comment_a);
UPDATE system_settings SET db_schema_version='1155';
UPDATE system_settings SET db_schema_version='1157';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+9
View File
@@ -195,6 +195,7 @@ ALTER TABLE vicidial_call_menu_options MODIFY option_route_value VARCHAR(255);
UPDATE system_settings SET db_schema_version='1153';
ALTER TABLE phones ADD conf_secret VARCHAR(20) default 'test';
UPDATE phones set conf_secret=pass;
UPDATE system_settings SET db_schema_version='1154';
@@ -209,3 +210,11 @@ ALTER TABLE vicidial_inbound_groups MODIFY hold_time_option_callback_filename VA
ALTER TABLE vicidial_inbound_groups MODIFY agent_alert_exten VARCHAR(100) default 'ding';
UPDATE system_settings SET db_schema_version='1156';
ALTER TABLE vicidial_inbound_groups ADD no_agent_no_queue ENUM('N','Y','NO_PAUSED') default 'N';
ALTER TABLE vicidial_inbound_groups ADD no_agent_action ENUM('CALLMENU','INGROUP','DID','MESSAGE','EXTENSION','VOICEMAIL') default 'MESSAGE';
ALTER TABLE vicidial_inbound_groups ADD no_agent_action_value VARCHAR(255) default 'nbdy-avail-to-take-call|vm-goodbye';
ALTER TABLE vicidial_closer_log MODIFY term_reason ENUM('CALLER','AGENT','QUEUETIMEOUT','ABANDON','AFTERHOURS','HOLDRECALLXFER','HOLDTIME','NOAGENT','NONE') default 'NONE';
UPDATE system_settings SET db_schema_version='1157';
Binary file not shown.
@@ -180,6 +180,12 @@ This is the ID that you can use to track calls to this Call Menu when looking at
Agent Alert Filename||
The audio file to play to an agent to announce that a call is coming to the agent. To not use this function set this to X. Default is ding||
This field as with the other audio fields in In-Groups, with the exception of the Agent Alert Filename, can have multiple audio files played if you put a pipe-separated list of audio files into the field||
No Agents No Queueing||
If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N||
No Agent No Queue Action||
If No Agent No Queue is enabled, then this field defines where the call will go if there are no agents in the In-Group. Default is MESSAGE, this plays the sound files in the Action Value field and then hangs up||
No Agent No Queue Action Value||
This is the value for the Action above. Default is||
add-file: user_territories.php
@@ -51,10 +51,11 @@
# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
# 90602-0405 - Added list mix display in statuses and order if active
# 90603-1845 - Fixed color coding bug
# 90627-0608 - Some Formatting changes, added in-group name display
#
$version = '2.0.5-42';
$build = '90603-1845';
$version = '2.0.5-43';
$build = '90627-0608';
header ("Content-type: text/html; charset=utf-8");
@@ -132,9 +133,9 @@ if (!isset($RR)) {$RR=40;}
if (!isset($group)) {$group='';}
if (!isset($usergroup)) {$usergroup='';}
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
if (!isset($UidORname)) {$UidORname=0;} # 0=id, 1=name
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
if (!isset($orderby)) {$orderby='timeup';}
if (!isset($SERVdisplay)) {$SERVdisplay=1;} # 0=no, 1=yes
if (!isset($SERVdisplay)) {$SERVdisplay=0;} # 0=no, 1=yes
if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes
if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes
if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes
@@ -151,42 +152,51 @@ $ingroup_detail='';
if (strlen($group)>1) {$groups[0] = $group; $RR=40;}
else {$group = $groups[0];}
function get_server_load($windows = false) {
$os = strtolower(PHP_OS);
if(strpos($os, "win") === false) {
if(file_exists("/proc/loadavg")) {
$load = file_get_contents("/proc/loadavg");
$load = explode(' ', $load);
return $load[0];
}
elseif(function_exists("shell_exec")) {
$load = explode(' ', `uptime`);
return $load[count($load)-1];
}
else {
return false;
}
}
elseif($windows) {
if(class_exists("COM")) {
$wmi = new COM("WinMgmts:\\\\.");
$cpus = $wmi->InstancesOf("Win32_Processor");
function get_server_load($windows = false)
{
$os = strtolower(PHP_OS);
if(strpos($os, "win") === false)
{
if(file_exists("/proc/loadavg"))
{
$load = file_get_contents("/proc/loadavg");
$load = explode(' ', $load);
return $load[0];
}
elseif(function_exists("shell_exec"))
{
$load = explode(' ', `uptime`);
return $load[count($load)-1];
}
else
{
return false;
}
}
elseif($windows)
{
if(class_exists("COM"))
{
$wmi = new COM("WinMgmts:\\\\.");
$cpus = $wmi->InstancesOf("Win32_Processor");
$cpuload = 0;
$i = 0;
while ($cpu = $cpus->Next()) {
$cpuload += $cpu->LoadPercentage;
$i++;
}
$cpuload = 0;
$i = 0;
while ($cpu = $cpus->Next())
{
$cpuload += $cpu->LoadPercentage;
$i++;
}
$cpuload = round($cpuload / $i, 2);
return "$cpuload%";
}
else {
return false;
}
}
}
$cpuload = round($cpuload / $i, 2);
return "$cpuload%";
}
else
{
return false;
}
}
}
$load_ave = get_server_load(true);
@@ -1296,6 +1306,8 @@ $HDcalls = "-------+";
$HTcalls = " CALLS |";
$HDpause = '';
$HTpause = '';
$HDigcall = "------+------------------";
$HTigcall = " HOLD | IN-GROUP ";
if (!ereg("N",$agent_pause_codes_active))
{
@@ -1339,8 +1351,8 @@ if ($SERVdisplay < 1)
$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls\n";
$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls\n";
$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n";
$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n";
$Aecho .= "$Aline";
$Aecho .= "$Bline";
$Aecho .= "$Aline";
@@ -1695,19 +1707,19 @@ $calls_to_list = mysql_num_rows($rslt);
$INGRP='';
if ($CM == 'I')
{
$stmt="select campaign_id,stage from vicidial_auto_calls where callerid='$Acallerid[$i]' LIMIT 1;";
$stmt="select vac.campaign_id,vac.stage,vig.group_name from vicidial_auto_calls vac,vicidial_inbound_groups vig where vac.callerid='$Acallerid[$i]' and vac.campaign_id=vig.group_id LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$ingrp_to_print = mysql_num_rows($rslt);
if ($ingrp_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$vac_campaign = sprintf("%-20s", $row[0]);
$vac_campaign = sprintf("%-20s", "$row[0] - $row[2]");
$row[1] = eregi_replace(".*-",'',$row[1]);
$vac_stage = sprintf("%-4s", $row[1]);
}
$INGRP = " $G$vac_stage$EG $G$vac_campaign$EG ";
$INGRP = " $G$vac_stage$EG | $G$vac_campaign$EG ";
}
$agentcount++;
+140 -5
View File
@@ -1044,6 +1044,12 @@ if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];}
elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];}
if (isset($_GET["tracking_group"])) {$tracking_group=$_GET["tracking_group"];}
elseif (isset($_POST["tracking_group"])) {$tracking_group=$_POST["tracking_group"];}
if (isset($_GET["no_agent_no_queue"])) {$no_agent_no_queue=$_GET["no_agent_no_queue"];}
elseif (isset($_POST["no_agent_no_queue"])) {$no_agent_no_queue=$_POST["no_agent_no_queue"];}
if (isset($_GET["no_agent_action"])) {$no_agent_action=$_GET["no_agent_action"];}
elseif (isset($_POST["no_agent_action"])) {$no_agent_action=$_POST["no_agent_action"];}
if (isset($_GET["no_agent_action_value"])) {$no_agent_action_value=$_GET["no_agent_action_value"];}
elseif (isset($_POST["no_agent_action_value"])) {$no_agent_action_value=$_POST["no_agent_action_value"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
@@ -1472,6 +1478,9 @@ if ($non_latin < 1)
$phone_context = ereg_replace("[^-_0-9a-zA-Z]","",$phone_context);
$conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret);
$tracking_group = ereg_replace("[^-_0-9a-zA-Z]","",$tracking_group);
$no_agent_no_queue = ereg_replace("[^-_0-9a-zA-Z]","",$no_agent_no_queue);
$no_agent_action = ereg_replace("[^-_0-9a-zA-Z]","",$no_agent_action);
### ALPHA-NUMERIC and underscore and dash and slash and dot
$menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt);
@@ -1560,6 +1569,9 @@ if ($non_latin < 1)
$vtiger_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_login);
$vtiger_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$vtiger_pass);
### value cleaning
$no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value);
### ALPHA-NUMERIC and underscore and dash and slash and at and space and colon
$vdc_header_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_header_date_format);
$vdc_customer_date_format = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vdc_customer_date_format);
@@ -1819,11 +1831,12 @@ else
# 90617-0733 - Added phone ring timeout and call menu custom dialplan entries
# 90621-0821 - Added phon Conf File Secret field to use a separate password from the user interface for a phone
# 90621-1220 - Added Call Menu logging tracking_group
# 90627-0547 - Added no-agent-no-queue 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.2.0-199';
$build = '90621-1220';
$admin_version = '2.2.0-200';
$build = '90627-0547';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -3833,6 +3846,21 @@ if ($SSqc_features_active > 0)
<BR>
<B>After Hours Transfer Group -</B> If After Hours Action is set to IN_GROUP, the call will be sent to this inbound group if it enters the in-group outside of the call time scheme defined for the in-group.
<BR>
<A NAME="vicidial_inbound_groups-no_agent_no_queue">
<BR>
<B>No Agents No Queueing -</B> If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N.
<BR>
<A NAME="vicidial_inbound_groups-no_agent_action">
<BR>
<B>No Agent No Queue Action -</B> If No Agent No Queue is enabled, then this field defines where the call will go if there are no agents in the In-Group. Default is MESSAGE, this plays the sound files in the Action Value field and then hangs up.
<BR>
<A NAME="vicidial_inbound_groups-no_agent_action_value">
<BR>
<B>No Agent No Queue Action Value -</B> This is the value for the Action above. Default is nbdy-avail-to-take-call|vm-goodbye.
<BR>
<A NAME="vicidial_inbound_groups-welcome_message_filename">
<BR>
@@ -8346,7 +8374,7 @@ if ($ADD==2011)
}
else
{
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias from vicidial_inbound_groups where group_id=\"$source_group_id\";";
$stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value from vicidial_inbound_groups where group_id=\"$source_group_id\";";
$rslt=mysql_query($stmt, $link);
echo "<br><B>GROUP ADDED: $group_id</B>\n";
@@ -11159,9 +11187,40 @@ if ($ADD==4111)
if (strlen($QC_statuses)>0) {$QC_statuses .= " -";}
if (strlen($QC_lists)>0) {$QC_lists .= " -";}
if ($no_agent_action == "INGROUP")
{
if (isset($_GET["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_GET["IGgroup_id_no_agent_action"];}
elseif (isset($_POST["IGgroup_id_no_agent_action"])) {$IGgroup_id=$_POST["IGgroup_id_no_agent_action"];}
if (isset($_GET["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_GET["IGhandle_method_no_agent_action"];}
elseif (isset($_POST["IGhandle_method_no_agent_action"])) {$IGhandle_method=$_POST["IGhandle_method_no_agent_action"];}
if (isset($_GET["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_GET["IGsearch_method_no_agent_action"];}
elseif (isset($_POST["IGsearch_method_no_agent_action"])) {$IGsearch_method=$_POST["IGsearch_method_no_agent_action"];}
if (isset($_GET["IGlist_id_no_agent_action"])) {$IGlist_id=$_GET["IGlist_id_no_agent_action"];}
elseif (isset($_POST["IGlist_id_no_agent_action"])) {$IGlist_id=$_POST["IGlist_id_no_agent_action"];}
if (isset($_GET["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_GET["IGcampaign_id_no_agent_action"];}
elseif (isset($_POST["IGcampaign_id_no_agent_action"])) {$IGcampaign_id=$_POST["IGcampaign_id_no_agent_action"];}
if (isset($_GET["IGphone_code_no_agent_action"])) {$IGphone_code=$_GET["IGphone_code_no_agent_action"];}
elseif (isset($_POST["IGphone_code_no_agent_action"])) {$IGphone_code=$_POST["IGphone_code_no_agent_action"];}
$no_agent_action_value = "$IGgroup_id,$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code";
}
if ($no_agent_action == "EXTENSION")
{
if (isset($_GET["EXextension_no_agent_action"])) {$EXextension=$_GET["EXextension_no_agent_action"];}
elseif (isset($_POST["EXextension_no_agent_action"])) {$EXextension=$_POST["EXextension_no_agent_action"];}
if (isset($_GET["EXcontext_no_agent_action"])) {$EXcontext=$_GET["EXcontext_no_agent_action"];}
elseif (isset($_POST["EXcontext_no_agent_action"])) {$EXcontext=$_POST["EXcontext_no_agent_action"];}
$no_agent_action_value = "$EXextension,$EXcontext";
}
$no_agent_action_value = ereg_replace("[^-\/\|\_\#\*\,\.\_0-9a-zA-Z]","",$no_agent_action_value);
echo "<br><B>GROUP MODIFIED: $group_id</B>\n";
$stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias' where group_id='$group_id';";
$stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value' where group_id='$group_id';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
@@ -17346,7 +17405,9 @@ if ($ADD==3111)
$answer_sec_pct_rt_stat_one = $row[53];
$answer_sec_pct_rt_stat_two = $row[54];
$default_group_alias = $row[55];
$no_agent_no_queue = $row[56];
$no_agent_action = $row[57];
$no_agent_action_value = $row[58];
##### get in-groups listings for dynamic pulldown
$stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id";
@@ -17499,6 +17560,80 @@ if ($ADD==3111)
echo "$Agroups_menu";
echo "</select>$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>No Agents No Queueing: </td><td align=left><select size=1 name=no_agent_no_queue><option>Y</option><option>N</option><option>NO_PAUSED</option><option SELECTED>$no_agent_no_queue</option></select>$NWB#vicidial_inbound_groups-no_agent_no_queue$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>No Agent No Queue Action: </td><td align=left><select size=1 name=no_agent_action id=no_agent_action onChange=\"dynamic_call_action('no_agent_action','$no_agent_action','$no_agent_action_value','600');\"><option>CALLMENU</option><option>INGROUP</option><option>DID</option><option>MESSAGE</option><option>EXTENSION</option><option>VOICEMAIL</option><option SELECTED>$no_agent_action</option></select>$NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>";
echo "<span id=\"no_agent_action_value_span\" name=\"no_agent_action_value_span\">\n";
if ($no_agent_action=='CALLMENU')
{
echo "<span name=no_agent_action_value_link id=no_agent_action_value_link>";
echo "<a href=\"$PHP_SELF?ADD=3511&menu_id=$no_agent_action_value\">Call Menu:</a>";
echo "</span>";
echo " <select size=1 name=no_agent_action_value id=no_agent_action_value onChange=\"dynamic_call_action_link('no_agent_action','CALLMENU');\">$call_menu_list<option SELECTED>$no_agent_action_value</option></select>\n";
}
if ($no_agent_action=='INGROUP')
{
if (strlen($no_agent_action_value) < 10)
{$no_agent_action_value = 'SALESLINE,CID,LB,998,TESTCAMP,1';}
$IGno_agent_action_value = explode(",",$no_agent_action_value);
$IGgroup_id = $IGno_agent_action_value[0];
$IGhandle_method = $IGno_agent_action_value[1];
$IGsearch_method = $IGno_agent_action_value[2];
$IGlist_id = $IGno_agent_action_value[3];
$IGcampaign_id = $IGno_agent_action_value[4];
$IGphone_code = $IGno_agent_action_value[5];
echo "<span name=no_agent_action_value_link id=no_agent_action_value_link>";
echo "<a href=\"$PHP_SELF?ADD=3111&group_id=$IGgroup_id\">In-Group:</a>";
echo "</span>";
echo " <select size=1 name=IGgroup_id_no_agent_action id=IGgroup_id_no_agent_action onChange=\"dynamic_call_action_link('IGgroup_id_no_agent_action','INGROUP');\">";
echo "$ingroup_list<option SELECTED>$IGgroup_id</option></select>";
echo " &nbsp; Handle Method: <select size=1 name=IGhandle_method_$j id=IGhandle_method_$j>";
echo "$IGhandle_method_list<option SELECTED>$IGhandle_method</option></select>\n";
echo "<BR>Search Method: <select size=1 name=IGsearch_method_$j id=IGsearch_method_$j>";
echo "$IGsearch_method_list<option SELECTED>$IGsearch_method</option></select>\n";
echo " &nbsp; List ID: <input type=text size=5 maxlength=14 name=IGlist_id_$j id=IGlist_id_$j value=\"$IGlist_id\">";
echo "<BR>Campaign ID: <select size=1 name=IGcampaign_id_$j id=IGcampaign_id_$j>";
echo "$IGcampaign_id_list<option SELECTED>$IGcampaign_id</option></select>\n";
echo " &nbsp; Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_$j id=IGphone_code_$j value=\"$IGphone_code\">";
}
if ($no_agent_action=='DID')
{
$stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$no_agent_action_value';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$did_id = $row[0];
echo "<span name=no_agent_action_value_link id=no_agent_action_value_link>";
echo "<a href=\"$PHP_SELF?ADD=3311&did_id=$did_id\">DID:</a>";
echo "</span>";
echo " <select size=1 name=no_agent_action_value id=no_agent_action_value onChange=\"dynamic_call_action_link('no_agent_action','DID');\">$did_list<option SELECTED>$no_agent_action_value</option></select>\n";
}
if ($no_agent_action=='MESSAGE')
{
if (strlen($no_agent_action_value) < 3)
{$no_agent_action_value = 'nbdy-avail-to-take-call|vm-goodbye';}
echo "Audio File: <input type=text name=no_agent_action_value id=no_agent_action_value size=50 maxlength=255 value=\"$no_agent_action_value\"> <a href=\"javascript:launch_chooser('no_agent_action_value','date',$choose_height);\">audio chooser</a>\n";
}
if ($no_agent_action=='EXTENSION')
{
if (strlen($no_agent_action_value) < 3)
{$no_agent_action_value = '8304,default';}
$EXno_agent_action_value = explode(",",$no_agent_action_value);
$EXextension = $EXno_agent_action_value[0];
$EXcontext = $EXno_agent_action_value[1];
echo "Extension: <input type=text name=EXextension_no_agent_action id=EXextension_no_agent_action size=20 maxlength=255 value=\"$EXextension\"> &nbsp; Context: <input type=text name=EXcontext_no_agent_action id=EXcontext_no_agent_action size=20 maxlength=255 value=\"$EXcontext\">\n";
}
if ($no_agent_action=='VOICEMAIL')
{
echo "Voicemail Box: <input type=text name=no_agent_action_value id=no_agent_action_value size=20 maxlength=255 value=\"$no_agent_action_value\">\n";
}
echo "</span>
<BR> &nbsp; </td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Welcome Message Filename: </td><td align=left><input type=text name=welcome_message_filename id=welcome_message_filename size=50 maxlength=255 value=\"$welcome_message_filename\"> <a href=\"javascript:launch_chooser('welcome_message_filename','date',500);\">audio chooser</a> $NWB#vicidial_inbound_groups-welcome_message_filename$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Play Welcome Message: </td><td align=left><select size=1 name=play_welcome_message><option>ALWAYS</option><option>NEVER</option><option>IF_WAIT_ONLY</option><option>YES_UNLESS_NODELAY</option><option SELECTED>$play_welcome_message</option></select>$NWB#vicidial_inbound_groups-play_welcome_message$NWE</td></tr>\n";
+156 -13
View File
@@ -11,6 +11,8 @@
# 90530-1206 - Changed List Mix to allow for 40 mixes and a default populate option
# 90531-2339 - Added Dynamic options for Call Menu
# 90612-0852 - Changed relative links
# 90635-0943 - Added javascript for dynamic menus in In-Groups
# 90627-0548 - Added no-agent-no-queue options
#
@@ -383,10 +385,10 @@ else
{
var audiolistURL = "./non_agent_api.php";
var audiolistQuery = "source=admin&function=sounds_list&user=" + user + "&pass=" + pass + "&format=selectframe&stage=" + stage + "&comments=" + fieldname;
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:660;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="660" height="460" STYLE="z-index:2"> </iframe>';
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </iframe>';
document.getElementById("audio_chooser_span").style.position = "absolute";
document.getElementById("audio_chooser_span").style.left = "250px";
document.getElementById("audio_chooser_span").style.left = "220px";
document.getElementById("audio_chooser_span").style.top = vposition + "px";
document.getElementById("audio_chooser_span").style.visibility = 'visible';
document.getElementById("audio_chooser_span").innerHTML = Iframe_content;
@@ -486,8 +488,8 @@ if ( ($ADD==131111111) or ($ADD==331111111) or ($ADD==431111111) )
}
### Javascript for dynamic call menu option value/context entries
if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) )
### select list contents generation for dynamic route displays in call menu and in-group screens
if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) or ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) )
{
$stmt="select menu_id,menu_name from vicidial_call_menu;";
$rslt=mysql_query($stmt, $link);
@@ -552,6 +554,11 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511
$phone_list .= "<option value=\"$row[0]\">$row[0] - $row[1] - $row[2] - $row[3]</option>";
$i++;
}
}
# dynamic options for options in call_menu screen
if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) )
{
?>
function call_menu_option(option,route,value,value_context,chooser_height)
@@ -577,7 +584,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511
{
selected_value = '<option SELECTED value="' + value + '">' + value + "</option>\n";
}
new_content = 'Call Menu: <select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + '>' + call_menu_list + "\n" + selected_value + '</select>';
new_content = '<span name=option_route_value_' + option + 'id=option_route_value_' + option + '><a href="./admin.php?ADD=3511&menu_id=' + value + ">Call Menu: </a></span><select size=1 name=option_route_value_' + option + ' id=option_route_value_' + option + + " onChange=\"call_menu_link('" + option + "','CALLMENU');\">" + call_menu_list + "\n" + selected_value + '</select>';
}
if (selected_route=='INGROUP')
{
@@ -664,14 +671,6 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511
span_to_update.innerHTML = new_content;
}
<?php
}
### Javascript for dynamic call menu option value/context entries
if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511) )
{
?>
function call_menu_link(option,route)
{
var selected_value = '';
@@ -702,6 +701,150 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511
<?php
}
### Javascript for dynamic in-group option value entries
if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111) )
{
?>
function dynamic_call_action(option,route,value,chooser_height)
{
var call_menu_list = '<?php echo $call_menu_list ?>';
var ingroup_list = '<?php echo $ingroup_list ?>';
var IGcampaign_id_list = '<?php echo $IGcampaign_id_list ?>';
var IGhandle_method_list = '<?php echo $IGhandle_method_list ?>';
var IGsearch_method_list = '<?php echo $IGsearch_method_list ?>';
var did_list = '<?php echo $did_list ?>';
var selected_value = '';
var selected_context = '';
var new_content = '';
var select_list = document.getElementById(option + "");
var selected_route = select_list.value;
var span_to_update = document.getElementById(option + "_value_span");
if (selected_route=='CALLMENU')
{
if (route == selected_route)
{
selected_value = '<option SELECTED value="' + value + '">' + value + "</option>\n";
}
else
{value = '';}
new_content = '<span name=' + option + '_value_link id=' + option + '_value_link><a href="./admin.php?ADD=3511&menu_id=' + value + '">Call Menu: </a></span><select size=1 name=' + option + '_value id=' + option + "_value onChange=\"dynamic_call_action_link('" + option + "','CALLMENU');\">" + call_menu_list + "\n" + selected_value + '</select>';
}
if (selected_route=='INGROUP')
{
if ( (route != selected_route) || (value.length < 10) )
{value = 'SALESLINE,CID,LB,998,TESTCAMP,1';}
var value_split = value.split(",");
var IGgroup_id = value_split[0];
var IGhandle_method = value_split[1];
var IGsearch_method = value_split[2];
var IGlist_id = value_split[3];
var IGcampaign_id = value_split[4];
var IGphone_code = value_split[5];
if (route == selected_route)
{
selected_value = '<option SELECTED>' + IGgroup_id + '</option>';
}
new_content = new_content + '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3111&group_id=' + IGgroup_id + '">In-Group:</a> </span> ';
new_content = new_content + '<select size=1 name=IGgroup_id_' + option + ' id=IGgroup_id_' + option + " onChange=\"dynamic_call_action_link('IGgroup_id_" + option + "','INGROUP');\">";
new_content = new_content + '' + ingroup_list + "\n" + selected_value + '</select>';
new_content = new_content + ' &nbsp; Handle Method: <select size=1 name=IGhandle_method_' + option + ' id=IGhandle_method_' + option + '>';
new_content = new_content + '' + IGhandle_method_list + "\n" + '<option SELECTED>' + IGhandle_method + '</select>';
new_content = new_content + '<BR>Search Method: <select size=1 name=IGsearch_method_' + option + ' id=IGsearch_method_' + option + '>';
new_content = new_content + '' + IGsearch_method_list + "\n" + '<option SELECTED>' + IGsearch_method + '</select>';
new_content = new_content + ' &nbsp; List ID: <input type=text size=5 maxlength=14 name=IGlist_id_' + option + ' id=IGlist_id_' + option + ' value="' + IGlist_id + '">';
new_content = new_content + '<BR>Campaign ID: <select size=1 name=IGcampaign_id_' + option + ' id=IGcampaign_id_' + option + '>';
new_content = new_content + '' + IGcampaign_id_list + "\n" + '<option SELECTED>' + IGcampaign_id + '</select>';
new_content = new_content + ' &nbsp; Phone Code: <input type=text size=5 maxlength=14 name=IGphone_code_' + option + ' id=IGphone_code_' + option + ' value="' + IGphone_code + '">';
}
if (selected_route=='DID')
{
if (route == selected_route)
{
selected_value = '<option SELECTED value="' + value + '">' + value + "</option>\n";
}
else
{value = '';}
new_content = '<span name=' + option + '_value_link id=' + option + '_value_link><a href="admin.php?ADD=3311&did_pattern=' + value + '">DID:</a> </span><select size=1 name=' + option + '_value id=' + option + "_value onChange=\"dynamic_call_action_link('" + option + "','DID');\">" + did_list + "\n" + selected_value + '</select>';
}
if (selected_route=='MESSAGE')
{
if (route == selected_route)
{
selected_value = value;
}
else
{value = 'nbdy-avail-to-take-call|vm-goodbye';}
new_content = "Audio File: <input type=text name=" + option + "_value id=" + option + "_value size=40 maxlength=255 value=\"" + value + "\"> <a href=\"javascript:launch_chooser('" + option + "_value','date'," + chooser_height + ");\">audio chooser</a>";
}
if (selected_route=='EXTENSION')
{
if ( (route != selected_route) || (value.length < 3) )
{value = '8304,default';}
var value_split = value.split(",");
var EXextension = value_split[0];
var EXcontext = value_split[1];
new_content = "Extension: <input type=text name=EXextension_" + option + " id=EXextension_" + option + " size=20 maxlength=255 value=\"" + EXextension + "\"> &nbsp; Context: <input type=text name=EXcontext_" + option + " id=EXcontext_" + option + " size=20 maxlength=255 value=\"" + EXcontext + "\"> ";
}
if (selected_route=='VOICEMAIL')
{
if (route == selected_route)
{
selected_value = value;
}
else
{value = '101';}
new_content = "Voicemail Box: <input type=text name=" + option + "_value id=" + option + "_value size=20 maxlength=255 value=\"" + value + "\"> ";
}
if (new_content.length < 1)
{new_content = selected_route}
span_to_update.innerHTML = new_content;
}
function dynamic_call_action_link(field,route)
{
var selected_value = '';
var new_content = '';
if ( (route=='CALLMENU') || (route=='DID') )
{var select_list = document.getElementById(field + "_value");}
if (route=='INGROUP')
{
var select_list = document.getElementById(field + "");
field = field.replace(/IGgroup_id_/, "");
}
var selected_value = select_list.value;
var span_to_update = document.getElementById(field + "_value_link");
if (route=='CALLMENU')
{
new_content = '<a href="admin.php?ADD=3511&menu_id=' + selected_value + '">Call Menu:</a>';
}
if (route=='INGROUP')
{
new_content = '<a href="admin.php?ADD=3111&group_id=' + selected_value + '">In-Group:</a>';
}
if (route=='DID')
{
new_content = '<a href="admin.php?ADD=3311&did_pattern=' + selected_value + '">DID:</a>';
}
if (new_content.length < 1)
{new_content = selected_route}
span_to_update.innerHTML = new_content;
}
<?php
}
echo "</script>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
+2 -2
View File
@@ -409,8 +409,8 @@ if ($function == 'sounds_list')
echo "<body>\n";
echo "<a href=\"javascript:close_file();\"><font size=1 face=\"Arial,Helvetica\">close frame</font></a>\n";
echo "<div id='selectframe' style=\"height:400px;width:620px;overflow:scroll;\">\n";
echo "<table border=0 cellpadding=1 cellspacing=2 width=600 bgcolor=white><tr>\n";
echo "<div id='selectframe' style=\"height:400px;width:710px;overflow:scroll;\">\n";
echo "<table border=0 cellpadding=1 cellspacing=2 width=690 bgcolor=white><tr>\n";
echo "<td>#</td>\n";
echo "<td><a href=\"$PHP_SELF?source=admin&function=sounds_list&user=$user&pass=$pass&format=selectframe&comments=$comments&stage=name\"><font color=black>FILENAME</td>\n";
echo "<td><a href=\"$PHP_SELF?source=admin&function=sounds_list&user=$user&pass=$pass&format=selectframe&comments=$comments&stage=date\"><font color=black>DATE</td>\n";
@@ -402,15 +402,66 @@ if ( ($action == "PROCESS_CHANGE_TERRITORY_OWNER") and ($enable_vtiger_integrati
$row=mysql_fetch_row($rsltV);
$user_id = $row[0];
$stmtV="SELECT accountid from vtiger_account where tickersymbol='$territory';";
$rsltV=mysql_query($stmtV, $linkV);
if ($DB) {echo "$stmtV\n";}
$vat_ct = mysql_num_rows($rsltV);
$account_ids[0]='';
$p=0;
while ($vat_ct > $p)
{
$row=mysql_fetch_row($rsltV);
$account_ids[$p] = $row[0];
$p++;
}
$p=0;
while ($vat_ct > $p)
{
$stmt="UPDATE vtiger_crmentity SET smownerid='$user_id',smcreatorid='$user_id',modifiedby='$user_id' where crmid='$account_ids[$p]';";
$rsltV=mysql_query($stmt, $linkV);
$changedX = mysql_affected_rows($linkV);
if ($DB) {echo "$stmt|$changedX\n";}
$changed = ($changed + $changedX);
$stmtV="select activityid from vtiger_seactivityrel where crmid='$account_ids[$p]';";
$rsltV=mysql_query($stmtV, $linkV);
if ($DB) {echo "$stmtV\n";}
$vact_ct = mysql_num_rows($rsltV);
$activity_ids[0]='';
$r=0;
while ($vact_ct > $r)
{
$row=mysql_fetch_row($rsltV);
$activity_ids[$r] = $row[0];
$r++;
}
$r=0;
while ($vact_ct > $r)
{
$stmt="UPDATE vtiger_crmentity SET smownerid='$user_id' where crmid='$activity_ids[$r]';";
$rsltV=mysql_query($stmt, $linkV);
$AchangedX = mysql_affected_rows($linkV);
if ($DB) {echo "$stmt|$AchangedX\n";}
$Achanged = ($Achanged + $AchangedX);
$r++;
}
$p++;
}
$stmt="UPDATE vtiger_crmentity SET smownerid='$user_id',smcreatorid='$user_id',modifiedby='$user_id' where crmid IN(SELECT accountid from vtiger_account where tickersymbol='$territory');";
$rsltV=mysql_query($stmt, $linkV);
$changed = mysql_affected_rows($linkV);
$Cchanged = mysql_affected_rows($linkV);
if ($DB) {echo "$stmt|$Cchanged\n";}
$stmtB="UPDATE vtiger_tracker vt, vtiger_account va SET user_id='$user_id' where vt.item_id=va.accountid and va.tickersymbol='$territory';";
$rsltV=mysql_query($stmtB, $linkV);
echo "Vtiger Territory Owner Changed: $user $territory &nbsp; &nbsp; &nbsp; Records Changed: $changed<BR>\n";
echo "Vtiger Territory Owner Changed: $user $territory &nbsp; &nbsp; &nbsp; Records Changed: $changed - $Achanged - $Cchanged<BR>\n";
### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtB|";