diff --git a/bin/AST_CRON_audio_3_ftp.pl b/bin/AST_CRON_audio_3_ftp.pl index aa3d9071..eb037705 100644 --- a/bin/AST_CRON_audio_3_ftp.pl +++ b/bin/AST_CRON_audio_3_ftp.pl @@ -58,6 +58,7 @@ # 150911-2336 - Added GPG encrypted audio file compatibility # 160406-2055 - Added YMDdatedir option # 180511-2018 - Added --YearYMDdatedir option +# 180616-2248 - Added --localdatedir option # ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); @@ -114,6 +115,7 @@ if (length($ARGV[0])>1) print " [--nodatedir] = do not put into dated directories\n"; print " [--YMDdatedir] = put into Year/Month/Day dated directories\n"; print " [--YearYMDdatedir] = put into Year/YYYYMMDD dated directories\n"; + print " [--localdatedir] = create dated directories inside of FTP directory on local server\n"; print " [--run-check] = concurrency check, die if another instance is running\n"; print " [--max-files=x] = maximum number of files to process, defaults to 100000\n"; print " [--ftp-server=XXX] = FTP server\n"; @@ -158,6 +160,11 @@ if (length($ARGV[0])>1) $YearYMDdatedir=1; if ($DB) {print "\n----- Year/YYYYMMDD DATED DIRECTORIES -----\n\n";} } + if ($args =~ /--localdatedir/i) + { + $localdatedir=1; + if ($DB) {print "\n----- CREATE LOCAL DATED DIRECTORIES: $localdatedir -----\n\n";} + } if ($args =~ /--run-check/i) { $run_check=1; @@ -530,7 +537,7 @@ foreach(@FILES) } } } - $ftp->binary(); + $ftp->binary() or die "Cannot set binary transfer, is server connected?"; $ftp->put("$dir2/$ALLfile", "$ALLfile"); if ($FTPvalidate > 0) { @@ -554,7 +561,52 @@ foreach(@FILES) if (!$T) { - `mv -f "$dir2/$ALLfile" "$PATHDONEmonitor/FTP/$ALLfile"`; + $localDIR=''; + if ( ($localdatedir > 0) && ($NODATEDIR < 1) ) + { + if ($YMDdatedir > 0) + { + if (-d "$PATHDONEmonitor/FTP/$year") + {if($DBX) {print "Year directory exists: $PATHDONEmonitor/FTP/$year\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$year\n";}} + if (-d "$PATHDONEmonitor/FTP/$year/$mon") + {if($DBX) {print "Month directory exists: $PATHDONEmonitor/FTP/$year/$mon\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year/$mon",0755); if($DBX) {print "Month directory created: $PATHDONEmonitor/FTP/$year/$mon\n";}} + if (-d "$PATHDONEmonitor/FTP/$year/$mon/$mday") + {if($DBX) {print "Day directory exists: $PATHDONEmonitor/FTP/$year/$mon/$mday\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year/$mon/$mday",0755); if($DBX) {print "Day directory created: $PATHDONEmonitor/FTP/$year/$mon/$mday\n";}} + $localDIR = "$year/$mon/$mday/"; + } + else + { + if ($YearYMDdatedir > 0) + { + if (-d "$PATHDONEmonitor/FTP/$year") + {if($DBX) {print "Year directory exists: $PATHDONEmonitor/FTP/$year\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$year\n";}} + if (-d "$PATHDONEmonitor/FTP/$year/$start_date") + {if($DBX) {print "Full-date directory exists: $PATHDONEmonitor/FTP/$year/$start_date\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year/$start_date",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$year/$start_date\n";}} + $localDIR = "$year/$start_date/"; + } + else + { + if (-d "$PATHDONEmonitor/FTP/$start_date") + {if($DBX) {print "Full-date directory exists: $PATHDONEmonitor/FTP/$start_date\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$start_date",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$start_date\n";}} + $ftp->mkdir("$start_date"); + $ftp->cwd("$start_date"); + $localDIR = "$start_date/"; + } + } + } + `mv -f "$dir2/$ALLfile" "$PATHDONEmonitor/FTP/$localDIR$ALLfile"`; } if($DBX){print STDERR "Transfered $transfered_files files\n";} diff --git a/bin/AST_CRON_audio_3_ftp_FTPSSL.pl b/bin/AST_CRON_audio_3_ftp_FTPSSL.pl index 98798fc9..66dee11a 100644 --- a/bin/AST_CRON_audio_3_ftp_FTPSSL.pl +++ b/bin/AST_CRON_audio_3_ftp_FTPSSL.pl @@ -56,6 +56,7 @@ # # # 180518-0732 - First Build based upon AST_CRON_audio_3_ftp.pl script +# 180616-2248 - Added --localdatedir option # ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); @@ -112,6 +113,7 @@ if (length($ARGV[0])>1) print " [--nodatedir] = do not put into dated directories\n"; print " [--YMDdatedir] = put into Year/Month/Day dated directories\n"; print " [--YearYMDdatedir] = put into Year/YYYYMMDD dated directories\n"; + print " [--localdatedir] = create dated directories inside of FTP directory on local server\n"; print " [--noping] = do not attempt to ping FTP server\n"; print " [--run-check] = concurrency check, die if another instance is running\n"; print " [--max-files=x] = maximum number of files to process, defaults to 100000\n"; @@ -163,6 +165,11 @@ if (length($ARGV[0])>1) $YearYMDdatedir=1; if ($DB) {print "\n----- Year/YYYYMMDD DATED DIRECTORIES -----\n\n";} } + if ($args =~ /--localdatedir/i) + { + $localdatedir=1; + if ($DB) {print "\n----- CREATE LOCAL DATED DIRECTORIES: $localdatedir -----\n\n";} + } if ($args =~ /--run-check/i) { $run_check=1; @@ -557,7 +564,7 @@ foreach(@FILES) } } } - $ftps->binary(); + $ftps->binary() or die "Cannot set binary transfer, is server connected?"; $ftps->put("$dir2/$ALLfile", "$ALLfile"); # if ($FTPvalidate > 0) # { @@ -580,7 +587,52 @@ foreach(@FILES) if (!$T) { - `mv -f "$dir2/$ALLfile" "$PATHDONEmonitor/FTP/$ALLfile"`; + $localDIR=''; + if ( ($localdatedir > 0) && ($NODATEDIR < 1) ) + { + if ($YMDdatedir > 0) + { + if (-d "$PATHDONEmonitor/FTP/$year") + {if($DBX) {print "Year directory exists: $PATHDONEmonitor/FTP/$year\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$year\n";}} + if (-d "$PATHDONEmonitor/FTP/$year/$mon") + {if($DBX) {print "Month directory exists: $PATHDONEmonitor/FTP/$year/$mon\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year/$mon",0755); if($DBX) {print "Month directory created: $PATHDONEmonitor/FTP/$year/$mon\n";}} + if (-d "$PATHDONEmonitor/FTP/$year/$mon/$mday") + {if($DBX) {print "Day directory exists: $PATHDONEmonitor/FTP/$year/$mon/$mday\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year/$mon/$mday",0755); if($DBX) {print "Day directory created: $PATHDONEmonitor/FTP/$year/$mon/$mday\n";}} + $localDIR = "$year/$mon/$mday/"; + } + else + { + if ($YearYMDdatedir > 0) + { + if (-d "$PATHDONEmonitor/FTP/$year") + {if($DBX) {print "Year directory exists: $PATHDONEmonitor/FTP/$year\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$year\n";}} + if (-d "$PATHDONEmonitor/FTP/$year/$start_date") + {if($DBX) {print "Full-date directory exists: $PATHDONEmonitor/FTP/$year/$start_date\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$year/$start_date",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$year/$start_date\n";}} + $localDIR = "$year/$start_date/"; + } + else + { + if (-d "$PATHDONEmonitor/FTP/$start_date") + {if($DBX) {print "Full-date directory exists: $PATHDONEmonitor/FTP/$start_date\n";}} + else + {mkdir("$PATHDONEmonitor/FTP/$start_date",0755); if($DBX) {print "Year directory created: $PATHDONEmonitor/FTP/$start_date\n";}} + $ftp->mkdir("$start_date"); + $ftp->cwd("$start_date"); + $localDIR = "$start_date/"; + } + } + } + `mv -f "$dir2/$ALLfile" "$PATHDONEmonitor/FTP/$localDIR$ALLfile"`; } if($DBX){print STDERR "Transfered $transfered_files files\n";} diff --git a/bin/AST_CRON_audio_4_ftp2.pl b/bin/AST_CRON_audio_4_ftp2.pl index 1484ad16..9fe3b702 100644 --- a/bin/AST_CRON_audio_4_ftp2.pl +++ b/bin/AST_CRON_audio_4_ftp2.pl @@ -394,7 +394,7 @@ foreach(@FILES) $ftp->cwd("$start_date"); $start_date_PATH = "$start_date/"; } - $ftp->binary(); + $ftp->binary() or die "Cannot set binary transfer, is server connected?"; $ftp->put("$dir2/$ALLfile", "$ALLfile"); if ($FTPvalidate > 0) { diff --git a/docs/CALL_URL_FEATURES.txt b/docs/CALL_URL_FEATURES.txt index 5158a9e5..ce35ac2b 100644 --- a/docs/CALL_URL_FEATURES.txt +++ b/docs/CALL_URL_FEATURES.txt @@ -105,7 +105,8 @@ that are not sent to agents such as DROPs, No Answers, Busys and timeouts. This option is available for Campaigns and In-Groups. This feature will only work for auto-dial and inbound calls, not manual dial calls. For inbound calls, the specific in-group that a call was sent to needs to have the No Agent Call URL -field filled in or this function will not run for that call. +field filled in or this function will not run for that call. To send the +status of the call, just use the --A--status--B-- variable. ################################################################################ @@ -152,6 +153,11 @@ did_custom_five For most of the functions above, you can also reference custom list fields using the standard --A-- and --B-- around the custom field ID +NOTE: Most of these URL features have variables available for use that are not +documented on this page. If you want to confirm what variables are available +outside of the ones mentioned here, you should look in the code. + + ################################################################################ # EXAMPLES