1 package FS::cdr::kannel;
4 use vars qw( @ISA %info );
5 use FS::cdr qw( _cdr_date_parser_maker );
14 'row_callback' => sub { my $row = shift;
15 return ' ' if $row =~ /.*Log (begins|ends)$/;
16 die "invalid row format for '$row'" unless
17 $row =~ /^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) ([A-Za-z ]+) (\[SMSC:\w+\] \[SVC:\w*\] \[ACT:\w*\] \[BINF:\w*\] \[FID:\w*\]) \[from:(.*?)\] \[to:(.*?)\] (\[flags:.*?\]) \[msg:(\d+):.*?\] (\[udh:.*?\])$/;
18 $row = "$1,$2,$3,$4,$5,$6,$7,$8";
22 _cdr_date_parser_maker('startdate'),
24 'userfield', # [SMSC: ... FID...], five fields
29 $src =~ /^(\+|)(\d+)$/
30 or die "unparsable number: $src"; #maybe we shouldn't die...
37 $dst =~ /^(\+|)(\d+)$/
38 or die "unparsable number: $dst"; #maybe we shouldn't die...
42 sub { my($cdr, $flags) = @_;
43 $cdr->userfield($cdr->userfield." $flags");
46 # setting billsec to the msg length as we need billsec set non-zero
49 sub { my($cdr, $udh) = @_;
50 $cdr->userfield($cdr->userfield." $udh");
55 sub skip { map {''} (1..$_[0]) }