From fa9884bde338e4f2389fcb49b57d80426eba1e44 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 25 Sep 2025 17:02:37 +0000 Subject: [PATCH] Added Talk Seconds URLs features to campaigns and in-groups Small fix for Stereo Call Recordings Added code for Monitor Deprecation after Asterisk 20 git-svn-id: svn://192.168.202.10@3945 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 15 + agc_2-X/trunk/agi/VD_amd.agi | 15 +- agc_2-X/trunk/agi/agi-DID_route.agi | 13 +- .../agi/agi-IVR_recording_verification.agi | 13 +- agc_2-X/trunk/agi/agi-NVA_recording.agi | 13 +- agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 23 +- agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi | 39 +- agc_2-X/trunk/agi/agi-VDAD_RINGALL.agi | 13 +- agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl | 27 +- agc_2-X/trunk/docs/STEREO_CALL_RECORDINGS.txt | 4 +- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 4 +- agc_2-X/trunk/extras/upgrade_2.14.sql | 6 +- agc_2-X/trunk/www/agc/manager_send.php | 34 +- agc_2-X/trunk/www/agc/vdc_db_query.php | 777 ++++++++++++++++-- agc_2-X/trunk/www/agc/vicidial.php | 97 ++- agc_2-X/trunk/www/vicidial/admin.php | 84 +- .../trunk/www/vicidial/admin_url_multi.php | 32 +- .../trunk/www/vicidial/help_documentation.txt | 6 +- 18 files changed, 1075 insertions(+), 140 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index d991a0a5..f8c25942 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -871,6 +871,21 @@ OTHER CHANGES: setting. This can send a URL request when new leads are added to the system through the "add_lead" Non-Agent API function. +249. Added agc/dispo_move_listSC.php script, allowing for multiple more complex + Dispo Move List functions after an agent dispositions a call. + +250. Added "hopper_bulk_insert" Non-Agent API function. + +251. Added Stereo Call Recording, allowing for additional call recordings with + the customer on one side(the Right channel) and the agent on the other + side(the Left channel), as well as optional parallel stereo call + recordings. For more information, read the doc: + STEREO_CALL_RECORDINGS.txt + +252. Added "Talk Seconds URLs" Campaign and In-Group features. Allows for URLs + to be sent out from the Agent Screen while the agent is talking to the + customer, based on the number of seconds they have been talking. + diff --git a/agc_2-X/trunk/agi/VD_amd.agi b/agc_2-X/trunk/agi/VD_amd.agi index 2ac7053d..175ba8d0 100644 --- a/agc_2-X/trunk/agi/VD_amd.agi +++ b/agc_2-X/trunk/agi/VD_amd.agi @@ -25,7 +25,7 @@ # exten => _91NXXNXXXXXX,n,Set(__AMDMINLEN=7) # NOTE: the above variable setting will ensure that this script has run for a minimum of 7 seconds before ending and hanging up # -# Copyright (C) 2024 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # changes: # 60206-1434 - first build @@ -70,10 +70,11 @@ # 230412-1023 - Added Code to dispo NOAUDIODATA as ADAIR (Dead Air Auto) with Settings Container option, Issue #1459 # 230726-0932 - Added manual_vm_status_updates campaign option # 240906-2228 - Added AMD minimum length handling to increase short call durations +# 250924-2152 - Added code for deprecation of "Monitor" application after Asterisk 20 # $script = 'VD_amd.agi'; -$build = '230726-0932'; +$build = '250924-2152'; $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 @@ -713,7 +714,15 @@ else } else { - $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$campaign_rec_filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$campaign_rec_filename-in.wav)t($PATHmonitor/MIX/$campaign_rec_filename-out.wav)"); + } + else + { + $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$campaign_rec_filename"); + } } ### insert record into recording_log table ### diff --git a/agc_2-X/trunk/agi/agi-DID_route.agi b/agc_2-X/trunk/agi/agi-DID_route.agi index 8363bcb3..fbfa72b7 100644 --- a/agc_2-X/trunk/agi/agi-DID_route.agi +++ b/agc_2-X/trunk/agi/agi-DID_route.agi @@ -13,7 +13,7 @@ # ;inbound DID catch-all: #exten => _X.,1,AGI(agi-DID_route.agi) # -# Copyright (C) 2024 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # changes: # 81007-0324 - First Build @@ -51,6 +51,7 @@ # 220507-0811 - Added pre_filter_recent_call function # 230124-1228 - Added logging of VICIrecGatewayID channel variable, and vicidial_did_gateway_log table # 241208-1748 - Changed DID filter_phone_group_id & pre_filter_phone_group_id to multi-selects +# 250924-2156 - Added code for deprecation of "Monitor" application after Asterisk 20 # @@ -879,7 +880,15 @@ if ($record_call =~ /Y/) } else { - $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$filename-in.wav)t($PATHmonitor/MIX/$filename-out.wav)"); + } + else + { + $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$filename"); + } } ### insert record into recording_log table ### diff --git a/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi b/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi index 5e707950..eff0c54c 100644 --- a/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi +++ b/agc_2-X/trunk/agi/agi-IVR_recording_verification.agi @@ -42,7 +42,7 @@ #exten => _83002*.,5,Hangup # # -# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 70912-1105 - First build, non-functional @@ -53,6 +53,7 @@ # 71120-1337 - added playing of recording ID at beginning of session # 120430-2214 - Converted call to Monitor app to be asterisk 1.8 compatible # 130108-1816 - Changes for Asterisk 1.8 compatibility +# 250924-2158 - Added code for deprecation of "Monitor" application after Asterisk 20 # &get_time_now; @@ -386,7 +387,15 @@ if ($record_call =~ /Y/) } else { - $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$filename,m"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$filename-in.wav)t($PATHmonitor/MIX/$filename-out.wav)"); + } + else + { + $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$filename,m"); + } } ### insert record into recording_log table ### diff --git a/agc_2-X/trunk/agi/agi-NVA_recording.agi b/agc_2-X/trunk/agi/agi-NVA_recording.agi index ed8e387f..49bc1a47 100644 --- a/agc_2-X/trunk/agi/agi-NVA_recording.agi +++ b/agc_2-X/trunk/agi/agi-NVA_recording.agi @@ -47,7 +47,7 @@ #exten => _X.,n,Goto(default,${EXTEN},1) #exten => _X.,n,Hangup # -# Copyright (C) 2015 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 91105-1402 - First build @@ -60,6 +60,7 @@ # 151211-0932 - Added phone search and phone NVA URL features # 151214-2148 - Added more variables to be used by nva url feature # 151220-1521 - Added phone NVA List ID option for not found phone numbers +# 250924-2137 - Added code for deprecation of "Monitor" application after Asterisk 20 # &get_time_now; @@ -404,7 +405,15 @@ if ($record_call =~ /Y/) } else { - $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $AGI->exec("MixMonitor",",r(/var/spool/asterisk/monitor/MIX/$filename-in.wav)t(/var/spool/asterisk/monitor/MIX/$filename-out.wav)"); + } + else + { + $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$filename"); + } } } 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 1caa561e..d07a2eb2 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -265,7 +265,8 @@ # 240723-1632 - Small fix for ConfBridge # 240906-1032 - Added testing for stereo_recording in-group option *NOT PRODUCTION READY* # 250325-1724 - Fix for possible daily_limit issue -# 250825-1824 - Added stereo_recording code +# 250825-1824 - Added stereo_recording code +# 250924-2147 - Added code for deprecation of "Monitor" application after Asterisk 20 # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -2691,7 +2692,15 @@ if ( ($CLchannel_group =~ /DID_INBOUND/) && (length($CLend_epoch) < 5) ) } else { - $AGI->exec("StopMonitor","wav,$PATHmonitor/MIX/$CLfilename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $AGI->exec("StopMixMonitor",""); + } + else + { + $AGI->exec("StopMonitor","wav,$PATHmonitor/MIX/$CLfilename"); + } } @@ -5034,7 +5043,15 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override } else { - $retval = $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $retval = $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$campaign_rec_filename-in.wav)t($PATHmonitor/MIX/$campaign_rec_filename-out.wav)"); + } + else + { + $retval = $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + } } } diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index 1402190a..b796786f 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -133,6 +133,7 @@ # 241001-2222 - Fixes for Khomp call processing # 241020-1928 - Added khomp campaign settings options # 250827-1556 - Added stereo_recording code +# 250924-2150 - Added code for deprecation of "Monitor" application after Asterisk 20 # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -1212,7 +1213,15 @@ if ($VDACaffected_rows > 0) } else { - $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$campaign_rec_filename-in.wav)t($PATHmonitor/MIX/$campaign_rec_filename-out.wav)"); + } + else + { + $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + } } ### insert record into recording_log table ### @@ -3228,7 +3237,15 @@ while ($drop_timer <= $DROP_TIME) } else { - $retval = $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $retval = $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$campaign_rec_filename-in.wav)t($PATHmonitor/MIX/$campaign_rec_filename-out.wav)"); + } + else + { + $retval = $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + } } } @@ -3938,7 +3955,7 @@ while ($drop_timer <= $DROP_TIME) $SRaffected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging; - $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed) values('$recording_id','$temp_parallel_rec_ag_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0')"; + $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed,rir_type) values('$recording_id','$temp_parallel_rec_ag_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0','S')"; $affected_rowsB = $dbhA->do($stmtB); $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging; @@ -3987,7 +4004,7 @@ while ($drop_timer <= $DROP_TIME) $SRaffected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging; - $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed) values('$recording_id','$stereo_rec_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0')"; + $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed,rir_type) values('$recording_id','$stereo_rec_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0','S')"; $affected_rowsB = $dbhA->do($stmtB); $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging; @@ -4642,7 +4659,15 @@ while ($drop_timer <= $DROP_TIME) } else { - $retval = $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $retval = $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$campaign_rec_filename-in.wav)t($PATHmonitor/MIX/$campaign_rec_filename-out.wav)"); + } + else + { + $retval = $AGI->exec("Monitor","wav,$PATHmonitor/MIX/$campaign_rec_filename"); + } } } @@ -5349,7 +5374,7 @@ while ($drop_timer <= $DROP_TIME) $SRaffected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging; - $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed) values('$recording_id','$temp_parallel_rec_ag_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0')"; + $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed,rir_type) values('$recording_id','$temp_parallel_rec_ag_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0','S')"; $affected_rowsB = $dbhA->do($stmtB); $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging; @@ -5398,7 +5423,7 @@ while ($drop_timer <= $DROP_TIME) $SRaffected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01XXX'; $MEL_aff_rows=$SRaffected_rows; &mysql_error_logging; - $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed) values('$recording_id','$stereo_rec_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0')"; + $stmtB = "INSERT INTO routing_initiated_recordings (recording_id,filename,launch_time,lead_id,vicidial_id,user,processed,rir_type) values('$recording_id','$stereo_rec_filename','$now_date','$CIDlead_id','$uniqueid','$VDADuser','0','S')"; $affected_rowsB = $dbhA->do($stmtB); $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$affected_rowsB; &mysql_error_logging; diff --git a/agc_2-X/trunk/agi/agi-VDAD_RINGALL.agi b/agc_2-X/trunk/agi/agi-VDAD_RINGALL.agi index f5b7d145..97301fb6 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_RINGALL.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_RINGALL.agi @@ -12,7 +12,7 @@ # exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) # exten => _8331*.,n,Hangup # -# Copyright (C) 2024 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # changes: # 110303-2325 - First build @@ -24,6 +24,7 @@ # 140421-1448 - Added code to halt ringing of other channels in ring_all NAC method # 240420-2241 - Added ConfBridge code # 240415-1702 - Fix for ConfBridge code +# 250924-2157 - Added code for deprecation of "Monitor" application after Asterisk 20 # $script = 'agi-VDAD_RINGALL.agi'; @@ -387,7 +388,15 @@ if ($NAGcount > 0) } else { - $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$campaign_rec_filename"); + if ($ast_ver_str{major} > 20) + { + # Deprecation of "Monitor" application after Asterisk 20 + $AGI->exec("MixMonitor",",r($PATHmonitor/MIX/$campaign_rec_filename-in.wav)t($PATHmonitor/MIX/$campaign_rec_filename-out.wav)"); + } + else + { + $AGI->exec("Monitor","wav,/var/spool/asterisk/monitor/MIX/$campaign_rec_filename"); + } } ### insert record into recording_log table ### diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index 58044cf6..02c3e985 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -174,9 +174,10 @@ # 240420-2209 - Added Conference Updater option # 250103-0932 - Added ConfBridge code and enhanced_agent_monitoring system setting code # 250914-1601 - Added pruning of recording_live table entries over 7 days old, deletion of parallel recording source files 3+ days +# 250924-2212 - Added code for deprecation of "Monitor" application after Asterisk 20 # -$build = '250914-1601'; +$build = '250924-2212'; $DB=0; # Debug flag $teodDB=0; # flag to log Timeclock End of Day processes to log file @@ -3402,7 +3403,17 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r if ($asterisk_version =~ /^1.2/) {$Vext .= "exten => 8309,2,Monitor(wav,\${CALLERIDNAME})\n";} else - {$Vext .= "exten => 8309,2,Monitor(wav,\${CALLERID(name)})\n";} + { + if ($asterisk_version =~ /^2[1-9]|^3\d|^4\d/) + { + # Deprecation of "Monitor" application after Asterisk 20 + $Vext .= "exten => 8309,2,MixMonitor(,r($PATHmonitor/\${CALLERID(name)}-in.wav)t($PATHmonitor/\${CALLERID(name)}-out.wav))\n"; + } + else + { + $Vext .= "exten => 8309,2,Monitor(wav,\${CALLERID(name)})\n"; + } + } $Vext .= "exten => 8309,3,Wait($vicidial_recording_limit)\n"; $Vext .= "exten => 8309,4,Hangup()\n"; $Vext .= "; this is the GSM verison\n"; @@ -3410,7 +3421,17 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r if ($asterisk_version =~ /^1.2/) {$Vext .= "exten => 8310,2,Monitor(gsm,\${CALLERIDNAME})\n";} else - {$Vext .= "exten => 8310,2,Monitor(gsm,\${CALLERID(name)})\n";} + { + if ($asterisk_version =~ /^2[1-9]|^3\d|^4\d/) + { + # Deprecation of "Monitor" application after Asterisk 20 + $Vext .= "exten => 8309,2,MixMonitor(,r($PATHmonitor/\${CALLERID(name)}-in.wav)t($PATHmonitor/\${CALLERID(name)}-out.wav))\n"; + } + else + { + $Vext .= "exten => 8310,2,Monitor(gsm,\${CALLERID(name)})\n"; + } + } $Vext .= "exten => 8310,3,Wait($vicidial_recording_limit)\n"; $Vext .= "exten => 8310,4,Hangup()\n"; diff --git a/agc_2-X/trunk/docs/STEREO_CALL_RECORDINGS.txt b/agc_2-X/trunk/docs/STEREO_CALL_RECORDINGS.txt index 3934aa3e..15f84055 100644 --- a/agc_2-X/trunk/docs/STEREO_CALL_RECORDINGS.txt +++ b/agc_2-X/trunk/docs/STEREO_CALL_RECORDINGS.txt @@ -1,7 +1,7 @@ -VICIDIAL STEREO CALL RECORDINGS Started: 2025-06-18 Updated: 2025-09-19 +VICIDIAL STEREO CALL RECORDINGS Started: 2025-06-18 Updated: 2025-09-25 -TO USE THESE FEATURES, YOU WILL NEED TO HAVE ALL SERVERS IN YOUR CLUSTER USING SVN/TRUNK REVISION 3943(2025-09-19) CODE OR HIGHER!!! +TO USE THESE FEATURES, YOU WILL NEED TO HAVE ALL SERVERS IN YOUR CLUSTER USING SVN/TRUNK REVISION 3945(2025-09-25) CODE OR HIGHER!!! This project was designed to allow for additional stereo recording of phone calls at the agent and server levels directly on VICIdial Asterisk servers, with the customer always on one channel(the Right channel) and the agent and all other parties on the other channel(the Left channel). If you are looking for the VICI Gateway Recording Server documentation, please see the GATEWAY_RECORDING_SERVER.txt document. 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 d949d7b4..22bfb302 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -3801,7 +3801,7 @@ url_id INT(9) UNSIGNED NOT NULL AUTO_INCREMENT, campaign_id VARCHAR(20) NOT NULL, entry_type ENUM('campaign','ingroup','list','system','') default '', active ENUM('Y','N') default 'N', -url_type ENUM('dispo','start','addlead','noagent','apinewlead','') default '', +url_type ENUM('dispo','start','addlead','noagent','apinewlead','talk','') default '', url_rank SMALLINT(5) default '1', url_statuses VARCHAR(1000) default '', url_description VARCHAR(255) default '', @@ -5853,4 +5853,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='1729',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1730',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 ff395d57..14bcd279 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -2873,7 +2873,7 @@ ALTER TABLE system_settings ADD agent_hide_dial_fail ENUM('0','1','2','3','4','5 UPDATE system_settings SET db_schema_version='1725',db_schema_update_date=NOW() where db_schema_version < 1725; ALTER TABLE vicidial_url_multi MODIFY entry_type ENUM('campaign','ingroup','list','system','') default ''; -ALTER TABLE vicidial_url_multi MODIFY url_type ENUM('dispo','start','addlead','noagent','apinewlead','') default ''; +ALTER TABLE vicidial_url_multi MODIFY url_type ENUM('dispo','start','addlead','noagent','apinewlead','talk','') default ''; UPDATE system_settings SET db_schema_version='1726',db_schema_update_date=NOW() where db_schema_version < 1726; @@ -3007,3 +3007,7 @@ CREATE TABLE recording_log_parallel_archive LIKE recording_log_parallel; CREATE TABLE recording_log_stereo_archive LIKE recording_log_stereo; UPDATE system_settings SET db_schema_version='1729',db_schema_update_date=NOW() where db_schema_version < 1729; + +ALTER TABLE vicidial_url_multi MODIFY url_type ENUM('dispo','start','addlead','noagent','apinewlead','talk','') default ''; + +UPDATE system_settings SET db_schema_version='1730',db_schema_update_date=NOW() where db_schema_version < 1730; diff --git a/agc_2-X/trunk/www/agc/manager_send.php b/agc_2-X/trunk/www/agc/manager_send.php index fda51e09..1b748d9b 100644 --- a/agc_2-X/trunk/www/agc/manager_send.php +++ b/agc_2-X/trunk/www/agc/manager_send.php @@ -165,7 +165,7 @@ $version = '2.14-106'; $build = '250831-0839'; $php_script = 'manager_send.php'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=161; +$mysql_log_count=177; $one_mysql_log=0; $SSagent_debug_logging=0; $startMS = microtime(); @@ -2820,7 +2820,7 @@ if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) $stmt = "UPDATE recording_live set end_time='$NOW_TIME',recording_status='FINISHED' where recording_id='$recording_id' and recording_status='STARTED';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02162',$user,$server_ip,$session_name,$one_mysql_log);} } # find and hang up all recordings going on in this conference # and extension = '$exten' @@ -2900,7 +2900,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmt = "UPDATE vicidial_live_agents SET external_recording='' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02163',$user,$server_ip,$session_name,$one_mysql_log);} ##### get call type from vicidial_live_agents table $VLA_inOUT='NONE'; @@ -2994,7 +2994,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) { $stmt="SELECT vendor_lead_code FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02164',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysqli_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -3058,7 +3058,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) # gather parallel_recording_id from recording_log_parallel $stmt="SELECT parallel_recording_id FROM recording_log_parallel where lead_id='$lead_id' and user='$user' and channel='$channel' and start_time > \"$four_hours_ago\" order by parallel_recording_id desc limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02165',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $PR_ct = mysqli_num_rows($rslt); if ($PR_ct > 0) @@ -3071,12 +3071,12 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,recording_status,parallel_recording_id) values('$recording_id','$server_ip','$NOW_TIME','0','$stereo_rec_filename','$lead_id','$VDcampaign_id STEREO_PARALLEL AGENT-CONTROLLED $stereo_recording $stereo_recording_agent','start: $now_date|vicidial_id: $VDvicidial_id|user: $user|channel: $channel|','STEREO START','$parallel_recording_id');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmtA, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02166',$user,$server_ip,$session_name,$one_mysql_log);} $stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status) values('$recording_id','STEREO_PARALLEL AGENT-CONTROLLED','$server_ip','$NOW_TIME','$channel','$stereo_rec_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmtD, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02167',$user,$server_ip,$session_name,$one_mysql_log);} } else { @@ -3092,12 +3092,12 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmtA = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,recording_status) values('$recording_id','$server_ip','$NOW_TIME','0','$stereo_rec_filename','$lead_id','$VDcampaign_id STEREO AGENT-CONTROLLED $stereo_recording $stereo_recording_agent','start: $now_date|vicidial_id: $VDvicidial_id|user: $user|channel: $channel|','STEREO START');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmtA, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'02168',$user,$server_ip,$session_name,$one_mysql_log);} $stmtD = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status) values('$recording_id','STEREO AGENT-CONTROLLED','$server_ip','$NOW_TIME','$channel','$stereo_rec_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmtD, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtD,'02169',$user,$server_ip,$session_name,$one_mysql_log);} if (preg_match("/CUSTOMER_ONLY/",$stereo_recording) ) { @@ -3105,7 +3105,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: write','State: 1','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02170',$user,$server_ip,$session_name,$one_mysql_log);} } if (preg_match("/CUSTOMER_MUTE/",$stereo_recording) ) { @@ -3113,7 +3113,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: read','State: 1','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02171',$user,$server_ip,$session_name,$one_mysql_log);} } } $filename = $stereo_rec_filename; @@ -3131,7 +3131,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmt = "UPDATE vicidial_live_agents SET external_recording='' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02172',$user,$server_ip,$session_name,$one_mysql_log);} } if ($uniqueid=='IN') { @@ -3164,7 +3164,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmt="SELECT recording_id,UNIX_TIMESTAMP(start_time),filename,recording_type FROM recording_live where channel='$channel' and user='$user' and recording_status='STARTED' and recording_type LIKE \"STEREO%\" and recording_type LIKE \"%AGENT-CONTROLLED%\" order by start_time desc;"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02173',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $rec_count = mysqli_num_rows($rslt); if ($rec_count>0) @@ -3187,17 +3187,17 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmt = "UPDATE recording_log_stereo set end_time='$NOW_TIME',recording_status='FINISHED',length_in_sec=$length_in_sec where recording_id='$recording_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02174',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "UPDATE recording_live set end_time='$NOW_TIME',recording_status='FINISHED' where recording_id='$recording_id' and recording_status='STARTED';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02175',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "UPDATE routing_initiated_recordings set processed='1' where user='$user' and processed='0' and rir_type='S' order by launch_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02176',$user,$server_ip,$session_name,$one_mysql_log);} } # if ($WeBRooTWritablE > 0) @@ -3213,7 +3213,7 @@ if ( ($ACTION=="MonitorStereo") || ($ACTION=="StopMonitorStereo") ) $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','StopMixMonitor','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02177',$user,$server_ip,$session_name,$one_mysql_log);} } } ##### END StopMonitorStereo steps ##### diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index 848d1106..9ff366e1 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -561,13 +561,14 @@ # 250601-0843 - Fix for fronter/closer start/dispo URL variables # 250723-2002 - Fix for issue #1548 # 250916-1918 - Added stereo recording features +# 250923-1755 - Added talk_sec_url features # -$version = '2.14-454'; -$build = '250916-1918'; +$version = '2.14-455'; +$build = '250923-1755'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=913; +$mysql_log_count=989; $one_mysql_log=0; $DB=0; $VD_login=0; @@ -779,6 +780,8 @@ if (isset($_GET["department"])) {$department=$_GET["department"];} elseif (isset($_POST["department"])) {$department=$_POST["department"];} if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["job_title"])) {$job_title=$_GET["job_title"];} elseif (isset($_POST["job_title"])) {$job_title=$_POST["job_title"];} if (isset($_GET["location"])) {$location=$_GET["location"];} @@ -1720,7 +1723,7 @@ if ($ACTION == 'regCLOSER') # Gather list of In-Groups for this user that have hit the daily limit, so we can exclude them $stmt="SELECT group_id FROM vicidial_inbound_group_agents WHERE user='$user' and ( (daily_limit > -1) and (daily_limit <= calls_today) ) limit 1000;"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00914',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_hit_limit_ingroups_ct = mysqli_num_rows($rslt); $VD_hit_limit_ingroups="'',"; @@ -1928,7 +1931,7 @@ if ($ACTION == 'regCLOSER') $stmt="INSERT INTO vicidial_inbound_group_agents set user='$user',group_id='$in_groups[$k]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00915',$user,$server_ip,$session_name,$one_mysql_log);} # Set default values since settings didn't exist $group_weight = 0; @@ -4557,7 +4560,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmtPDC = "INSERT IGNORE INTO vicidial_phone_number_call_daily_counts SET phone_number='$agent_dialed_number',modify_date=NOW(),called_count='1' ON DUPLICATE KEY UPDATE modify_date=NOW(),called_count=(called_count + 1);"; if ($DB) {echo "$stmtPDC\n";} $rslt=mysql_to_mysqli($stmtPDC, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtPDC,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtPDC,'00916',$user,$server_ip,$session_name,$one_mysql_log);} if (!$CBleadIDset) { @@ -5576,7 +5579,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt="SELECT url_rank,url_statuses,url_address,url_lists from vicidial_url_multi where campaign_id='$SUcampaign' and entry_type='$SUentry_type' and url_type='start' and active='Y' order by url_rank limit 1000;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00917',$user,$server_ip,$session_name,$one_mysql_log);} $VUM_ct = mysqli_num_rows($rslt); $k=0; while ($VUM_ct > $k) @@ -6128,7 +6131,7 @@ if ($ACTION == 'manDiaLnextCaLL') $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$state_descriptions';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00918',$user,$server_ip,$session_name,$one_mysql_log);} $SDE_ct = mysqli_num_rows($rslt); $state_debug .= "$SDE_ct|$stmt|\n"; if ($SDE_ct > 0) @@ -7605,7 +7608,7 @@ if ($ACTION == 'manDiaLonly') $stmt="SELECT url_rank,url_statuses,url_address,url_lists from vicidial_url_multi where campaign_id='$SUcampaign' and entry_type='$SUentry_type' and url_type='start' and active='Y' order by url_rank limit 1000;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00919',$user,$server_ip,$session_name,$one_mysql_log);} $VUM_ct = mysqli_num_rows($rslt); $k=0; while ($VUM_ct > $k) @@ -8108,6 +8111,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ($call_good > 0) { $stereo_ac="\n"; + $talk_sec_urls_sec=''; if ($stage != "YES") { $wait_sec=0; @@ -8148,6 +8152,23 @@ if ($ACTION == 'manDiaLlookCaLL') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00742',$user,$server_ip,$session_name,$one_mysql_log);} } + # Gather active talk_sec_urls and their trigger times + $stmt="SELECT distinct(url_call_length) FROM vicidial_url_multi where campaign_id='$campaign' and entry_type='campaign' and url_type='talk' and active='Y' and url_call_length > 0 order by url_call_length limit 1000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00920',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $camp_tsu_ct = mysqli_num_rows($rslt); + $tsu=0; + while ($camp_tsu_ct > $tsu) + { + $row=mysqli_fetch_row($rslt); + if ($tsu < 1) + {$talk_sec_urls_sec = 'TALKURLS-';} + $talk_sec_urls_sec .= $row[0]."-"; + $tsu++; + } + $talk_sec_urls_sec .= "\n"; + if ( (preg_match("/CUSTOMER|BOTH/",$stereo_recording)) and (preg_match("/^M/",$MDnextCID)) and ($SSstereo_recording > 0) ) { $stmt="SELECT conf_engine FROM servers where server_ip='$server_ip';"; @@ -8157,7 +8178,7 @@ if ($ACTION == 'manDiaLlookCaLL') { $stmt="SELECT stereo_recording,stereo_parallel_recording,stereo_rec_filename,stereo_recording_agent,parallel_rec_co_filename,parallel_rec_cm_filename,parallel_rec_fr_filename FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00921',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysqli_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -8179,7 +8200,7 @@ if ($ACTION == 'manDiaLlookCaLL') { $stmt="SELECT vendor_lead_code FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00922',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VM_mancall_ct = mysqli_num_rows($rslt); if ($VM_mancall_ct > 0) @@ -8215,7 +8236,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "INSERT INTO recording_log_parallel (channel,server_ip,extension,start_time,length_in_sec,filename,lead_id,user,vicidial_id,recording_status) values('$channel','$server_ip','','$NOW_TIME','0','$filename','$lead_id','$user','$uniqueid','START');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00923',$user,$server_ip,$session_name,$one_mysql_log);} $PRLaffected_rows = mysqli_affected_rows($link); if ($PRLaffected_rows > 0) { @@ -8227,7 +8248,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','MixMonitor','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Options: $stereo_recording_options','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00924',$user,$server_ip,$session_name,$one_mysql_log);} if ((preg_match("/CUSTOMER-ONLY/",$stereo_parallel_recording))) { @@ -8252,7 +8273,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$server_ip','SPCO','$NOW_TIME','$StarTtime','$temp_parallel_rec_co_filename','$lead_id','$user','$uniqueid')"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00925',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysqli_affected_rows($link); if ($RLaffected_rows > 0) { @@ -8264,20 +8285,20 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "UPDATE recording_log SET filename='$temp_parallel_rec_co_filename' where recording_id='$recording_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00926',$user,$server_ip,$session_name,$one_mysql_log);} } ### insert record into recording_log_stereo table ### $stmt = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$server_ip','$NOW_TIME','0','$temp_parallel_rec_co_filename','$lead_id','$campaign STEREO_PARALLEL CUSTOMER-ONLY $stereo_recording','vicidial_id: $uniqueid|user: $user|channel: $channel|','$parallel_recording_id','PARALLEL START');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00927',$user,$server_ip,$session_name,$one_mysql_log);} ### insert record into recording_live table ### $stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status) values('$recording_id','STEREO_PARALLEL CUSTOMER-ONLY','$server_ip','$NOW_TIME','$channel','$temp_parallel_rec_co_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00928',$user,$server_ip,$session_name,$one_mysql_log);} } if ((preg_match("/CUSTOMER-MUTED/",$stereo_parallel_recording))) @@ -8303,7 +8324,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$server_ip','SPCM','$NOW_TIME','$StarTtime','$temp_parallel_rec_cm_filename','$lead_id','$user','$uniqueid')"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00929',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysqli_affected_rows($link); if ($RLaffected_rows > 0) { @@ -8315,20 +8336,20 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "UPDATE recording_log SET filename='$temp_parallel_rec_cm_filename' where recording_id='$recording_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00930',$user,$server_ip,$session_name,$one_mysql_log);} } ### insert record into recording_log_stereo table ### $stmt = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$server_ip','$NOW_TIME','0','$temp_parallel_rec_cm_filename','$lead_id','$campaign STEREO_PARALLEL CUSTOMER-MUTED $stereo_recording','vicidial_id: $uniqueid|user: $user|channel: $channel|','$parallel_recording_id','PARALLEL START');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00931',$user,$server_ip,$session_name,$one_mysql_log);} ### insert record into recording_live table ### $stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status) values('$recording_id','STEREO_PARALLEL CUSTOMER-MUTED','$server_ip','$NOW_TIME','$channel','$temp_parallel_rec_cm_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00932',$user,$server_ip,$session_name,$one_mysql_log);} } if ((preg_match("/FULL-RECORDING/",$stereo_parallel_recording))) @@ -8354,7 +8375,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$server_ip','SPFR','$NOW_TIME','$StarTtime','$temp_parallel_rec_fr_filename','$lead_id','$user','$uniqueid')"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00933',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysqli_affected_rows($link); if ($RLaffected_rows > 0) { @@ -8366,20 +8387,20 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "UPDATE recording_log SET filename='$temp_parallel_rec_fr_filename' where recording_id='$recording_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00934',$user,$server_ip,$session_name,$one_mysql_log);} } ### insert record into recording_log_stereo table ### $stmt = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$server_ip','$NOW_TIME','0','$temp_parallel_rec_fr_filename','$lead_id','$campaign STEREO_PARALLEL FULL-RECORDING $stereo_recording','vicidial_id: $uniqueid|user: $user|channel: $channel|','$parallel_recording_id','PARALLEL START');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00935',$user,$server_ip,$session_name,$one_mysql_log);} ### insert record into recording_live table ### $stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status) values('$recording_id','STEREO_PARALLEL FULL-RECORDING','$server_ip','$NOW_TIME','$channel','$temp_parallel_rec_fr_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00936',$user,$server_ip,$session_name,$one_mysql_log);} } # insert logs for agent-controlled stereo call recordings while parallel recordings are enabled @@ -8399,7 +8420,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$server_ip','$stereo_exten','$NOW_TIME','$StarTtime','$temp_parallel_rec_ag_filename','$lead_id','$user','$uniqueid')"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00937',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysqli_affected_rows($link); if ($RLaffected_rows > 0) { @@ -8411,20 +8432,20 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "UPDATE recording_log SET filename='$temp_parallel_rec_ag_filename' where recording_id='$recording_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00938',$user,$server_ip,$session_name,$one_mysql_log);} } ### insert record into recording_log_stereo table ### $stmt = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$server_ip','$NOW_TIME','0','$temp_parallel_rec_ag_filename','$lead_id','$campaign STEREO_PARALLEL AGENT-CONTROLLED $stereo_recording','vicidial_id: $uniqueid|user: $user|channel: $channel|','$parallel_recording_id','PARALLEL START');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00939',$user,$server_ip,$session_name,$one_mysql_log);} ### insert record into recording_live table ### $stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status) values('$recording_id','STEREO_PARALLEL AGENT-CONTROLLED','$server_ip','$NOW_TIME','$channel','$temp_parallel_rec_ag_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00940',$user,$server_ip,$session_name,$one_mysql_log);} } if ((preg_match("/ONDEMAND/",$stereo_recording_agent))) { @@ -8441,7 +8462,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user,vicidial_id) values('$channel','$server_ip','SAC','$NOW_TIME','$StarTtime','$stereo_rec_filename','$lead_id','$user','$uniqueid')"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00941',$user,$server_ip,$session_name,$one_mysql_log);} $RLaffected_rows = mysqli_affected_rows($link); if ($RLaffected_rows > 0) { @@ -8453,7 +8474,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "UPDATE recording_log SET filename='$stereo_rec_filename' where recording_id='$recording_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00942',$user,$server_ip,$session_name,$one_mysql_log);} } $vmgr_callerid = substr($stereo_rec_filename, 0, 17) . '...'; @@ -8461,19 +8482,19 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','MixMonitor','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Options: $stereo_recording_options','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00943',$user,$server_ip,$session_name,$one_mysql_log);} ### insert record into recording_log_stereo table ### $stmt = "INSERT INTO recording_log_stereo (recording_id,server_ip,start_time,length_in_sec,filename,lead_id,options,processing_log,parallel_recording_id,recording_status) values('$recording_id','$server_ip','$NOW_TIME','0','$stereo_rec_filename','$lead_id','$campaign STEREO AGENT-CONTROLLED $stereo_recording','vicidial_id: $uniqueid|user: $user|channel: $channel|','$parallel_recording_id','START');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00944',$user,$server_ip,$session_name,$one_mysql_log);} ### insert record into recording_live table ### $stmt = "INSERT INTO recording_live (recording_id,recording_type,server_ip,start_time,channel,filename,lead_id,user,dtmf_muting_end_time,recording_status) values('$recording_id','STEREO AGENT-CONTROLLED','$server_ip','$NOW_TIME','$channel','$stereo_rec_filename','$lead_id','$user','2020-12-31 23:59:59','STARTED');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00945',$user,$server_ip,$session_name,$one_mysql_log);} if (preg_match("/CUSTOMER_ONLY/",$stereo_recording) ) { @@ -8481,7 +8502,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: write','State: 1','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00946',$user,$server_ip,$session_name,$one_mysql_log);} } if (preg_match("/CUSTOMER_MUTE/",$stereo_recording) ) { @@ -8489,7 +8510,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','MixMonitorMute','$vmgr_callerid','ActionID: $vmgr_callerid','Channel: $channel','Direction: read','State: 1','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00947',$user,$server_ip,$session_name,$one_mysql_log);} } } if ((preg_match("/ONDEMAND/",$stereo_recording_agent))) @@ -8665,7 +8686,7 @@ if ($ACTION == 'manDiaLlookCaLL') } ##### END SIP event logging, if enabled in the system ##### - echo "$call_output$sip_event_action_output$stereo_ac"; + echo "$call_output$sip_event_action_output$stereo_ac$talk_sec_urls_sec"; $stage .= " $uniqueid $channel"; } @@ -8681,7 +8702,7 @@ if ($ACTION == 'manDiaLlookCaLL') $stmt = "SELECT count(*) from vicidial_sip_event_recent where ( (caller_code='$MDnextCID') and ( (first_180_date IS NOT NULL) or (first_183_date IS NOT NULL) ) );"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00948',$user,$server_ip,$session_name,$one_mysql_log);} $MMRS_ct = mysqli_num_rows($rslt); if ($MMRS_ct > 0) { @@ -10045,12 +10066,12 @@ if ($stage == "end") $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','StopMixMonitor','SH123467$StarTtime','ActionID: SH123467$StarTtime','Channel: $channel','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00949',$user,$server_ip,$session_name,$one_mysql_log);} ### gather live recordings tied to this customer channel $stmt="SELECT recording_id,filename,start_time,UNIX_TIMESTAMP(start_time) from recording_live where channel='$channel' and lead_id='$lead_id' and recording_status='STARTED' and user='$user' and recording_type LIKE \"STEREO%\" limit 10;"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00950',$user,$server_ip,$session_name,$one_mysql_log);} $ST_rec_ct = mysqli_num_rows($rslt); $st=0; while ($ST_rec_ct > $st) @@ -10074,19 +10095,19 @@ if ($stage == "end") $stmt = "UPDATE recording_live SET end_time=NOW(),recording_status='FINISHED END-CALL' where recording_id='$STrecording_id[$st]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00951',$user,$server_ip,$session_name,$one_mysql_log);} ### update record in recording_log table ### $stmt = "UPDATE recording_log SET end_time=NOW(),end_epoch='$StarTtime',length_in_sec='$length_in_sec',length_in_min='$length_in_min' where recording_id='$STrecording_id[$st]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00952',$user,$server_ip,$session_name,$one_mysql_log);} ### update record in recording_log_stereo table ### $stmt = "UPDATE recording_log_stereo SET end_time=NOW(),recording_status='FINISHED END-CALL',length_in_sec='$length_in_sec' where recording_id='$STrecording_id[$st]';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00953',$user,$server_ip,$session_name,$one_mysql_log);} $st++; } @@ -10194,7 +10215,7 @@ if ($stage == "end") $stmt = "UPDATE recording_live set end_time='$NOW_TIME',recording_status='FINISHED END-CALL' where filename='$filename[$loop_count]' and recording_status='STARTED';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00954',$user,$server_ip,$session_name,$one_mysql_log);} echo "$recording_id|$length_in_min|"; @@ -10633,6 +10654,23 @@ if ($ACTION == 'VDADcheckINCOMING') $owner=$user; } + # Gather active talk_sec_urls and their trigger times + $talk_sec_urls_secs = ''; + $stmt="SELECT distinct(url_call_length) FROM vicidial_url_multi where campaign_id='$campaign' and entry_type='campaign' and url_type='talk' and active='Y' and url_call_length > 0 order by url_call_length limit 1000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00955',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $camp_tsu_ct = mysqli_num_rows($rslt); + $tsu=0; + while ($camp_tsu_ct > $tsu) + { + $row=mysqli_fetch_row($rslt); + if ($tsu < 1) + {$talk_sec_urls_secs .= "-";} + $talk_sec_urls_secs .= "$row[0]-"; + $tsu++; + } + ### update the lead status to INCALL $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' $ownerSQL where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} @@ -10924,7 +10962,7 @@ if ($ACTION == 'VDADcheckINCOMING') } } - echo "$VDCL_group_web|$VDCL_group_name||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination|||||||$VDCL_group_web_three|$VDCL_ingroup_script_color|||$VDCL_campaign_script_two|$VDCL_ingroup_script_color_two|||$stereo_recording|$stereo_recording_agent|\n|\n"; + echo "$VDCL_group_web|$VDCL_group_name||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X||||$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination|||||||$VDCL_group_web_three|$VDCL_ingroup_script_color|||$VDCL_campaign_script_two|$VDCL_ingroup_script_color_two|||$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|\n|\n"; if (preg_match('/X/',$dialed_label)) { @@ -10984,7 +11022,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt = "SELECT user from vicidial_xfer_log where xfercallid='$INxfercallid' limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00956',$user,$server_ip,$session_name,$one_mysql_log);} $VDCL_vxl_ct = mysqli_num_rows($rslt); if ($VDCL_vxl_ct > 0) { @@ -11094,6 +11132,39 @@ if ($ACTION == 'VDADcheckINCOMING') $status_group_gather_data = status_group_gather($row[27],'INGROUP'); + # Gather active talk_sec_urls and their trigger times + $IGtalk_sec_urls_secs = ''; + $stmt="SELECT distinct(url_call_length) FROM vicidial_url_multi where campaign_id='$VDADchannel_group' and entry_type='ingroup' and url_type='talk' and active='Y' and url_call_length > 0 order by url_call_length limit 1000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00957',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $camp_tsu_ct = mysqli_num_rows($rslt); + $tsu=0; + while ($camp_tsu_ct > $tsu) + { + $row=mysqli_fetch_row($rslt); + if ($tsu < 1) + {$IGtalk_sec_urls_secs .= "-";} + $IGtalk_sec_urls_secs .= "$row[0]-"; + $tsu++; + } + # check if this In-Group has talk seconds urls set to -FORCEDISABLE- + $force_disable=0; + $stmt = "SELECT count(*) from vicidial_url_multi where campaign_id='$VDADchannel_group' and entry_type='ingroup' and url_type='talk' and active='N' and url_address LIKE \"%FORCEDISABLE%\";"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $fdtu_field_ct = mysqli_num_rows($rslt); + if ($fdtu_field_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $force_disable = $row[0]; + } + if (strlen($IGtalk_sec_urls_secs) > 0) + {$talk_sec_urls_secs = $IGtalk_sec_urls_secs;} + if ($force_disable > 0) + {$talk_sec_urls_secs = '';} + $stmt = "SELECT campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination,default_xfer_group,campaign_script_two,browser_alert_sound,browser_alert_volume,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_campaigns where campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); @@ -11444,8 +11515,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|\n";} - else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_inbound_survey|$VDCL_survey_participate|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$VDCL_browser_alert_sound|$VDCL_browser_alert_volume|$stereo_recording|$stereo_recording_agent|$talk_sec_urls_secs|\n";} if (strlen($fronter) < 2) {$fronter = $tsr;} $stmt = "SELECT full_name from vicidial_users where user='$fronter';"; @@ -11498,7 +11569,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$state_descriptions';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00958',$user,$server_ip,$session_name,$one_mysql_log);} $SDE_ct = mysqli_num_rows($rslt); $state_debug .= "$NOW_TIME|$SDE_ct|$stmt|\n"; if ($SDE_ct > 0) @@ -11751,7 +11822,7 @@ if ($ACTION == 'VDADcheckINCOMING') $stmt="SELECT url_rank,url_statuses,url_address,url_lists from vicidial_url_multi where campaign_id='$SUcampaign' and entry_type='$SUentry_type' and url_type='start' and active='Y' order by url_rank limit 1000;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00959',$user,$server_ip,$session_name,$one_mysql_log);} $VUM_ct = mysqli_num_rows($rslt); $k=0; while ($VUM_ct > $k) @@ -12245,7 +12316,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') # Gather list of In-Groups for this user that have hit the daily limit, so we can exclude them $stmt="SELECT group_id FROM vicidial_inbound_group_agents WHERE user='$user' and ( (daily_limit > -1) and (daily_limit <= calls_today) ) limit 1000;"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00960',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_hit_limit_ingroups_ct = mysqli_num_rows($rslt); $VD_hit_limit_ingroups="'',"; @@ -12617,7 +12688,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') $stmt = "SELECT calls_today,daily_limit from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00961',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cidgwv_ct = mysqli_num_rows($rslt); if ($VDIG_cidgwv_ct > 0) { @@ -12632,7 +12703,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') $stmt = "SELECT outbound_autodial,closer_campaigns FROM vicidial_live_agents where user='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00962',$user,$server_ip,$session_name,$one_mysql_log);} $VDIG_cidgwv_ct = mysqli_num_rows($rslt); if ($VDIG_cidgwv_ct > 0) { @@ -12663,21 +12734,21 @@ if ($ACTION == 'VDADcheckINCOMINGother') $stmtA = "UPDATE vicidial_live_agents set external_ingroups='$ADcloser_campaigns',external_blended='$outbound_autodial',external_igb_set_user='VDIC',manager_ingroup_set='SET' where user='$user';"; if ($DB) {echo "$stmtA\n";} $rslt=mysql_to_mysqli($stmtA, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtA,'00963',$user,$server_ip,$session_name,$one_mysql_log);} $vla_update = mysqli_affected_rows($link); ### delete the vicidial_live_inbound_agents record for this user/in-group $stmtB = "DELETE FROM vicidial_live_inbound_agents where user='$user' and group_id='$VDADchannel_group';"; if ($DB) {echo "$stmtB\n";} $rslt=mysql_to_mysqli($stmtB, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtB,'00964',$user,$server_ip,$session_name,$one_mysql_log);} $vlia_delete = mysqli_affected_rows($link); $SQL_log = "$stmtA|$stmtB"; $SQL_log = preg_replace("/'|%/",'',$SQL_log); $stmtC = "INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$VARserver_ip', event_section='USERS', event_type='MODIFY', record_id='$user', event_code='DAILY LIMIT MODIFY USER', event_sql='$SQL_log', event_notes='|$VDADchannel_group|$VDCL_daily_limit <= $VDCL_calls_today|$user|IC|$closer_campaigns|$outbound_autodial|$vla_update|$vlia_delete|';"; $rslt=mysql_to_mysqli($stmtC, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtC,'00965',$user,$server_ip,$session_name,$one_mysql_log);} $affected_rowsC = mysqli_affected_rows($link); if ($DB) {echo "-- DAILY LIMIT IN-GROUP CALLS TRIGGER: |$VDADchannel_group|$VDCL_daily_limit <= $VDCL_calls_today|$user|IC|$closer_campaigns|$outbound_autodial|$vla_update|$vlia_delete|";} } @@ -12754,7 +12825,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') $stmt = "SELECT user from vicidial_xfer_log where xfercallid='$INxfercallid' limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00966',$user,$server_ip,$session_name,$one_mysql_log);} $VDCL_vxl_ct = mysqli_num_rows($rslt); if ($VDCL_vxl_ct > 0) { @@ -12765,6 +12836,23 @@ if ($ACTION == 'VDADcheckINCOMINGother') } } + # Gather active talk_sec_urls and their trigger times for the campaign + $talk_sec_urls_secs = ''; + $stmt="SELECT distinct(url_call_length) FROM vicidial_url_multi where campaign_id='$campaign' and entry_type='campaign' and url_type='talk' and active='Y' and url_call_length > 0 order by url_call_length limit 1000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00955',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $camp_tsu_ct = mysqli_num_rows($rslt); + $tsu=0; + while ($camp_tsu_ct > $tsu) + { + $row=mysqli_fetch_row($rslt); + if ($tsu < 1) + {$talk_sec_urls_secs .= "-";} + $talk_sec_urls_secs .= "$row[0]-"; + $tsu++; + } + $stmt = "SELECT count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); @@ -12901,6 +12989,39 @@ if ($ACTION == 'VDADcheckINCOMINGother') } } + # Gather active talk_sec_urls and their trigger times + $IGtalk_sec_urls_secs = ''; + $stmt="SELECT distinct(url_call_length) FROM vicidial_url_multi where campaign_id='$VDADchannel_group' and entry_type='ingroup' and url_type='talk' and active='Y' and url_call_length > 0 order by url_call_length limit 1000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00957',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $camp_tsu_ct = mysqli_num_rows($rslt); + $tsu=0; + while ($camp_tsu_ct > $tsu) + { + $row=mysqli_fetch_row($rslt); + if ($tsu < 1) + {$IGtalk_sec_urls_secs .= "-";} + $IGtalk_sec_urls_secs .= "$row[0]-"; + $tsu++; + } + # check if this In-Group has talk seconds urls set to -FORCEDISABLE- + $force_disable=0; + $stmt = "SELECT count(*) from vicidial_url_multi where campaign_id='$VDADchannel_group' and entry_type='ingroup' and url_type='talk' and active='N' and url_address LIKE \"%FORCEDISABLE%\";"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $fdtu_field_ct = mysqli_num_rows($rslt); + if ($fdtu_field_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $force_disable = $row[0]; + } + if (strlen($IGtalk_sec_urls_secs) > 0) + {$talk_sec_urls_secs = $IGtalk_sec_urls_secs;} + if ($force_disable > 0) + {$talk_sec_urls_secs = '';} + ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set last_inbound_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} @@ -13057,7 +13178,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$state_descriptions';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00967',$user,$server_ip,$session_name,$one_mysql_log);} $SDE_ct = mysqli_num_rows($rslt); $state_debug .= "$SDE_ct|$stmt|\n"; if ($SDE_ct > 0) @@ -13134,8 +13255,8 @@ if ($ACTION == 'VDADcheckINCOMINGother') } ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|\n";} - else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$talk_sec_urls_secs|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|$VDCL_group_web_three|$VDCL_ingroup_script_color|$VDCL_ingroup_script_two|$VDCL_ingroup_script_color_two|$talk_sec_urls_secs|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -13357,7 +13478,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') $stmt="SELECT url_rank,url_statuses,url_address,url_lists from vicidial_url_multi where campaign_id='$SUcampaign' and entry_type='$SUentry_type' and url_type='start' and active='Y' order by url_rank limit 1000;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00968',$user,$server_ip,$session_name,$one_mysql_log);} $VUM_ct = mysqli_num_rows($rslt); $k=0; while ($VUM_ct > $k) @@ -14353,7 +14474,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE') $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$state_descriptions';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00969',$user,$server_ip,$session_name,$one_mysql_log);} $SDE_ct = mysqli_num_rows($rslt); $state_debug .= "$SDE_ct|$stmt|\n"; if ($SDE_ct > 0) @@ -16445,7 +16566,7 @@ if ($ACTION == 'updateDISPO') $stmt = "SELECT user from vicidial_xfer_log where xfercallid='$INxfercallid' limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00970',$user,$server_ip,$session_name,$one_mysql_log);} $VDCL_vxl_ct = mysqli_num_rows($rslt); if ($VDCL_vxl_ct > 0) { @@ -17497,6 +17618,522 @@ if ($ACTION == 'DEADtriggerURL') } +################################################################################ +### TALKsecURL - Talk Seconds URLs run +################################################################################ +if ($ACTION == 'TALKsecURL') + { + ############################################ + ### BEGIN Issue Talk Seconds URL if defined + ############################################ + $talk_sec_url_count=0; + $talk_sec_urlARY = array(); + $talk_sec_urlARY[0]=''; + $talk_urls=''; + $talk_time = $customer_sec; + $talk_time_ms=0; + $talk_time_min=0; + $force_disable=0; + + $talk_time_ms = ($customer_sec * 1000); + $talk_time_min = ceil($customer_sec / 60); + + $DUentry_type = 'campaign'; + $VDADchannel_group=$campaign; + if ($inOUT == 'IN') + { + $DUentry_type = 'ingroup'; + $VDADchannel_group=$group; + + # check if this In-Group has talk seconds urls set to -FORCEDISABLE- + $stmt = "SELECT count(*) from vicidial_url_multi where campaign_id='$VDADchannel_group' and entry_type='$DUentry_type' and url_type='talk' and active='N' and url_address LIKE \"%FORCEDISABLE%\";"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $fdtu_field_ct = mysqli_num_rows($rslt); + if ($fdtu_field_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $force_disable = $row[0]; + } + + if ($force_disable < 1) + { + # check for In-Group talk_sec_urls + $stmt="SELECT url_rank,url_statuses,url_address,url_lists,url_call_length from vicidial_url_multi where campaign_id='$VDADchannel_group' and entry_type='$DUentry_type' and url_type='talk' and active='Y' and url_call_length='$customer_sec' order by url_rank limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00971',$user,$server_ip,$session_name,$one_mysql_log);} + $VUM_ct = mysqli_num_rows($rslt); + $k=0; + while ($VUM_ct > $k) + { + $row=mysqli_fetch_row($rslt); + $url_rank = $row[0]; + $url_statuses = " $row[1] "; + $url_address = $row[2]; + $url_lists = " $row[3] "; + $url_call_length = $row[4]; + + if ( (strlen($url_lists)<3) or ( (strlen($url_lists)>2) and (preg_match("/ $list_id /",$url_lists)) ) ) + { + $talk_sec_urlARY[$talk_sec_url_count] = $url_address; + $talk_sec_url_count++; + } + $k++; + } + } + } + + if ( ($talk_sec_url_count < 1) and ($force_disable < 1) ) + { + $DUentry_type = 'campaign'; + $VDADchannel_group=$campaign; + # check for Campaign talk_sec_urls + $stmt="SELECT url_rank,url_statuses,url_address,url_lists,url_call_length from vicidial_url_multi where campaign_id='$VDADchannel_group' and entry_type='$DUentry_type' and url_type='talk' and active='Y' and url_call_length='$customer_sec' order by url_rank limit 1000;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00971',$user,$server_ip,$session_name,$one_mysql_log);} + $VUM_ct = mysqli_num_rows($rslt); + $k=0; + while ($VUM_ct > $k) + { + $row=mysqli_fetch_row($rslt); + $url_rank = $row[0]; + $url_statuses = " $row[1] "; + $url_address = $row[2]; + $url_lists = " $row[3] "; + $url_call_length = $row[4]; + + if ( (strlen($url_lists)<3) or ( (strlen($url_lists)>2) and (preg_match("/ $list_id /",$url_lists)) ) ) + { + $talk_sec_urlARY[$talk_sec_url_count] = $url_address; + $talk_sec_url_count++; + } + $k++; + } + } + + ### loop through each Talk Seconds URL entry and process ### + $j=0; + while ($talk_sec_url_count > $j) + { + if ( (preg_match('/--A--user_custom_/i',$talk_sec_urlARY[$j])) or (preg_match('/--A--fullname/i',$talk_sec_urlARY[$j])) or (preg_match('/--A--user_group/i',$talk_sec_urlARY[$j])) ) + { + $stmt = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five,full_name,user_group from vicidial_users where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00972',$user,$server_ip,$session_name,$one_mysql_log);} + $VUC_ct = mysqli_num_rows($rslt); + if ($VUC_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $user_custom_one = urlencode(trim($row[0])); + $user_custom_two = urlencode(trim($row[1])); + $user_custom_three = urlencode(trim($row[2])); + $user_custom_four = urlencode(trim($row[3])); + $user_custom_five = urlencode(trim($row[4])); + $fullname = urlencode(trim($row[5])); + $user_group = urlencode(trim($row[6])); + } + } + + if (preg_match('/--A--dialed_|--A--term_reason--B--/i',$talk_sec_urlARY[$j])) + { + $dialed_number = $phone_number; + $dialed_label = 'NONE'; + $term_reason = 'NONE'; + + if ($inOUT=='OUT') + { + ### find the dialed number and label for this call + $stmt = "SELECT phone_number,alt_dial,term_reason from vicidial_log where uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00973',$user,$server_ip,$session_name,$one_mysql_log);} + $vl_dialed_ct = mysqli_num_rows($rslt); + if ($vl_dialed_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $dialed_number = $row[0]; + $dialed_label = $row[1]; + $term_reason = $row[2]; + } + } + } + + if (preg_match('/--A--did_/i',$talk_sec_urlARY[$j])) + { + $DID_id=''; + $DID_extension=''; + $DID_pattern=''; + $DID_description=''; + + $stmt = "SELECT did_id,extension from vicidial_did_log where uniqueid='$uniqueid' and caller_id_number='$phone_number' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00974',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIDL_ct = mysqli_num_rows($rslt); + if ($VDIDL_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $DID_id = $row[0]; + $DID_extension = $row[1]; + + $stmt = "SELECT did_pattern,did_description,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00975',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIDL_ct = mysqli_num_rows($rslt); + if ($VDIDL_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $DID_pattern = urlencode(trim($row[0])); + $DID_description = urlencode(trim($row[1])); + $DID_custom_one = urlencode(trim($row[2])); + $DID_custom_two= urlencode(trim($row[3])); + $DID_custom_three= urlencode(trim($row[4])); + $DID_custom_four= urlencode(trim($row[5])); + $DID_custom_five= urlencode(trim($row[6])); + } + } + } + + if ( (preg_match('/callid--B--/i',$talk_sec_urlARY[$j])) or (preg_match('/group--B--|--A--term_reason--B--/i',$talk_sec_urlARY[$j])) or (preg_match('/fronter--B--|closer--B--/i',$talk_sec_urlARY[$j])) ) + { + $INclosecallid=''; + $INxfercallid=''; + $VDADchannel_group=$campaign; + $stmt = "SELECT campaign_id,closecallid,xfercallid,term_reason from vicidial_closer_log where uniqueid='$uniqueid' and user='$user' order by closecallid desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00976',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysqli_num_rows($rslt); + if ($VDCL_mvac_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $VDADchannel_group = $row[0]; + $INclosecallid = $row[1]; + $INxfercallid = $row[2]; + $term_reason = $row[3]; + } + if ( (strlen($INxfercallid) > 0) and ($INxfercallid > 0) and (preg_match('/fronter--B--|closer--B--/i',$talk_sec_urlARY[$j])) ) + { + # check for fronter in vicidial_xfer_log + $stmt = "SELECT user from vicidial_xfer_log where xfercallid='$INxfercallid' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00977',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_vxl_ct = mysqli_num_rows($rslt); + if ($VDCL_vxl_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $fronter = $row[0]; + $closer = $user; + } + } + } + + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00978',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $entry_date = urlencode(trim($row[1])); + $dispo = urlencode(trim($row[3])); + $tsr = urlencode(trim($row[4])); + $vendor_id = urlencode(trim($row[5])); + $vendor_lead_code = urlencode(trim($row[5])); + $source_id = urlencode(trim($row[6])); + $list_id = urlencode(trim($row[7])); + $gmt_offset_now = urlencode(trim($row[8])); + $phone_code = urlencode(trim($row[10])); + $phone_number = urlencode(trim($row[11])); + $title = urlencode(trim($row[12])); + $first_name = urlencode(trim($row[13])); + $middle_initial = urlencode(trim($row[14])); + $last_name = urlencode(trim($row[15])); + $address1 = urlencode(trim($row[16])); + $address2 = urlencode(trim($row[17])); + $address3 = urlencode(trim($row[18])); + $city = urlencode(trim($row[19])); + $state = urlencode(trim($row[20])); + $province = urlencode(trim($row[21])); + $postal_code = urlencode(trim($row[22])); + $country_code = urlencode(trim($row[23])); + $gender = urlencode(trim($row[24])); + $date_of_birth = urlencode(trim($row[25])); + $alt_phone = urlencode(trim($row[26])); + $email = urlencode(trim($row[27])); + $security_phrase = urlencode(trim($row[28])); + $comments = urlencode(trim($row[29])); + $called_count = urlencode(trim($row[30])); + $call_date = urlencode(trim($row[31])); + $rank = urlencode(trim($row[32])); + $owner = urlencode(trim($row[33])); + $entry_list_id = urlencode(trim($row[34])); + } + + if (preg_match('/list_name--B--|list_description--B--/i',$talk_sec_urlARY[$j])) + { + $stmt = "SELECT list_name,list_description from vicidial_lists where list_id='$list_id' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00797',$user,$server_ip,$session_name,$one_mysql_log);} + $VL_ln_ct = mysqli_num_rows($rslt); + if ($VL_ln_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $list_name = urlencode(trim($row[0])); + $list_description = urlencode(trim($row[1])); + } + } + + $talk_sec_urlARY[$j] = preg_replace('/^VAR/','',$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--lead_id--B--/i',"$lead_id",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_lead_code",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--list_id--B--/i',"$list_id",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--list_name--B--/i',"$list_name",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--list_description--B--/i',"$list_description",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--gmt_offset_now--B--/i',"$gmt_offset_now",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--phone_code--B--/i',"$phone_code",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--phone_number--B--/i',"$phone_number",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--title--B--/i',"$title",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--first_name--B--/i',"$first_name",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--last_name--B--/i',"$last_name",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--address1--B--/i',"$address1",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--address2--B--/i',"$address2",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--address3--B--/i',"$address3",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--city--B--/i',"$city",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--state--B--/i',"$state",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--province--B--/i',"$province",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--postal_code--B--/i',"$postal_code",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--country_code--B--/i',"$country_code",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--gender--B--/i',"$gender",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--date_of_birth--B--/i',"$date_of_birth",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--alt_phone--B--/i',"$alt_phone",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--email--B--/i',"$email",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--security_phrase--B--/i',"$security_phrase",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--comments--B--/i',"$comments",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--user--B--/i',"$user",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--pass--B--/i',"$orig_pass",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--campaign--B--/i',"$campaign",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--phone_login--B--/i',"$phone_login",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--original_phone_login--B--/i',"$original_phone_login",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--phone_pass--B--/i',"$phone_pass",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--fronter--B--/i',"$fronter",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--closer--B--/i',"$closer",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--group--B--/i',"$VDADchannel_group",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--channel_group--B--/i',"$VDADchannel_group",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--SQLdate--B--/i',urlencode(trim($SQLdate)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--epoch--B--/i',"$epoch",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--uniqueid--B--/i',"$uniqueid",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--customer_zap_channel--B--/i',urlencode(trim($customer_zap_channel)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--customer_server_ip--B--/i',"$customer_server_ip",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--server_ip--B--/i',"$server_ip",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--SIPexten--B--/i',urlencode(trim($exten)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--session_id--B--/i',"$conf_exten",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--phone--B--/i',"$phone_number",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--parked_by--B--/i',"$parked_by",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--dispo--B--/i',"$dispo",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--dispo_name--B--/i',"$dispo_name",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--dialed_number--B--/i',"$dialed_number",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--dialed_label--B--/i',"$dialed_label",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--source_id--B--/i',"$source_id",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--rank--B--/i',"$rank",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--owner--B--/i',"$owner",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--camp_script--B--/i',"$camp_script",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--in_script--B--/i',"$in_script",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--fullname--B--/i',"$fullname",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--user_custom_one--B--/i',"$user_custom_one",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--user_custom_two--B--/i',"$user_custom_two",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--user_custom_three--B--/i',"$user_custom_three",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--user_custom_four--B--/i',"$user_custom_four",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--user_custom_five--B--/i',"$user_custom_five",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--camp_custom_one--B--/i',"$camp_custom_one",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--camp_custom_two--B--/i',"$camp_custom_two",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--camp_custom_three--B--/i',"$camp_custom_three",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--camp_custom_four--B--/i',"$camp_custom_four",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--camp_custom_five--B--/i',"$camp_custom_five",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--talk_time--B--/i',"$talk_time",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--talk_time_ms--B--/i',"$talk_time_ms",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--talk_time_min--B--/i',"$talk_time_min",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--agent_log_id--B--/i',"$CALL_agent_log_id",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--entry_list_id--B--/i',"$entry_list_id",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_id--B--/i',urlencode(trim($DID_id)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_extension--B--/i',urlencode(trim($DID_extension)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_pattern--B--/i',urlencode(trim($DID_pattern)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_description--B--/i',urlencode(trim($DID_description)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--closecallid--B--/i',urlencode(trim($INclosecallid)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--xfercallid--B--/i',urlencode(trim($INxfercallid)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--call_id--B--/i',urlencode(trim($MDnextCID)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--call_notes--B--/i',"$url_call_notes",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--recording_id--B--/i',"$recording_id",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--entry_date--B--/i',"$entry_date",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_custom_one--B--/i',urlencode(trim($DID_custom_one)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_custom_two--B--/i',urlencode(trim($DID_custom_two)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_custom_three--B--/i',urlencode(trim($DID_custom_three)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_custom_four--B--/i',urlencode(trim($DID_custom_four)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--ig_custom_one--B--/i',urlencode(trim($ig_custom_one)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--ig_custom_two--B--/i',urlencode(trim($ig_custom_two)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--ig_custom_three--B--/i',urlencode(trim($ig_custom_three)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--ig_custom_four--B--/i',urlencode(trim($ig_custom_four)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--ig_custom_five--B--/i',urlencode(trim($ig_custom_five)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--agent_email--B--/i',urlencode(trim($agent_email)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--callback_lead_status--B--/i',urlencode(trim($CallBackLeadStatus)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--callback_datetime--B--/i',urlencode(trim($CallBackDatETimE)),$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--called_count--B--/i',"$called_count",$talk_sec_urlARY[$j]); + $talk_sec_urlARY[$j] = preg_replace('/--A--term_reason--B--/i',"$term_reason",$talk_sec_urlARY[$j]); + + if (strlen($FORMcustom_field_names)>2) + { + $custom_field_names = preg_replace("/^\||\|$/",'',$FORMcustom_field_names); + $custom_field_names = preg_replace("/\|.*_DUPLICATE_.*\|/",'|',$custom_field_names); + $custom_field_names = preg_replace("/\|/",",",$custom_field_names); + $custom_field_names_ARY = explode(',',$custom_field_names); + $custom_field_names_ct = count($custom_field_names_ARY); + $custom_field_names_SQL = $custom_field_names; + + if (preg_match("/cf_encrypt/",$active_modules)) + { + $enc_fields=0; + $stmt = "SELECT count(*) from vicidial_lists_fields where field_encrypt='Y' and list_id='$entry_list_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enc_field_ct = mysqli_num_rows($rslt); + if ($enc_field_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $enc_fields = $row[0]; + } + if ($enc_fields > 0) + { + $stmt = "SELECT field_label from vicidial_lists_fields where field_encrypt='Y' and list_id='$entry_list_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enc_field_ct = mysqli_num_rows($rslt); + $r=0; + while ($enc_field_ct > $r) + { + $row=mysqli_fetch_row($rslt); + $encrypt_list .= "$row[0],"; + $r++; + } + $encrypt_list = ",$encrypt_list"; + } + } + + + ##### BEGIN grab the data from custom table for the lead_id + if ($entry_list_id > 0) + { + $stmt="SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00980',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysqli_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $o=0; + while ($custom_field_names_ct > $o) + { + $field_name_id = $custom_field_names_ARY[$o]; + $field_name_tag = "--A--" . $field_name_id . "--B--"; + if ($enc_fields > 0) + { + $field_enc=''; $field_enc_all=''; + if ($DB) {echo "|$column_list|$encrypt_list|\n";} + if ( (preg_match("/,$field_name_id,/",$encrypt_list)) and (strlen($row[$o]) > 0) ) + { + exec("../agc/aes.pl --decrypt --text=$row[$o]", $field_enc); + $field_enc_ct = count($field_enc); + $k=0; + while ($field_enc_ct > $k) + { + $field_enc_all .= $field_enc[$k]; + $k++; + } + $field_enc_all = preg_replace("/CRYPT: |\n|\r|\t/",'',$field_enc_all); + $row[$o] = base64_decode($field_enc_all); + } + } + $form_field_value = urlencode(trim("$row[$o]")); + + $talk_sec_urlARY[$j] = preg_replace("/$field_name_tag/i","$form_field_value",$talk_sec_urlARY[$j]); + $o++; + } + } + } + } + + ### insert a new url log entry + $stmt = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date=NOW(),url_type='talk_sec',url='" . mysqli_real_escape_string($link, $talk_sec_urlARY[$j]) . "',url_response='';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00981',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysqli_affected_rows($link); + $url_id = mysqli_insert_id($link); + + $URLstart_sec = date("U"); + + ### send talk_sec_url ### + if ($DB > 0) {echo "$talk_sec_urlARY[$j]
\n";} + + $talk_urls .= "$url_id|"; + + $URLstart_sec = date("U"); + + $SCUfile = file("$talk_sec_urlARY[$j]"); + if ( !($SCUfile) ) + { + $error_array = error_get_last(); + $error_type = $error_array["type"]; + $error_message = $error_array["message"]; + $error_line = $error_array["line"]; + $error_file = $error_array["file"]; + } + + if ($DB > 0) {echo "$SCUfile[0]
\n";} + + ### update url log entry + $URLend_sec = date("U"); + $URLdiff_sec = ($URLend_sec - $URLstart_sec); + if ($SCUfile) + { + $SCUfile_contents = implode("", $SCUfile); + $SCUfile_contents = preg_replace('/;/','',$SCUfile_contents); + $SCUfile_contents = addslashes($SCUfile_contents); + } + else + { + $SCUfile_contents = "PHP ERROR: Type=$error_type - Message=$error_message - Line=$error_line - File=$error_file"; + } + $stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00982',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysqli_affected_rows($link); + + $j++; + } + echo "Talk Seconds URLs:\n$talk_urls\n"; + ############################################ + ### END Issue Talk Seconds URLs if defined + ############################################ + $stage .= "|$inOUT|$customer_sec|"; + } + + ################################################################################ ### RUNurls - request the URLs that are queued up to run for this call ################################################################################ @@ -19420,7 +20057,7 @@ if ($ACTION == 'CALLLOGview') $stmt="SELECT user_group from vicidial_users where user='$user';"; if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00983',$user,$server_ip,$session_name,$one_mysql_log);} $cl_user_ct = mysqli_num_rows($rslt); if ($cl_user_ct > 0) { @@ -19429,7 +20066,7 @@ if ($ACTION == 'CALLLOGview') } $stmt="SELECT agent_call_log_view from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00984',$user,$server_ip,$session_name,$one_mysql_log);} $cl_ug_ct = mysqli_num_rows($rslt); if ($cl_ug_ct > 0) { @@ -19439,7 +20076,7 @@ if ($ACTION == 'CALLLOGview') } $stmt="SELECT call_log_days from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00985',$user,$server_ip,$session_name,$one_mysql_log);} $cl_camp_ct = mysqli_num_rows($rslt); if ($cl_camp_ct > 0) { @@ -20033,7 +20670,7 @@ if ($ACTION == 'SEARCHRESULTSview') { $stmt="SELECT agent_search_list from vicidial_inbound_groups where group_id='$inbound_ingroup' and agent_search_list != '';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00986',$user,$server_ip,$session_name,$one_mysql_log);} $igs_to_parse = mysqli_num_rows($rslt); if ($igs_to_parse > 0) { @@ -22742,7 +23379,7 @@ function manual_dccl_check($temp_lead_id, $temp_no_hopper, $temp_dial_only, $tem if ($temp_dial_only > 0) {$temp_daily_call_count_limit = ($daily_phone_number_call_limit + 1);} $stmt="SELECT called_count FROM vicidial_phone_number_call_daily_counts where phone_number='$temp_phone_number';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00987',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vlcdc_ct = mysqli_num_rows($rslt); if ($vlcdc_ct > 0) @@ -22754,7 +23391,7 @@ function manual_dccl_check($temp_lead_id, $temp_no_hopper, $temp_dial_only, $tem $stmt = "UPDATE vicidial_list set called_since_last_reset='Y' where lead_id='$lead_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00988',$user,$server_ip,$session_name,$one_mysql_log);} if ($temp_no_hopper > 0) { @@ -22762,7 +23399,7 @@ function manual_dccl_check($temp_lead_id, $temp_no_hopper, $temp_dial_only, $tem $stmt="UPDATE vicidial_agent_log set lead_id=NULL,comments='' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00989',$user,$server_ip,$session_name,$one_mysql_log);} echo " NO-HOPPER DAILY PHONE NUMBER CALL LIMIT\nTRY AGAIN\n"; $stage .= "|$agent_log_id|$vla_status|$agent_dialed_type|$agent_dialed_number|"; diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index ea85c312..08143b4d 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -749,13 +749,14 @@ # 250806-0859 - Added manual_dial_lead_id 'ONLY' option and user override setting # 250808-1322 - Added agent_man_dial_filter & agent_3way_dial_filter system settings # 250916-2055 - Added stereo recording features +# 250924-0953 - Added Talk Seconds URLs features # -$version = '2.14-715c'; -$build = '250916-2055'; +$version = '2.14-716c'; +$build = '250924-0953'; $php_script = 'vicidial.php'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=103; +$mysql_log_count=108; $one_mysql_log=0; $DB=0; $conf_table = "vicidial_conferences"; @@ -1156,7 +1157,7 @@ if (preg_match("/1|2/",$SSagent_hide_dial_fail)) $agent_hide_dial_fail_MESSAGE='Dial Failed'; $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='FAILED_DIAL_MESSAGE_OVERRIDE';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01104',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $stde_ct = mysqli_num_rows($rslt); if ($stde_ct > 0) @@ -1820,7 +1821,7 @@ else $stmt="SELECT count(*) from vicidial_two_factor_auth where user='$VD_login' and auth_stage='1' and auth_exp_date > NOW();"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01105',$VD_login,$server_ip,$session_name,$one_mysql_log);} $auth_check_to_print = mysqli_num_rows($rslt); if ($auth_check_to_print < 1) {$VALID_2FA=0;} @@ -1844,7 +1845,7 @@ else $stmt="SELECT full_name,email,mobile_number,user_group from vicidial_users where user='$VD_login' and active='Y' and api_only_user != '1';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01106',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $LOGfullname = $row[0]; $LOGemail = $row[1]; @@ -3395,7 +3396,7 @@ else { $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$state_descriptions';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01107',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $stde_ct = mysqli_num_rows($rslt); if ($stde_ct > 0) @@ -3881,7 +3882,7 @@ else # Gather list of In-Groups for this user that have hit the daily limit, so we can exclude them $stmt="SELECT group_id FROM vicidial_inbound_group_agents WHERE user='$VD_login' and ( (daily_limit > -1) and (daily_limit <= calls_today) ) limit 1000;"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01108',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_hit_limit_ingroups_ct = mysqli_num_rows($rslt); $VD_hit_limit_ingroups="'',"; @@ -6318,6 +6319,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var conf_channels_xtra_display = 0; var display_message = ''; var web_form_vars = ''; + var talk_url_vars = ''; var Nactiveext; var Nbusytrunk; var Nbusyext; @@ -6862,6 +6864,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var HTheightS=''; var agent_hide_dial_fail=''; var agent_hide_dial_fail_MESSAGE=""; + var talk_sec_url_secs=''; var DiaLControl_auto_HTML = "\" border=\"0\" alt=\"You are paused\" />"; var DiaLControl_auto_HTML_ready = "\" border=\"0\" alt=\"You are active\" />"; var DiaLControl_auto_HTML_OFF = "\" border=\"0\" alt=\"pause button disabled\" />"; @@ -11612,12 +11615,10 @@ function set_length(SLnumber,SLlength_goal,SLdirection) { var MDlookResponse = null; // alert(xmlhttp.responseText); - var debug_response = xmlhttp.responseText; var REGcommentsDBNL = new RegExp("\n","g"); debug_response = debug_response.replace(REGcommentsDBNL, "
"); // document.getElementById("debugbottomspan").innerHTML = "
|" + manDiaLlook_query + "|
\n" + debug_response; - MDlookResponse = xmlhttp.responseText; var MDlookResponse_array=MDlookResponse.split("\n"); var MDlookCID = MDlookResponse_array[0]; @@ -11758,6 +11759,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) document.vicidial_form.uniqueid.value = MDlookResponse_array[0]; document.getElementById("callchannel").innerHTML = MDlookResponse_array[1]; var stereo_info = MDlookResponse_array[2]; + var talk_sec_url_info = MDlookResponse_array[3]; lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} document.vicidial_form.SecondS.value = 0; @@ -11781,6 +11783,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var regSRC = new RegExp("^SAC|^SPAC","ig"); var regSRD = new RegExp("^SOD","ig"); var regSRAF = new RegExp("ALLFORCE","ig"); + var regTSU = new RegExp("TALKURLS","ig"); if (stereo_info.match(regSRC)) { // stereo recording was started @@ -11802,7 +11805,11 @@ function set_length(SLnumber,SLlength_goal,SLdirection) var conf_rec_start_html = "\" border=\"0\" alt=\"Start Stereo Recording\" />"; document.getElementById("StRecorDControl").innerHTML = conf_rec_start_html; } - + if (talk_sec_url_info.match(regTSU)) + { + talk_sec_url_secs = talk_sec_url_info.replace(regTSU, ''); + // alert('talk_sec_url_secs: |' + talk_sec_url_secs + '|'); + } document.getElementById("ParkControl").innerHTML ="\" border=\"0\" alt=\"Park Call\" />"; if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) @@ -13439,6 +13446,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) manual_entry_dial=0; SCRIPTweb_form_vars=''; SCRIPT2web_form_vars=''; + talk_url_vars=''; MDcheck_for_answer=0; leave_3way_start_recording_trigger=0; leave_3way_start_recording_triggerCALL=0; @@ -14298,7 +14306,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } VDICstereo_recording = VDIC_data_VDIG[42]; VDICstereo_recording_agent = VDIC_data_VDIG[43]; - + talk_sec_url_secs = VDIC_data_VDIG[44]; + // alert("talk_sec_url_secs: |" + talk_sec_url_secs + "|"); var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} @@ -15190,6 +15199,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) {CalL_ScripT_id_two = VDIC_data_VDIG[36];} if (VDIC_data_VDIG[37].length > 0) {CalL_ScripT_color_two = VDIC_data_VDIG[37];} + talk_sec_url_secs = VDIC_data_VDIG[38]; var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) @@ -17890,6 +17900,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) leave_3way_start_recording_filename=''; three_way_call_cid = orig_three_way_call_cid; APIskip=0; + talk_sec_url_secs=''; document.getElementById("BannerPanel").style.background = panel_bgcolor; document.getElementById("BannerPanel").innerHTML = ''; if (manual_auto_next > 0) @@ -18123,6 +18134,52 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } +// ################################################################################ +// Send AJAX request to trigger the Talk Seconds URLs Trigger + function talk_sec_url_send(temp_talk_url_type,temp_call_seconds,temp_inOUT,temp_talk_url_vars) + { + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + TSUupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=TALKsecURL&format=text&user=" + user + "&pass=" + pass + "&orig_pass=" + orig_pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&list_id=" + document.vicidial_form.list_id.value + "&MDnextCID=" + LasTCID + "&stage=" + group + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method=" + dial_method + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&agent_email=" + LOGemail + "&conf_exten=" + session_id + "&customer_server_ip=" + lastcustserverip + "&exten=" + extension + "&inOUT=" + inOUT + "&customer_sec=" + temp_call_seconds + "&group=" + group + "&original_phone_login=" + original_phone_login + "&phone_pass=" + phone_pass + ""; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(TSUupdate_query); + xmlhttp.onreadystatechange = function() + { + // document.getElementById("debugbottomspan").innerHTML = TSUupdate_query + "\n" + xmlhttp.responseText; + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + var check_talk_sec_url_received = null; + check_talk_sec_url_received = xmlhttp.responseText; + var check_DT_array=check_talk_sec_url_received.split("\n"); + agent_events('talk_sec_url_send received', LasTCID, aec); aec++; + } + } + delete xmlhttp; + } + } + + // ################################################################################ // Submit the URLs function SendURLs(newurlids,newurltype) @@ -19836,6 +19893,8 @@ else {web_form_vars_two = web_form_varsX;} if (webformnumber == '3') {web_form_vars_three = web_form_varsX;} + if (webformnumber == '9') + {talk_url_vars = web_form_varsX;} var SCvendor_lead_code = encodeURIComponent(document.vicidial_form.vendor_lead_code.value); var SCsource_id = source_id; @@ -22434,6 +22493,20 @@ function phone_number_format(formatphone) { } } } + // Check for Talk URLs trigger seconds talk_sec_url_secs + if ( (talk_sec_url_secs.length > 0) && (CheckDEADcallON < 1) ) + { + var temp_tsc = '-' + VD_live_call_secondS + '-'; + var regTSC = new RegExp(temp_tsc,"g"); + if (talk_sec_url_secs.match(regTSC)) + { + // alert('Talk Sec URL Trigger: |' + VD_live_call_secondS + '| |' + talk_sec_url_secs + '|'); + // Gather lead and call variables, save them to 'talk_url_vars' variable + // URLDecode('','NO','DEFAULT','9'); + // Send Talk Sec URL trigger for VD_live_call_secondS seconds + talk_sec_url_send('TALK_SEC_TRIGGER',VD_live_call_secondS,inOUT,talk_url_vars); + } + } } if (XD_live_customer_call==1) { diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index f4e92db3..8ee59f1a 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -6285,12 +6285,13 @@ if ($SSscript_remove_js > 0) # 250806-0841 - Added manual_dial_lead_id user setting, and new 'ONLY' option for campaign setting # 250808-1120 - Added agent_man_dial_filter & agent_3way_dial_filter system settings # 250822-2056 - Added system/campaign/ingroup settings for stereo_recording -# +# 250922-0841 - Added Talk Seconds URL links to multi-url admin page in campaigns and in-groups +# # 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-943a'; -$build = '250822-2056'; +$admin_version = '2.14-944a'; +$build = '250922-0841'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -29317,6 +29318,16 @@ if ($ADD==31) echo ""._QXZ("No Agent Call URL").": $NWB#campaigns-na_call_url$NWE\n"; } + $stmt="SELECT count(*) from vicidial_url_multi where campaign_id='$campaign_id' and entry_type='campaign' and url_type='talk';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vum_to_print = mysqli_num_rows($rslt); + if ($vum_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + $vum_count = $rowx[0]; + } + echo ""._QXZ("Talk Seconds URLs").": $NWB#campaigns-talk_sec_url$NWE "._QXZ("Talk Seconds URLs Defined").": $vum_count\n"; + echo ""._QXZ("Extension Append CID").": $NWB#campaigns-extension_appended_cidname$NWE\n"; echo ""._QXZ("Blind Monitor Warning").": $NWB#campaigns-blind_monitor_warning$NWE\n"; @@ -35284,6 +35295,28 @@ if ($ADD==3111) echo ""._QXZ("No Agent Call URL").": $NWB#inbound_groups-na_call_url$NWE\n"; } + # get count of talk seconds urls in this In-Group + $stmt="SELECT count(*) from vicidial_url_multi where campaign_id='$group_id' and entry_type='ingroup' and url_type='talk';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vum_to_print = mysqli_num_rows($rslt); + if ($vum_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + $vum_count = $rowx[0]; + } + # check if this In-Group has talk seconds url set to -FORCEDISABLE- + $force_disableHTML=''; + $stmt="SELECT count(*) from vicidial_url_multi where campaign_id='$group_id' and entry_type='ingroup' and url_type='talk' and active='N' and url_address LIKE \"%FORCEDISABLE%\";"; + $rslt=mysql_to_mysqli($stmt, $link); + $fdtsu_to_print = mysqli_num_rows($rslt); + if ($fdtsu_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + if ($rowx[0] > 0) + {$force_disableHTML="FORCED DISABLE";} + } + echo ""._QXZ("Talk Seconds URLs").": $NWB#inbound_groups-talk_sec_url$NWE "._QXZ("Talk Seconds URLs Defined").": $vum_count   $force_disableHTML\n"; + echo ""._QXZ("Waiting Call URL On").": $NWB#inbound_groups-waiting_call_url_on$NWE\n"; echo ""._QXZ("Waiting Call URL Off").": $NWB#inbound_groups-waiting_call_url_on$NWE\n"; @@ -36303,6 +36336,28 @@ if ($ADD==3811) echo ""._QXZ("Dispo Email URL").": $NWB#inbound_groups-dispo_email_url$NWE\n"; } + # get count of talk seconds urls in this In-Group + $stmt="SELECT count(*) from vicidial_url_multi where campaign_id='$group_id' and entry_type='ingroup' and url_type='talk';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vum_to_print = mysqli_num_rows($rslt); + if ($vum_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + $vum_count = $rowx[0]; + } + # check if this In-Group has talk seconds url set to -FORCEDISABLE- + $force_disableHTML=''; + $stmt="SELECT count(*) from vicidial_url_multi where campaign_id='$group_id' and entry_type='ingroup' and url_type='talk' and active='N' and url_address LIKE \"%FORCEDISABLE%\";"; + $rslt=mysql_to_mysqli($stmt, $link); + $fdtsu_to_print = mysqli_num_rows($rslt); + if ($fdtsu_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + if ($rowx[0] > 0) + {$force_disableHTML="FORCED DISABLE";} + } + echo ""._QXZ("Talk Seconds URLs").": $NWB#inbound_groups-talk_sec_url$NWE "._QXZ("Talk Seconds URLs Defined").": $vum_count   $force_disableHTML\n"; + echo ""._QXZ("Custom 1").": $NWB#inbound_groups-custom_fields$NWE\n"; echo ""._QXZ("Custom 2").": $NWB#inbound_groups-custom_fields$NWE\n"; @@ -37181,6 +37236,29 @@ if ($ADD==3911) { echo ""._QXZ("No Agent Chat URL").": $NWB#inbound_groups-na_chat_url$NWE\n"; } + + # get count of talk seconds urls in this In-Group + $stmt="SELECT count(*) from vicidial_url_multi where campaign_id='$group_id' and entry_type='ingroup' and url_type='talk';"; + $rslt=mysql_to_mysqli($stmt, $link); + $vum_to_print = mysqli_num_rows($rslt); + if ($vum_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + $vum_count = $rowx[0]; + } + # check if this In-Group has talk seconds url set to -FORCEDISABLE- + $force_disableHTML=''; + $stmt="SELECT count(*) from vicidial_url_multi where campaign_id='$group_id' and entry_type='ingroup' and url_type='talk' and active='N' and url_address LIKE \"%FORCEDISABLE%\";"; + $rslt=mysql_to_mysqli($stmt, $link); + $fdtsu_to_print = mysqli_num_rows($rslt); + if ($fdtsu_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + if ($rowx[0] > 0) + {$force_disableHTML="FORCED DISABLE";} + } + echo ""._QXZ("Talk Seconds URLs").": $NWB#inbound_groups-talk_sec_url$NWE "._QXZ("Talk Seconds URLs Defined").": $vum_count   $force_disableHTML\n"; + /* echo "Extension Append CID: $NWB#inbound_groups-extension_appended_cidname$NWE\n"; */ diff --git a/agc_2-X/trunk/www/vicidial/admin_url_multi.php b/agc_2-X/trunk/www/vicidial/admin_url_multi.php index 7e67bbba..04e8036c 100644 --- a/agc_2-X/trunk/www/vicidial/admin_url_multi.php +++ b/agc_2-X/trunk/www/vicidial/admin_url_multi.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2025 Matt Florell LICENSE: AGPLv2 # # this screen will control the *url* settings needed when the Campaign or # In-Group or List URL setting is set to "ALT". This screen allows for multiple @@ -19,10 +19,11 @@ # 211117-2006 - Added minimum call length field # 220127-1900 - Added display of the URL ID # 220222-1959 - Added allow_web_debug system setting +# 250920-2202 - Added talk_sec_urls # -$admin_version = '2.14-9'; -$build = '220222-1959'; +$admin_version = '2.14-10'; +$build = '250920-2202'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -235,6 +236,8 @@ if ($entry_type == 'campaign') {$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and start_call_url='ALT';";} elseif ($url_type == 'noagent') {$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and na_call_url='ALT';";} + elseif ($url_type == 'talk') + {$stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id';";} else { echo _QXZ("ERROR: no valid url type defined:") . $url_type; @@ -256,6 +259,8 @@ elseif ($entry_type == 'ingroup') {$stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$campaign_id' and na_call_url='ALT';";} elseif ($url_type == 'addlead') {$stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$campaign_id' and add_lead_url='ALT';";} + elseif ($url_type == 'talk') + {$stmt="SELECT count(*) from vicidial_inbound_groups where group_id='$campaign_id';";} else { echo _QXZ("ERROR: no valid url type defined:") . $url_type; @@ -291,6 +296,8 @@ elseif ($url_type == 'noagent') {$url_type_text='No Agent Call';} elseif ($url_type == 'addlead') {$url_type_text='Add Lead';} +elseif ($url_type == 'talk') + {$url_type_text='Talk Seconds';} else {$url_type_text='Error';} @@ -457,16 +464,25 @@ if ($action == "URL_MULTI_DELETE") ##### BEGIN URL multi control form if ($action == "BLANK") { + $min_length_text = 'MIN LENGTH'; + $statuses_text = 'STATUSES'; + if ( ($url_type == 'start') or ($url_type == 'noagent') or ($url_type == 'addlead') ) + {$min_length_text = 'NOT USED';} + if ( ($url_type == 'start') or ($url_type == 'noagent') or ($url_type == 'addlead') or ($url_type == 'talk') ) + {$statuses_text = 'NOT USED';} $bgcolor='bgcolor="#'. $SSstd_row2_background .'"'; echo "
\n"; echo ""; echo "
"._QXZ("Alternate URL Form"); echo "
\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -555,7 +573,7 @@ if ($action == "BLANK") $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\n\n\n


\n "._QXZ("runtime").": $RUNtime "._QXZ("seconds")."         "._QXZ("Version").": $admin_version     "._QXZ("Build").": $build"; +echo "\n\n\n


\n   "._QXZ("runtime").": $RUNtime "._QXZ("seconds")."         "._QXZ("Version").": $admin_version     "._QXZ("Build").": $build"; ?> diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index efc30481..308f8ee3 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: 20250917172301 +# version: 20250920221701 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, unless the User Password Minimum Length system setting is enabled, which will require a longer password. 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. @@ -432,6 +432,7 @@ campaigns-crm_login_address CRM Popup Address The web address of a CRM logi campaigns-start_call_url Start Call URL This web URL address is not seen by the agent, but it is called every time a call is sent to an agent if it is populated. Uses the same variables as the web form fields and scripts. This URL can NOT be a relative path. For Manual dial calls, the Start Call URL will be sent when the call is placed. Default is blank. If you put ALT into this field and submit this form, you will be able to go to a separate page where you can define multiple URLs for this action. campaigns-dispo_call_url Dispo Call URL This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo, callback_lead_status, talk_time and term_reason are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call as well as how the call was ended. This URL can NOT be a relative path. Default is blank. If you put ALT into this field and submit this form, you will be able to go to a separate page where you can define multiple URLs for this action as well as specific statuses that will trigger them. campaigns-na_call_url No Agent Call URL This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. --A--dispo--B-- can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank. Custom Fields are not available with this feature. If you put ALT into this field and submit this form, you will be able to go to a separate page where you can define multiple URLs for this action as well as specific statuses that will trigger them. +campaigns-talk_sec_url Talk Seconds URLs This feature allows you to define URLs that can be triggered by the Agent Screen when the agent is talking to the customer based upon how many seconds they have been talking. If the customer hangs up, then no more Talk Seconds URLs will be triggered. To define these Talk Seconds URLs, just click on the link to the right. campaigns-agent_allow_group_alias Group Alias Allowed If you want to allow your agents to use group aliases then you need to set this to Y. Group Aliases are explained more in the Admin section, they allow agents to select different callerIDs for outbound manual calls that they may place. Default is N. campaigns-default_group_alias Default Group Alias If you have allowed Group Aliases then this is the group alias that is selected first by default when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty. campaigns-calls_inqueue_count Calls In Queue Count Display This setting, if set to a valid CALLS_IN_QUEUE_COUNT type Settings Container, will change the display at the top of the agent screen to a specific filtered count of the calls in queue, replacing the default display of the count of every call waiting in queue that the agent has permissions to handle. If both of these settings are enabled, the first one will display before the second one. If you use an EXCEPT option, the exception container cannot also use an EXCEPT option. Default is ---DISABLED---. The CALLS_IN_QUEUE_COUNT type Settings Container should have -HEADING=>Display Name- as its first line, without the dashes, and then either a list of In-Groups and Campaigns, or one of the following special options,
--ALL-IN-GROUP-CALLS--
--ALL-CAMPAIGN-CALLS--
--ALL-CALLS--
--ALL-IN-GROUP-CALLS-EXCEPT=container_id
--ALL-CAMPAIGN-CALLS-EXCEPT=container_id
--ALL-CALLS-EXCEPT=container_id
@@ -691,6 +692,7 @@ inbound_groups-enter_ingroup_url Enter In-Group URL This web URL address is inbound_groups-start_call_url Start Call URL This web URL address is not seen by the agent, but it is called every time a call is sent to an agent if it is populated. Uses the same variables as the web form fields and scripts. Default is blank. If you put ALT into this field and submit this form, you will be able to go to a separate page where you can define multiple URLs for this action. inbound_groups-dispo_call_url Dispo Call URL This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo, talk_time and term_reason are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call as well as how the call was ended. Default is blank. If you put ALT into this field and submit this form, you will be able to go to a separate page where you can define multiple URLs for this action as well as specific statuses that will trigger them. If you want the campaign Dispo Call URL to be used for inbound calls, then put CAMP into this field. inbound_groups-na_call_url No Agent Call URL This web URL address is not seen by the agent, but if it is populated it is called every time a call that is not handled by an agent is hung up or transferred. Uses the same variables as the web form fields and scripts. --A--dispo--B-- can be used to retrieve the system-defined disposition for the call. This URL can NOT be a relative path. Default is blank. Custom Fields are not available with this feature. If the Wait time, On-Hold Prompt or other settings are not set properly in this In-Group, then this feature may not function properly. If you put ALT into this field and submit this form, you will be able to go to a separate page where you can define multiple URLs for this action as well as specific statuses that will trigger them. +inbound_groups-talk_sec_url Talk Seconds URLs This feature allows you to define URLs that can be triggered by the Agent Screen when the agent is talking to the customer based upon how many seconds they have been talking. If the customer hangs up, then no more Talk Seconds URLs will be triggered. To define these Talk Seconds URLs, just click on the link to the right. If there are no active Talk Seconds URLs defined for an In-Group, then the Campaign Talk Seconds URLs for the campaign the agent is logged into will be used for those In-Group calls. If you want to ensure that the Campaign Talk Seconds URLs are not used for this In-Group, then you can create a Talk Seconds URLs entry for the In-Group that has Active set to -N- and the URL set to -FORCEDISABLE-. inbound_groups-waiting_call_url_on Waiting Call URL On This feature allows you to trigger a URL when there are calls waiting in this In-Group. The -On- URL will be sent the first time a call is waiting, and no more will be sent as long as there are still calls from this In-Group waiting in the queue. The -Off- URL will be sent as soon as there are no calls waiting for this In-Group anymore. This feature was created to allow for a remote power switch to be triggered to light up a flashing light to notify agents in a call center room that there were calls waiting for them. For this feature to work, both the -On- and -Off- URLs must be filled in. Default is -empty- for disabled. inbound_groups-add_lead_url Add Lead URL This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid inbound_groups-add_lead_timezone Add Lead Timezone This is the method that the system will use to determine the current timezone when a lead is created when a call is being routed through this in-group. SERVER will use the current timezone of the server. PHONE_CODE_AREACODE will look up the timezone based on the phone code set in the lead and the areacode of the phone number. Default is SERVER. @@ -1484,7 +1486,7 @@ cb-bulk-newlist Transfer to List ID The list ID to which all callbacks will cb-bulk-newstatus New Status The new vicidial_list status the selected callbacks will be updated to. This affects the vicidial_list table ONLY. cb-export Callbacks export This page is used to view and download a list of all scheduled callbacks based on the campaigns selected and the dates the callbacks are scheduled to be contacted. cb-export-cb-dates Scheduled callback dates The date the leads are scheduled to be called back. -alt_multi_urls Alternate Multi URLs This page allows you to define Alternate URLs with conditions in place of the simple URL option for Dispo, Start, Add Lead or No Agent URLs. The RANK field will define the order in which the URLs are requested, this is important because if you have a URL that may take a few seconds to run ranked as 1, that will mean that any URLs ranked after it will have to wait to be run until that first URL request receives a response. The ACTIVE field will determine whether the specific URL is run. The STATUSES field only works for the Dispo URLs and will determine which disposition statuses will trigger the URL being run, if you want to run the entry for all statuses just fill in ---ALL--- in this field, if you want only a few statuses, separate them by spaces. If populated, the LISTS field will limit the calls that the URL is run from to only the list IDs listed in this field. To have it run for all lists, leave the field blank, if you want only a few lists, separate them by spaces. The MIN LENGTH field will limit the calls that the URL is run for to only calls that are this minimum length in seconds and higher, default is 0. The min length option does not work for No Agent Call URLs. The URL field works the same as it would in the URL option in campaigns, in-groups and lists, and it is also limited to 2000 characters in length. If you want to delete a URL, it must first be set to not active, then you can click on the DELETE link below the SUBMIT button for that URL entry. +alt_multi_urls Alternate Multi URLs This page allows you to define Alternate URLs with conditions in place of the simple URL option for Dispo, Start, Add Lead, No Agent or Talk Seconds URLs. The RANK field will define the order in which the URLs are requested, this is important because if you have a URL that may take a few seconds to run ranked as 1, that will mean that any URLs ranked after it will have to wait to be run until that first URL request receives a response. The ACTIVE field will determine whether the specific URL is run. The STATUSES field only works for the Dispo URLs and will determine which disposition statuses will trigger the URL being run, if you want to run the entry for all statuses just fill in ---ALL--- in this field, if you want only a few statuses, separate them by spaces. If populated, the LISTS field will limit the calls that the URL is run from to only the list IDs listed in this field. To have it run for all lists, leave the field blank, if you want only a few lists, separate them by spaces. The MIN LENGTH field will limit the calls that the URL is run for to only calls that are this minimum length in seconds and higher, default is 0. The min length option does not work for No Agent, Start or Add Lead URLs. For Talk Seconds URLS, the MIN LENGTH field is the trigger time during talk time with the customer when each URL is triggered, if it is set to 0 for a Talk Seconds URL, then that URL will never trigger. The URL field works the same as it would in the URL option in campaigns, in-groups and lists, and it is also limited to 2000 characters in length. If you want to delete a URL, it must first be set to not active, then you can click on the DELETE link below the SUBMIT button for that URL entry. amm_multi AM Message Wildcards This page allows you to define Am Message Wildcards that will check lead data from the defined lead fields for matches in the defined order specified on this page. For example, if you add a wildcard with the word -vacation- tied to the vendor_lead_code field, and the lead being played a message has -vacation- in that field, then it will hear the message defined in that AM Message Wildcard record. If you want to delete a wildcard, it must first be set to not active, then you can click on the DELETE link below the SUBMIT button for that wildcard entry user_list_new_limits User List New Lead Limits If the system setting for New Leads Per List Limit is enabled, then this page allows for the setting of per-user per-list new lead limit overrides to those List limits. This feature will only work properly if the campaign is set to either the MANUAL or INBOUND_MAN Dial Method and No Hopper dialing is enabled. user_inbound_calls_today User Inbound Calls Today This page will show you the User Inbound Calls Today, the Max Limits and the Call Credits for all users in the system. If one of the limits is reached, you will see notes showing you which one was reached.
\n"; - echo "
"._QXZ("Alternate %1s URLs for %2s",0,'',$url_type_text,$entry_type).": $campaign_id   $NWB#alt_multi_urls$NWE\n"; + echo "
"; + if (!preg_match("/talk/",$url_type)) + {echo _QXZ("Alternate");} + echo _QXZ(" %1s URLs for %2s",0,'',$url_type_text,$entry_type).": $campaign_id   $NWB#alt_multi_urls$NWE\n"; echo "\n"; - echo "\n"; + echo "\n"; $stmt="SELECT url_id,active,url_rank,url_statuses,url_description,url_address,url_lists,url_call_length from vicidial_url_multi where campaign_id='$campaign_id' and entry_type='$entry_type' and url_type='$url_type' order by url_rank limit 1000;"; if ($DB) {echo "$stmt\n";} @@ -521,6 +537,8 @@ if ($action == "BLANK") echo "\n"; echo "\n"; } + if ($types_to_print < 1) + {echo "";} echo "
#URL ID"._QXZ("ACTIVE").""._QXZ("RANK").""._QXZ("STATUSES").""._QXZ("LISTS").""._QXZ("MIN LENGTH").""._QXZ("DESCRIPTION").""._QXZ("SUBMIT")."
#URL ID"._QXZ("ACTIVE").""._QXZ("RANK").""._QXZ("$statuses_text").""._QXZ("LISTS").""._QXZ("$min_length_text").""._QXZ("DESCRIPTION").""._QXZ("SUBMIT")."
  "._QXZ("No URLs added here yet")."

\n"; @@ -537,7 +555,7 @@ if ($action == "BLANK") echo "\n"; echo "\n"; echo "
"._QXZ("RANK").": "._QXZ("STATUSES").": "._QXZ("STATUSES").": "._QXZ("DESCRIPTION").":