fix TeleAPI import (what kind of crack was Christopher smoking that he couldn't fix...
[freeside.git] / FS / FS / cdr / thinktel.pm
1 package FS::cdr::thinktel;
2
3 use strict;
4 use base qw( FS::cdr );
5 use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
6
7 our %info = (
8   'name'          => 'Thinktel',
9   'weight'        => 541,
10   'header'        => 1,     #0 default, set to 1 to ignore the first line, or
11                             # to higher numbers to ignore that number of lines
12   'type'          => 'csv', #csv (default), fixedlength or xls
13   'sep_char'      => ',',   #for csv, defaults to ,
14   'disabled'      => 0,     #0 default, set to 1 to disable
15
16   #listref of what to do with each field from the CDR, in order
17   'import_fields' => [
18     'charged_party',
19     'src',
20     'dst',
21     _cdr_date_parser_maker('startdate'),
22     'billsec', # rounded call duration
23     'dcontext', # Usage Type: 'Local', 'Canada', 'Incoming', ...
24     'upstream_price',
25     'upstream_src_regionname',
26     'upstream_dst_regionname',
27     '', # upstream rate per minute
28     '', # "Label"
29     # raw seconds, to one decimal place
30     sub { my ($cdr, $sec) = @_;
31           $cdr->set('duration', sprintf('%.0f', $sec));
32         },
33     # newly added fields of unclear meaning:
34     # Subscription (UUID, seems to correspond to charged_party)
35     # Call Type (always "Normal" thus far)
36     # Carrier (always empty)
37     # Alt Destination Name (always empty)
38   ],
39 );
40
41 1;
42