[freeside-commits] freeside/FS/FS Record.pm, 1.224, 1.225 cdr.pm, 1.73, 1.74
Erik Levinson
levinse at wavetail.420.am
Thu Jun 9 15:09:09 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv23477/FS/FS
Modified Files:
Record.pm cdr.pm
Log Message:
SMSC CDRs (Kannel) and cdrtypenum option on cdr sftp import script, RT10991
Index: cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr.pm,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -w -d -r1.73 -r1.74
--- cdr.pm 2 Jun 2011 20:43:15 -0000 1.73
+++ cdr.pm 9 Jun 2011 22:09:06 -0000 1.74
@@ -948,6 +948,14 @@
my $iopt = _import_options;
$opt->{$_} = $iopt->{$_} foreach keys %$iopt;
+ if ( defined $opt->{'cdrtypenum'} ) {
+ $opt->{'preinsert_callback'} = sub {
+ my($record,$param) = (shift,shift);
+ $record->cdrtypenum($opt->{'cdrtypenum'});
+ '';
+ };
+ }
+
FS::Record::batch_import( $opt );
}
Index: Record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Record.pm,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -w -d -r1.224 -r1.225
--- Record.pm 1 May 2011 19:51:06 -0000 1.224
+++ Record.pm 9 Jun 2011 22:09:06 -0000 1.225
@@ -1854,9 +1854,11 @@
$line = &{$row_callback}($line) if $row_callback;
+ next if $line =~ /^\s*$/; #skip empty lines
+
$parser->parse($line) or do {
$dbh->rollback if $oldAutoCommit;
- return "can't parse: ". $parser->error_input();
+ return "can't parse: ". $parser->error_input() . " " . $parser->error_diag;
};
@columns = $parser->fields();
More information about the freeside-commits
mailing list