[freeside-commits] freeside/FS/bin freeside-cdr-sftp_and_import, 1.6, 1.6.4.1
Erik Levinson
levinse at wavetail.420.am
Thu Jun 9 15:11:07 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv23737/FS/bin
Modified Files:
Tag: FREESIDE_2_1_BRANCH
freeside-cdr-sftp_and_import
Log Message:
SMSC CDRs (Kannel) and cdrtypenum option on cdr sftp import script, RT10991
Index: freeside-cdr-sftp_and_import
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-cdr-sftp_and_import,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -w -d -r1.6 -r1.6.4.1
--- freeside-cdr-sftp_and_import 6 Jul 2010 20:56:41 -0000 1.6
+++ freeside-cdr-sftp_and_import 9 Jun 2011 22:11:05 -0000 1.6.4.1
@@ -11,8 +11,8 @@
# parse command line
###
-use vars qw( $opt_m $opt_p $opt_r $opt_e $opt_d $opt_v $opt_P $opt_a );
-getopts('m:p:r:e:d:v:P:a');
+use vars qw( $opt_m $opt_p $opt_r $opt_e $opt_d $opt_v $opt_P $opt_a $opt_c );
+getopts('c:m:p:r:e:d:v:P:a');
$opt_e ||= 'csv';
#$opt_e = ".$opt_e" unless $opt_e =~ /^\./;
@@ -20,6 +20,8 @@
$opt_p ||= '';
+die "invalid cdrtypenum" if $opt_c && $opt_c !~ /^\d+$/;
+
my %options = ();
my $user = shift or die &usage;
@@ -92,12 +94,15 @@
warn "Processing $filename\n" if $opt_v;
- my $error = FS::cdr::batch_import( {
+ my $import_options = {
'file' => "$cachedir/$filename",
'format' => $format,
'batch_namevalue' => $filename,
'empty_ok' => 1,
- } );
+ };
+ $import_options->{'cdrtypenum'} = $opt_c if $opt_c;
+
+ my $error = FS::cdr::batch_import($import_options);
die $error if $error;
if ( $opt_d ) {
@@ -161,7 +166,7 @@
cdr.sftp_and_import [ -m method ] [ -p prefix ] [ -e extension ]
[ -r remotefolder ] [ -d donefolder ] [ -v level ] [ -P port ]
- [ -a ] user format [sftpuser@]servername
+ [ -a ] [ -c cdrtypenum ] user format [sftpuser@]servername
=head1 DESCRIPTION
@@ -185,6 +190,8 @@
-v: set verbosity level; this script only has one level, but it will
be passed as the 'debug' argument to the transport method
+-c: cdrtypenum to set, defaults to none
+
user: freeside username
format: CDR format name
More information about the freeside-commits
mailing list