From b7e48540491d5eb3456fadb957951821712411f2 Mon Sep 17 00:00:00 2001 From: mattf Date: Sat, 27 Jun 2009 10:36:43 +0000 Subject: [PATCH] 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 --- agc_2-X/trunk/UPGRADE | 6 + agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 178 ++++++++++++++++-- agc_2-X/trunk/bin/FastAGI_log.pl | 4 +- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 9 +- agc_2-X/trunk/extras/upgrade_2.2.0.sql | 9 + .../trunk/sounds/nbdy-avail-to-take-call.gsm | Bin 0 -> 4620 bytes .../TO_BE_TRANSLATED_2.2.0.txt | 6 + .../trunk/www/vicidial/AST_timeonVDADall.php | 98 +++++----- agc_2-X/trunk/www/vicidial/admin.php | 145 +++++++++++++- agc_2-X/trunk/www/vicidial/admin_header.php | 169 +++++++++++++++-- agc_2-X/trunk/www/vicidial/non_agent_api.php | 4 +- .../trunk/www/vicidial/user_territories.php | 55 +++++- 12 files changed, 602 insertions(+), 81 deletions(-) create mode 100644 agc_2-X/trunk/sounds/nbdy-avail-to-take-call.gsm diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 8709afd7..d62308d3 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -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 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 2ed6d7c2..323f62d1 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -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); } diff --git a/agc_2-X/trunk/bin/FastAGI_log.pl b/agc_2-X/trunk/bin/FastAGI_log.pl index 5bef71f4..8ed49845 100644 --- a/agc_2-X/trunk/bin/FastAGI_log.pl +++ b/agc_2-X/trunk/bin/FastAGI_log.pl @@ -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 = '';} 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 de7afc46..716bb063 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -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; diff --git a/agc_2-X/trunk/extras/upgrade_2.2.0.sql b/agc_2-X/trunk/extras/upgrade_2.2.0.sql index f349a91d..0051ac4e 100644 --- a/agc_2-X/trunk/extras/upgrade_2.2.0.sql +++ b/agc_2-X/trunk/extras/upgrade_2.2.0.sql @@ -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'; diff --git a/agc_2-X/trunk/sounds/nbdy-avail-to-take-call.gsm b/agc_2-X/trunk/sounds/nbdy-avail-to-take-call.gsm new file mode 100644 index 0000000000000000000000000000000000000000..f88611096b2e1ff5ff995c8cd1f0e7ecc45bfc1e GIT binary patch literal 4620 zcmWNVc~FxF*ToS^Ypty7>blr zg^F-J7kDW`9jE64Fffq%SRXkJAzw5NQN#u7A>}1K5al2SpkaU{J!ez;xO#GRXKMl` z+hkfW7*HQIeGHz2!UMEZrjJ-iEdvA8W+N3P6YxcNR&{07j!*NIZ|fn|sX}@0jxcZl zndPgdj*;gMlPuzXT}3ELF_4)-jA`l^WR~SqLq7$1wR4x@Pnz9U@J+(99m|6L(M7G+ zE9NRWVJxnHx{DJb_5tLUt7=v#sXQFLx|nnH3IvCGp!%k}x?PWH%k>9vv14`=q-IvD zps-uBwb9+V#rUC1Q?HG5VIBmVD~pEBL;@^pDR)+=MP`Cxmnx|^OX2%h@|@wj${RQ0!4}4g&x+9MAlk>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&AtwcjQ0yR_Ea(nq=>eAP-Jo~|%16p@ aF=auK>Qap9{aDNn>Vdz6MyOKzfd2=ifjs#D literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt index 83e81b47..88e5fd44 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt @@ -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 diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index 16a90343..47ed04dd 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.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++; diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index c2c8c026..3ee5706f 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -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)
After Hours Transfer Group - 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. +
+ +
+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 nbdy-avail-to-take-call|vm-goodbye. +

@@ -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 "
GROUP ADDED: $group_id\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 "
GROUP MODIFIED: $group_id\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 "$NWB#vicidial_inbound_groups-afterhours_xfer_group$NWE\n"; + echo "No Agents No Queueing: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; + + echo "No Agent No Queue Action: $NWB#vicidial_inbound_groups-no_agent_no_queue$NWE\n"; + + echo ""; + echo "\n"; + + if ($no_agent_action=='CALLMENU') + { + echo ""; + echo "
Call Menu:"; + echo ""; + echo " \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 ""; + echo "In-Group:"; + echo ""; + echo " "; + echo "   Handle Method: \n"; + echo "
Search Method: \n"; + echo "   List ID: "; + echo "
Campaign ID: \n"; + echo "   Phone 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 ""; + echo "DID:"; + echo ""; + echo " \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: audio chooser\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:   Context: \n"; + } + if ($no_agent_action=='VOICEMAIL') + { + echo "Voicemail Box: \n"; + } + + echo " +
  \n"; + echo "Welcome Message Filename: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE\n"; echo "Play Welcome Message: $NWB#vicidial_inbound_groups-play_welcome_message$NWE\n"; diff --git a/agc_2-X/trunk/www/vicidial/admin_header.php b/agc_2-X/trunk/www/vicidial/admin_header.php index 859be66d..1ad2bafe 100644 --- a/agc_2-X/trunk/www/vicidial/admin_header.php +++ b/agc_2-X/trunk/www/vicidial/admin_header.php @@ -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 = ''; + var Iframe_content = ''; 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 .= ""; $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 = '\n"; } - new_content = 'Call Menu: '; + new_content = 'Call Menu: '; } 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; } - 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 + function dynamic_call_action(option,route,value,chooser_height) + { + var call_menu_list = ''; + var ingroup_list = ''; + var IGcampaign_id_list = ''; + var IGhandle_method_list = ''; + var IGsearch_method_list = ''; + var 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 = '\n"; + } + else + {value = '';} + new_content = 'Call Menu: '; + } + 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 = ''; + } + + new_content = new_content + 'In-Group: '; + new_content = new_content + ''; + new_content = new_content + '   Handle Method: '; + new_content = new_content + '
Search Method: '; + new_content = new_content + '   List ID: '; + new_content = new_content + '
Campaign ID: '; + new_content = new_content + '   Phone Code: '; + } + if (selected_route=='DID') + { + if (route == selected_route) + { + selected_value = '\n"; + } + else + {value = '';} + new_content = 'DID: '; + } + if (selected_route=='MESSAGE') + { + if (route == selected_route) + { + selected_value = value; + } + else + {value = 'nbdy-avail-to-take-call|vm-goodbye';} + new_content = "Audio File: audio chooser"; + } + 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:   Context: "; + } + if (selected_route=='VOICEMAIL') + { + if (route == selected_route) + { + selected_value = value; + } + else + {value = '101';} + new_content = "Voicemail Box: "; + } + + 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 = 'Call Menu:'; + } + if (route=='INGROUP') + { + new_content = 'In-Group:'; + } + if (route=='DID') + { + new_content = 'DID:'; + } + + if (new_content.length < 1) + {new_content = selected_route} + + span_to_update.innerHTML = new_content; + } + + \n"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/www/vicidial/non_agent_api.php b/agc_2-X/trunk/www/vicidial/non_agent_api.php index 7f3921e3..d020596d 100644 --- a/agc_2-X/trunk/www/vicidial/non_agent_api.php +++ b/agc_2-X/trunk/www/vicidial/non_agent_api.php @@ -409,8 +409,8 @@ if ($function == 'sounds_list') echo "\n"; echo "close frame\n"; - echo "

\n"; - echo "\n"; + echo "
\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/www/vicidial/user_territories.php b/agc_2-X/trunk/www/vicidial/user_territories.php index 56b0c302..2f9efb62 100644 --- a/agc_2-X/trunk/www/vicidial/user_territories.php +++ b/agc_2-X/trunk/www/vicidial/user_territories.php @@ -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       Records Changed: $changed
\n"; + echo "Vtiger Territory Owner Changed: $user $territory       Records Changed: $changed - $Achanged - $Cchanged
\n"; ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|$stmtB|";
#FILENAMEDATE