projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add -i flag to set carrierid, RT#86028, RT#81941
[freeside.git]
/
FS
/
bin
/
freeside-cdr-sftp_and_import
diff --git
a/FS/bin/freeside-cdr-sftp_and_import
b/FS/bin/freeside-cdr-sftp_and_import
index
aa1b394
..
bae8051
100755
(executable)
--- a/
FS/bin/freeside-cdr-sftp_and_import
+++ b/
FS/bin/freeside-cdr-sftp_and_import
@@
-12,8
+12,8
@@
use FS::cdr;
# parse command line
###
# parse command line
###
-use vars qw( $opt_m $opt_p $opt_r $opt_e $opt_d $opt_v $opt_P $opt_a $opt_c $opt_g $opt_s $opt_b );
-getopts('c:m:p:r:e:d:v:P:agsb');
+use vars qw( $opt_m $opt_p $opt_r $opt_e $opt_d $opt_v $opt_P $opt_a $opt_c $opt_
i $opt_
g $opt_s $opt_b );
+getopts('c:
i:
m:p:r:e:d:v:P:agsb');
$opt_e ||= 'csv';
#$opt_e = ".$opt_e" unless $opt_e =~ /^\./;
$opt_e ||= 'csv';
#$opt_e = ".$opt_e" unless $opt_e =~ /^\./;
@@
-22,6
+22,7
@@
$opt_e =~ s/^\.//;
$opt_p ||= '';
die "invalid cdrtypenum" if $opt_c && $opt_c !~ /^\d+$/;
$opt_p ||= '';
die "invalid cdrtypenum" if $opt_c && $opt_c !~ /^\d+$/;
+die "invalid carrierid" if $opt_i && $opt_i !~ /^\d+$/;
my %options = ();
my %options = ();
@@
-114,6
+115,7
@@
foreach my $filename ( @$ls ) {
'empty_ok' => 1,
};
$import_options->{'cdrtypenum'} = $opt_c if $opt_c;
'empty_ok' => 1,
};
$import_options->{'cdrtypenum'} = $opt_c if $opt_c;
+ $import_options->{'carrierid'} = $opt_i if $opt_i;
my $error = FS::cdr::batch_import($import_options);
my $error = FS::cdr::batch_import($import_options);
@@
-161,7
+163,11
@@
foreach my $filename ( @$ls ) {
###
sub usage {
###
sub usage {
- "Usage: \n cdr.import user format servername\n";
+ "Usage:
+ cdr.sftp_and_import [ -m method ] [ -p prefix ] [ -e extension ]
+ [ -r remotefolder ] [ -d donefolder ] [ -v level ] [ -P port ]
+ [ -a ] [ -g ] [ -s ] [ -c cdrtypenum ] user format [sftpuser@]servername
+ ";
}
use vars qw( $sftp $ftp );
}
use vars qw( $sftp $ftp );
@@
-199,9
+205,10
@@
freeside-cdr-sftp_and_import - Download CDR files from a remote server via SFTP
=head1 SYNOPSIS
=head1 SYNOPSIS
-
cdr.
sftp_and_import [ -m method ] [ -p prefix ] [ -e extension ]
+
freeside-cdr-
sftp_and_import [ -m method ] [ -p prefix ] [ -e extension ]
[ -r remotefolder ] [ -d donefolder ] [ -v level ] [ -P port ]
[ -r remotefolder ] [ -d donefolder ] [ -v level ] [ -P port ]
- [ -a ] [ -g ] [ -s ] [ -c cdrtypenum ] user format [sftpuser@]servername
+ [ -a ] [ -g ] [ -s ] [ -c cdrtypenum ] [ -i carrierid]
+ user format [sftpuser@]servername
=head1 DESCRIPTION
=head1 DESCRIPTION
@@
-229,6
+236,8
@@
or FTP and then import them into the database.
-c: cdrtypenum to set, defaults to none
-c: cdrtypenum to set, defaults to none
+-i: carrierid to set, defaults to none
+
-g: File is gzipped
-s: Warn and skip files which could not be imported rather than abort
-g: File is gzipped
-s: Warn and skip files which could not be imported rather than abort