1 package FS::cdr::enswitch_calling_name;
2 use base qw( FS::cdr );
5 use vars qw( %info $tmp_mon $tmp_mday $tmp_year );
6 use FS::Record qw( qsearchs );
10 'name' => 'Enswitch with calling name',
16 'startdate', #Start, already a unix timestamp
17 skip(2), #Start date, Start time
19 skip(6), #End date, End time
20 #Calling customer, Calling type
21 'src', #Calling number
24 sub { my ($cdr, $dst) = @_;
26 $cdr->set('dst', $dst);
29 skip(14), #Destination customer, Destination type
31 #Destination group ID, Destination group name,
32 #Inbound calling type,
33 #Inbound calling number,
35 #Inbound called number,
36 #Inbound destination type, Inbound destination number,
37 sub { my ($cdr, $data) = @_;
40 my $cdr_type = qsearchs('cdr_type', { 'cdrtypename' => $data } );
41 $cdr->set('cdrtypenum', $cdr_type->cdrtypenum) if $cdr_type;
42 } , #Outbound calling type,
44 skip(11), #Outbound calling number,
45 #Outbound called type, Outbound called number,
46 #Outbound destination type, Outbound destination number,
47 #Internal calling type, Internal calling number,
48 #Internal called type, Internal called number,
49 #Internal destination type, Internal destination number
50 'duration', #Total seconds
51 skip(1), #Ring seconds
52 'billsec', #Billable seconds
55 'accountcode', #Billing customer
56 skip(3), #Billing customer name, Billing type, Billing reference
60 sub skip { map {''} (1..$_[0]) }