summaryrefslogtreecommitdiff
path: root/bin/cdr.import
blob: 36266efbf2da00d442d6eac9bc9f84c6b7a8621e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl
#
# Usage:
#  cdr.import user format filename
#

use strict;
use FS::UID qw(adminsuidsetup);
use FS::cdr;

my $user = shift or die &usage;
adminsuidsetup $user;

my $format = shift or die &usage;

my $file = shift;

my $error = FS::cdr::batch_import( {
  'file'            => $file,
  'format'          => $format,
  'batch_namevalue' => $file,
} );
die $error if $error;

sub usage {
  "Usage: \n  cdr.import user format filename\n";
}