'disabled' => 0, #0 default, set to 1 to disable
'import_fields' => [
-
+
sub { my ($cdr, $direction) = @_;
- if ($direction =~ /^o/) { # 'origination'
+ if ($direction =~ /^t/) { # 'origination'
# leave src and dst as they are
- } elsif ($direction =~ /^t/) {
+ } elsif ($direction =~ /^o/) {
my ($local, $remote) = ($cdr->src, $cdr->dst);
$cdr->set('dst', $local);
$cdr->set('src', $remote);
'', #Domain
'', #user
'src', #local party (src/dst, based on direction)
- _cdr_date_parser_maker('startddate'),
+ _cdr_date_parser_maker('startdate'),
_cdr_date_parser_maker('answerdate'),
sub { my ($cdr, $duration) = @_;
$cdr->set('duration', $duration);
if $cdr->answerdate;
},
'dst', #remote party
- '', #dialed number
+ sub { my ($cdr, $dialednum) = @_;
+ $cdr->set('dst',$dialednum) if $dialednum =~ /^(\+?1)?8(8|([02-7])\3)/;
+ }, #dialed number
'uniqueid', #CallID (timestamp + '-' + 32 char hex string)
- 'src_ip_addr',
- 'dst_ip_addr',
+ '',
+ '',
'disposition',
],
);
1;
-