projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 83122 Utility to issue credits against taxnums - fix typo
[freeside.git]
/
FS
/
bin
/
freeside-voipinnovations-cdrimport
diff --git
a/FS/bin/freeside-voipinnovations-cdrimport
b/FS/bin/freeside-voipinnovations-cdrimport
index
484b330
..
5eb2aef
100755
(executable)
--- a/
FS/bin/freeside-voipinnovations-cdrimport
+++ b/
FS/bin/freeside-voipinnovations-cdrimport
@@
-4,7
+4,8
@@
use strict;
use Getopt::Std;
use Date::Format;
use File::Temp 'tempdir';
use Getopt::Std;
use Date::Format;
use File::Temp 'tempdir';
-use Net::FTP;
+use Net::FTP 2.80; #3.08; 2.79 in deb 8 doesn't work, 3.08 in deb 9 does
+use IO::Socket::SSL 2.007;
use FS::UID qw(adminsuidsetup datasrc dbh);
use FS::cdr;
use FS::cdr_batch;
use FS::UID qw(adminsuidsetup datasrc dbh);
use FS::cdr;
use FS::cdr_batch;
@@
-37,13
+38,16
@@
my %exists = map {$_->cdrbatch => 1} @previous;
my $tempdir = tempdir( CLEANUP => !$opt_v );
my $format = 'voip_innovations';
my $tempdir = tempdir( CLEANUP => !$opt_v );
my $format = 'voip_innovations';
-my $hostname = 'c
drs.globalpopsvoip
.com';
+my $hostname = 'c
ustomercdr.voipinnovations
.com';
-my $ftp = Net::FTP->new($hostname, Debug => $opt_d)
+my $ftp = Net::FTP->new($hostname,
Passive => 1,
Debug => $opt_d)
or die "Can't connect to $hostname: $@\n";
or die "Can't connect to $hostname: $@\n";
+$ftp->starttls()
+ or die "TLS initialization failed: ". $ftp->message. "\n";
+
$ftp->login($login, $password)
$ftp->login($login, $password)
- or die "Login failed: ".
$ftp->message.
"\n";
+ or die "Login failed: ".
$ftp->message.
"\n";
###
# get the file list
###
# get the file list
@@
-51,7
+55,7
@@
$ftp->login($login, $password)
warn "Retrieving directory listing\n" if $opt_v;
warn "Retrieving directory listing\n" if $opt_v;
-$ftp->cwd('/');
+
#
$ftp->cwd('/');
my @dirs = $ftp->ls();
warn scalar(@dirs)." directories found.\n" if $opt_v;
# apply date range
my @dirs = $ftp->ls();
warn scalar(@dirs)." directories found.\n" if $opt_v;
# apply date range