summaryrefslogtreecommitdiff
path: root/FS/bin
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-05-13 22:02:57 -0500
committerJonathan Prykop <jonathan@freeside.biz>2016-05-13 22:02:57 -0500
commita21d07037590cccd5ac5c572f5d28f062c622968 (patch)
treed0acc32600e3597a70988d92af3c9ccb0ef1c740 /FS/bin
parent091e39d6952f3ae61b4993b19643fec6e4a52979 (diff)
RT#39913: Conexiant API [distinguish all rows previously imported from truly empty files]
Diffstat (limited to 'FS/bin')
-rwxr-xr-xFS/bin/freeside-cdr-conexiant-import9
1 files changed, 5 insertions, 4 deletions
diff --git a/FS/bin/freeside-cdr-conexiant-import b/FS/bin/freeside-cdr-conexiant-import
index a79477c51..f2b469111 100755
--- a/FS/bin/freeside-cdr-conexiant-import
+++ b/FS/bin/freeside-cdr-conexiant-import
@@ -68,13 +68,11 @@ my $ua = LWP::UserAgent->new;
# Download files are created automatically at regular frequent intervals,
# but they contain overlapping data.
#
-# FS::cdr::conexiant automatically skips previously imported cdrs,
-# though if it does so for all records in a file,
-# then batch_import thinks the file is empty
+# FS::cdr::conexiant automatically skips previously imported cdrs
foreach my $file (@$files) {
next unless $file->{'BilledCallsOnly'};
my $cdrbatch = 'conexiant-' . $file->{'Identifier'};
- # files that were "empty" will unfortunately be re-downloaded,
+ # files that contained no new records will unfortunately be re-downloaded,
# but the alternative is to leave an excess of empty batches in system,
# and re-downloading is harmless (all files expire after 48 hours anyway)
if (qsearchs('cdr_batch',{ 'cdrbatch' => $cdrbatch })) {
@@ -113,6 +111,9 @@ foreach my $file (@$files) {
'format' => 'conexiant'
});
if ($error eq 'Empty file!') {
+ print "File contains no records\n" if $verbose;
+ $error = '';
+ } elsif ($error eq "All records in file were previously imported") {
print "File contains no new cdrs, no batch created\n" if $verbose;
$error = '';
} elsif ($verbose && !$error) {