diff --git a/bin/FastAGI_log.pl b/bin/FastAGI_log.pl index b8dc9fe0..dd38ff03 100644 --- a/bin/FastAGI_log.pl +++ b/bin/FastAGI_log.pl @@ -25,7 +25,7 @@ # exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME}) # # -# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2021 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 61010-1007 - First test build @@ -86,6 +86,7 @@ # 190709-2240 - Added Call Quota logging # 191001-1509 - Small fix for monitoring issue # 200318-1054 - Added code for OpenSIPs CallerIDname +# 210314-1015 - Added enhanced_disconnect_logging=2 option # # defaults for PreFork @@ -1029,16 +1030,30 @@ sub process_request ### END - CPD Look for result for B/DC calls ############################################################## } - if ( ($PRI =~ /^PRI$/) && ($callerid =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) && ( ( ($dialstatus =~ /BUSY/) || ( ($dialstatus =~ /CHANUNAVAIL/) && ($hangup_cause =~ /^1$|^28$/) ) || ( ($enhanced_disconnect_logging > 0) && ( ($dialstatus =~ /CONGESTION/) && ($hangup_cause =~ /^1$|^19$|^21$|^34$|^38$/) ) ) ) || ($CPDfound > 0) ) && ($callerid !~ /^S\d\d\d\d\d\d\d\d\d\d\d\d/) ) + if ( ($PRI =~ /^PRI$/) && ($callerid =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) && ( ( ($dialstatus =~ /BUSY/) || ( ($dialstatus =~ /CHANUNAVAIL/) && ($hangup_cause =~ /^1$|^28$/) ) || ( ($enhanced_disconnect_logging > 0) && ( ( ($dialstatus =~ /CONGESTION/) && ($hangup_cause =~ /^1$|^19$|^21$|^34$|^38$|^102$/) ) || ( ($dialstatus =~ /CHANUNAVAIL/) && ($hangup_cause =~ /^18$/) ) ) ) || ($CPDfound > 0) && ($callerid !~ /^S\d\d\d\d\d\d\d\d\d\d\d\d/) ) ) ) { if ($CPDfound < 1) { - if ($dialstatus =~ /BUSY/) {$VDL_status = 'AB'; $VDAC_status = 'BUSY';} - if ($dialstatus =~ /CHANUNAVAIL/) {$VDL_status = 'ADC'; $VDAC_status = 'DISCONNECT';} - if ($enhanced_disconnect_logging > 0) + if ($enhanced_disconnect_logging == '2') { - if ($dialstatus =~ /CONGESTION/ && $hangup_cause =~ /^1$/) {$VDL_status = 'ADC'; $VDAC_status = 'DISCONNECT';} - if ($dialstatus =~ /CONGESTION/ && $hangup_cause =~ /^19$|^21$|^34$|^38$/) {$VDL_status = 'ADCT'; $VDAC_status = 'DISCONNECT';} + if ($dialstatus =~ /BUSY/) {$VDL_status = 'AB'; $VDAC_status = 'BUSY';} + if ($dialstatus =~ /CHANUNAVAIL/) {$VDL_status = 'ADC'; $VDAC_status = 'DISCONNECT';} + if ($enhanced_disconnect_logging > 0) + { + if ($dialstatus =~ /CHANUNAVAIL/ && $hangup_cause =~/^18/) {$VDL_status = 'ADCT'; $VDAC_status = 'DISCONNECT';} + if ($dialstatus =~ /CONGESTION/ && $hangup_cause =~ /^1$/) {$VDL_status = 'ADC'; $VDAC_status = 'DISCONNECT';} + if (($dialstatus =~ /CONGESTION/ && $hangup_cause =~ /^21$|^34$|^38$|^102$/) || ($dialstatus =~ /BUSY/ && $hangup_cause =~ /^19$/)) {$VDL_status = 'ADCT'; $VDAC_status = 'DISCONNECT';} + } + } + else + { + if ($dialstatus =~ /BUSY/) {$VDL_status = 'AB'; $VDAC_status = 'BUSY';} + if ($dialstatus =~ /CHANUNAVAIL/) {$VDL_status = 'ADC'; $VDAC_status = 'DISCONNECT';} + if ($enhanced_disconnect_logging > 0) + { + if ($dialstatus =~ /CONGESTION/ && $hangup_cause =~ /^1$/) {$VDL_status = 'ADC'; $VDAC_status = 'DISCONNECT';} + if ($dialstatus =~ /CONGESTION/ && $hangup_cause =~ /^19$|^21$|^34$|^38$/) {$VDL_status = 'ADCT'; $VDAC_status = 'DISCONNECT';} + } } } diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 5c84c42a..972cec2e 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -1807,7 +1807,7 @@ audio_store_purge TEXT, svn_revision INT(9) default '0', queuemetrics_socket VARCHAR(20) default 'NONE', queuemetrics_socket_url TEXT, -enhanced_disconnect_logging ENUM('0','1') default '0', +enhanced_disconnect_logging ENUM('0','1','2','3','4','5','6') default '0', allow_emails ENUM('0','1') default '0', level_8_disable_add ENUM('0','1') default '0', pass_hash_enabled ENUM('0','1') default '0', @@ -4849,4 +4849,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_ UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1620',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1621',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/extras/upgrade_2.14.sql b/extras/upgrade_2.14.sql index 97ba9d93..198b0fd7 100644 --- a/extras/upgrade_2.14.sql +++ b/extras/upgrade_2.14.sql @@ -1559,3 +1559,7 @@ index (auth_exp_date) ) ENGINE=MyISAM; UPDATE system_settings SET db_schema_version='1620',db_schema_update_date=NOW() where db_schema_version < 1620; + +ALTER TABLE system_settings MODIFY enhanced_disconnect_logging ENUM('0','1','2','3','4','5','6') default '0'; + +UPDATE system_settings SET db_schema_version='1621',db_schema_update_date=NOW() where db_schema_version < 1621; diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index fc9967ee..ee37bfd8 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -5529,12 +5529,13 @@ if ($SSscript_remove_js > 0) # 210309-2207 - Added Inbound main panel sub-links, fixed System Settings modify SQL # 210312-1239 - Added Two-Factor Authentication system, Added mobile_number to User Modify screen # 210312-1456 - Small change to Copy User page +# 210314-0919 - Added more enhanced_disconnect_logging options in System Settings # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-796a'; -$build = '210312-1456'; +$admin_version = '2.14-797a'; +$build = '210314-0919'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -40560,7 +40561,7 @@ if ($ADD==311111111111111) echo ""._QXZ("Agent Screen Debug Logging").": $NWB#settings-agent_debug_logging$NWE\n"; - echo ""._QXZ("Enhanced Disconnect Logging").": $NWB#settings-enhanced_disconnect_logging$NWE\n"; + echo ""._QXZ("Enhanced Disconnect Logging").": $NWB#settings-enhanced_disconnect_logging$NWE\n"; echo ""._QXZ("SIP Event Logging").": $NWB#settings-sip_event_logging$NWE\n"; diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt index 29c51a4a..218e1a37 100644 --- a/www/vicidial/help_documentation.txt +++ b/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20210312191801 +# version: 20210314105801 users-user User ID This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters. users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N. @@ -1089,7 +1089,7 @@ settings-enable_gdpr_download_deletion Enable GDPR-compliant Data Download Delet settings-enable_drop_lists Enable Drop Lists This setting if enabled will make the Drop Lists feature appear under the LISTS menu. This feature set can take dropped call log records and create new leads in a list from multiple inbound groups. Default is 0 for disabled. settings-source_id_display Admin Lead Source ID Display This setting will make the Source ID lead field show up in the Admin Modify Lead screen. Default is 0 for disabled. settings-agent_debug_logging Agent Screen Debug Logging This setting if enabled will log almost all agent screen mouse clicks and AJAX processes triggered by the agent screen. To enable for all agents, set this option to 1. To enable only for one agent on the system, set this option to the user that you want to log. Warning, this feature can log hundreds of entries per phone call, so use with caution. These agent debug records are deleted after 7 days. Default is 0 for disabled. -settings-enhanced_disconnect_logging Enhanced Disconnect Logging This setting enables logging of calls that get a CONGESTION signal with a cause code of 1, 19, 21, 34 or 38. We usually do not recommend enabling this in the USA. Default is 0 for disabled. +settings-enhanced_disconnect_logging Enhanced Disconnect Logging This setting, set to 1, enables logging of calls that get a CONGESTION signal with a cause code of 1, 19, 21, 34 or 38. Setting this to 2 will additionally log calls with cause codes of 18-CHANUNAVAIL and 102. Default is 0 for disabled. settings-sip_event_logging SIP Event Logging This setting will enable logging of SIP events on outbound phone calls for servers that are running patched versions of Asterisk 13 or higher. Default is 0 for disabled. settings-cache_carrier_stats_realtime Cached Realtime Carrier Stats This setting if enabled will change the real-time report from gathering the carrier log stats every time it is refreshed on every screen it is running on, to a cached set of carrier log stats that are refreshed once per minute. Default is 0 for disabled. settings-campaign_cid_areacodes_enabled Enable CID Groups and Campaign Areacode CID This setting enables the ability to set specific outbound callerid numbers to be used per areacode for a campaign, as well as CID Groups which allows both per areacode and per state options for groups of CallerID numbers for one or multiple campaigns. Default is 1 for enabled.