summaryrefslogtreecommitdiff
path: root/FS/bin
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2022-05-23 12:27:38 -0700
committerIvan Kohler <ivan@freeside.biz>2022-05-23 12:27:38 -0700
commit5d36f5f81d84e116caae80667e37750e6798e2b1 (patch)
treee144a3496ad7ee1cfd8292ed7942f602f01e14c9 /FS/bin
parentf8a1e695f5339a1fc93960e15f146c96845a881a (diff)
add -i flag to set carrierid, RT#86028, RT#81941
Diffstat (limited to 'FS/bin')
-rwxr-xr-xFS/bin/freeside-cdr-sftp_and_import11
1 files changed, 8 insertions, 3 deletions
diff --git a/FS/bin/freeside-cdr-sftp_and_import b/FS/bin/freeside-cdr-sftp_and_import
index aa4bf6471..bae805151 100755
--- 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
###
-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 =~ /^\./;
@@ -22,6 +22,7 @@ $opt_e =~ s/^\.//;
$opt_p ||= '';
die "invalid cdrtypenum" if $opt_c && $opt_c !~ /^\d+$/;
+die "invalid carrierid" if $opt_i && $opt_i !~ /^\d+$/;
my %options = ();
@@ -114,6 +115,7 @@ foreach my $filename ( @$ls ) {
'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);
@@ -205,7 +207,8 @@ freeside-cdr-sftp_and_import - Download CDR files from a remote server via SFTP
freeside-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
+ [ -a ] [ -g ] [ -s ] [ -c cdrtypenum ] [ -i carrierid]
+ user format [sftpuser@]servername
=head1 DESCRIPTION
@@ -233,6 +236,8 @@ or FTP and then import them into the database.
-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