diff --git a/agc_2-X/trunk/agi/VD_amd.agi b/agc_2-X/trunk/agi/VD_amd.agi index e7579647..1a9c037c 100644 --- a/agc_2-X/trunk/agi/VD_amd.agi +++ b/agc_2-X/trunk/agi/VD_amd.agi @@ -21,7 +21,7 @@ # exten => _8320*.,1,AGI(VD_amd.agi,${EXTEN}-----YES) # exten => _8320*.,2,Hangup # -# Copyright (C) 2022 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell LICENSE: AGPLv2 # # changes: # 60206-1434 - first build @@ -63,9 +63,11 @@ # 200311-0041 - Added amd_agent_route_options feature # 200424-1839 - Added STC(settings-container) and LTT(lead temp table) message playback options # 220411-0833 - Added FHG(file-http-get) message playback option to download file from website +# 230412-1023 - Added Code to dispo NOAUDIODATA as ADAIR (Dead Air Auto) with Settings Container option, Issue #1459 # $script = 'VD_amd.agi'; +$build = '230412-1023'; $A = 1; # set to 1 for AMD output messages mode $AMD_LOG = 3; # set to 1 for logfile and 2 forDB log, 3 for both @@ -175,7 +177,7 @@ $sthA->finish(); if (length($ARGV[0])>1) { if ($AGILOG) - {$agi_string = "Perl Environment Dump:"; &agi_output;} + {$agi_string = "Perl Environment Dump: (build $build)"; &agi_output;} $i=0; while ($#ARGV >= $i) { @@ -342,6 +344,7 @@ if ( (length($CLIphone_number) > 1) && (length($VD_phone_number) < 1) ) $amd_agent_route_options=''; $AMDcontainer_entry=''; $AMD_agent_send=0; +$NOAUDIODATA_hangup_enabled=0; $stmtA = "SELECT amd_agent_route_options FROM vicidial_campaigns where campaign_id='$VD_campaign_id' limit 1;"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -383,6 +386,10 @@ if ($amd_agent_route_options =~ /ENABLED/i) if ($AGILOG) {$agi_string = "AMD Agent send MATCH: $c|$AMDline[0]($AMDSTATUS)|$AMDline[1]($AMDRESPONSE)|"; &agi_output;} } } + if ($AMDcontainer_lines[$c] =~ /NOAUDIODATA-Hangup-ENABLED/) + { + $NOAUDIODATA_hangup_enabled++; + } $c++; } } @@ -741,6 +748,26 @@ else exit; } + if ( ($AMDRESPONSE =~ /^NOAUDIODATA/) && ($NOAUDIODATA_hangup_enabled > 0) ) + { + ### No audio, let's update lead, log and hangup. + $stmtA = "UPDATE vicidial_log set status='ADAIR' where uniqueid='$uniqueid' and lead_id='$VD_lead_id' order by call_date desc limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDAD vicidial_log ADAIR update: |$affected_rows|$uniqueid|"; &agi_output;} + + $stmtA = "UPDATE vicidial_list set status='ADAIR' where lead_id='$VD_lead_id';"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $affected_rows = $dbhA->do($stmtA); + if ($AGILOG) {$agi_string = "-- VDAD vicidial_list ADAIR update: |$affected_rows|$uniqueid|"; &agi_output;} + + $dbhA->disconnect(); + + $AGI->hangup($channel); + + exit; + } + if ( ( ($DB_amd_send_to_vmx =~ /Y/) || ($force_playback =~ /YES/) ) && (length($DB_am_message_exten) > 0) ) { $msg_status='AM'; diff --git a/agc_2-X/trunk/docs/VICIDIAL_statuses.txt b/agc_2-X/trunk/docs/VICIDIAL_statuses.txt index e0823c4a..a528da25 100644 --- a/agc_2-X/trunk/docs/VICIDIAL_statuses.txt +++ b/agc_2-X/trunk/docs/VICIDIAL_statuses.txt @@ -81,3 +81,4 @@ PAUSMX - Pause Max Seconds timeout default status IQNANQ - In-Queue call No-Agent-No-Queue drop SRDROP - SHARED outbound campaign drop to in-group, not included in most DROP stats HUCXXX - Enhanced Disconnect Logging level 3 failed calls, where 'XXX' is the disconnect code. For example: "HUC18" for Cause 18 (SIP 408 Request timeout) +ADAIR - Dead Air Auto, for AMD NOAUDIODATA calls 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 e0126c41..c430f842 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -5259,6 +5259,7 @@ INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,cate INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed,answering_machine) values('ADCT','Disconnected Number Temporary','N','N','UNDEFINED','N','N','N','N','N','N','N','N'); INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed,answering_machine) values('LSMERG','Agent lead search old lead mrg','N','N','UNDEFINED','N','N','N','N','N','N','N','N'); INSERT INTO vicidial_statuses (status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed,answering_machine) values('DAIR','Dead Air','Y','N','UNDEFINED','N','N','N','N','N','N','N','N'); +INSERT INTO vicidial_statuses (status,status_name) VALUES ('ADAIR', 'Dead Air Auto'); INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCPASS','PASS','PASS'); INSERT INTO vicidial_qc_codes (code,code_name,qc_result_type) VALUES ('QCFAIL','FAIL','FAIL'); @@ -5286,4 +5287,4 @@ INSERT INTO `wallboard_reports` VALUES ('AGENTS_AND_QUEUES','Agents and Queues', UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1679',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1680',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index e6f28cfa..0da66b78 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -2206,3 +2206,7 @@ PRIMARY KEY (queue_id) ) ENGINE=MyISAM; UPDATE system_settings SET db_schema_version='1679',db_schema_update_date=NOW() where db_schema_version < 1679; + +INSERT INTO vicidial_statuses (status,status_name) VALUES ('ADAIR', 'Dead Air Auto'); + +UPDATE system_settings SET db_schema_version='1680',db_schema_update_date=NOW() where db_schema_version < 1680; diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index 04d706d8..2dc36040 100644 --- a/agc_2-X/trunk/www/vicidial/help_documentation.txt +++ b/agc_2-X/trunk/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20230412144001 +# version: 20230414083701 users-user User ID This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. 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. @@ -189,7 +189,7 @@ campaigns-waitforsilence_options WaitForSilence Options If Wait For Silence campaigns-am_message_wildcards AM Message Wildcards This option, if enabled, allows you to go to the AM Message Wildcard administration page where you can define wildcards that can match data in a default lead field and can play a different message based upon the data in a specific lead. Default is N for disabled. campaigns-amd_type AMD Type This setting allows you to define the type of Answering Machine Detection that should be used when routing answered outbound calls. The default is AMD, for the built-in AMD application. You should only change this setting if you have one of the listed third-party AMD solutions installed on your system and you have confirmed the proper Routing Extension to use with your system administrator. campaigns-amd_send_to_vmx AMD send to Action This option allows you to define whether a call is sent to the Answering Machine Message or CPD AMD Action when an answering machine is detected, or if it is hung up. If this is set to N, then the call will be hung up as soon as it is determined to be an answering machine. Default is N. -campaigns-amd_agent_route_options AMD Agent Route Options If enabled and you are using Asterisk AMD, this setting will allow you to define the AMD statuses and responses for calls going through AMD that will be sent to agents, overriding the default which sends all HUMAN and NOTSURE status calls to agents. To see the AMD statuses and responses for the calls that have been logged on your system, go to the AMD Log Report on the Admin Utilities page. The PENDING option for this setting will allow you to click on this option to go to the Modify Settings Container page to edit the settings without making them active yet. Default is DISABLED. The Settings Container for these options allow for multiple lines of settings, with each line containing one AMD status-response pair each separated by a comma. For example:
HUMAN,HUMAN
NOTSURE,TOOLONG
+campaigns-amd_agent_route_options AMD Agent Route Options If enabled and you are using Asterisk AMD, this setting will allow you to define the AMD statuses and responses for calls going through AMD that will be sent to agents, overriding the default which sends all HUMAN and NOTSURE status calls to agents. To see the AMD statuses and responses for the calls that have been logged on your system, go to the AMD Log Report on the Admin Utilities page. The PENDING option for this setting will allow you to click on this option to go to the Modify Settings Container page to edit the settings without making them active yet. Default is DISABLED. There is also a special option you can enable in this settings container, NOAUDIODATA-Hangup-ENABLED, which will enable the immediate hangup of calls that have no audio data when they reach the AMD routing script. The Settings Container for these options allow for multiple lines of settings, with each line containing one AMD status-response pair each separated by a comma. For example:
HUMAN,HUMAN
NOTSURE,TOOLONG
campaigns-cpd_amd_action CPD AMD Action If you are using the Sangoma ParaXip Call Progress Detection software then you will want to enable this setting either setting it to DISPO which will disposition the call as AA and hang it up if the call is being processed and has not been sent to an agent yet or MESSAGE which will send the call to the defined Answering Machine Message for this campaign. Default is DISABLED. Setting this to INGROUP will send an answering machine to an inbound group. Setting this to CALLMENU will send an answering machine to a Call Menu in the system. campaigns-cpd_unknown_action CPD Unknown Action If you are using the Sangoma ParaXip Call Progress Detection software and you want to send calls that have an Unknown result to a destination other than an agent, then you will want to enable this setting either setting it to DISPO which will disposition the call as AA and hang it up if the call is being processed and has not been sent to an agent yet or MESSAGE which will send the call to the defined Answering Machine Message for this campaign. Default is DISABLED. Setting this to INGROUP will send an answering machine to an inbound group. Setting this to CALLMENU will send an answering machine to a Call Menu in the system. campaigns-amd_inbound_group AMD Inbound Group If CPD AMD Action is set to INGROUP, then this is the Inbound Group that the call will be sent to if an answering machine is detected.