1 package FS::cdr::vocus;
4 use vars qw( @ISA %info $CDR_TYPES );
5 use FS::cdr qw( _cdr_date_parse );
6 use FS::Record qw( qsearch );
16 #The first column is reserved for future use.
18 #The second column is the call identifier generated on our system.
20 #The third column is the date of the call in UTC.
22 #The fourth column is the time of the call in UTC.
24 # combine cols 3 & 4 and parse
25 my($cdr, $time, $conf, $param) = @_;
26 $cdr->startdate(_cdr_date_parse($cdr->startdate.' '.$time, gmt => 1));
28 #The fifth column is for Vocus use.
30 #The sixth column is the call duration in seconds.
32 #The seventh column is the calling number presented to our soft switch in E164 format.
34 #The eight column is the called number presented to our soft switch in E164 format.
36 #The ninth column is the time and date at which the call was rated and the
37 # CDR generated in our system. It's just there for your information.
39 #The tenth column is the SZU of the calling party.
40 'upstream_src_regionname',
41 #The eleventh column is the SZU of the called party, if applicable.
42 'upstream_dst_regionname',
43 #The twelfth column is the tariff type - Mobile, Regional, International,
44 #etc. This matches up with the tariff types under the Voice Access Point on your bill.
46 my($cdr, $cdrtypename, $conf, $param) = @_;
47 return unless length($cdrtypename);
49 die "no matching cdrtypenum for $cdrtypename"
50 unless defined $CDR_TYPES->{$cdrtypename};
51 $cdr->cdrtypenum($CDR_TYPES->{$cdrtypename});
53 #The thirteenth column is the cost of the call, ex GST.
59 sub skip { map {''} (1..$_[0]) }
64 foreach my $cdr_type ( qsearch('cdr_type') ) {
65 die "multiple cdr_types with same cdrtypename".$cdr_type->cdrtypename
66 if defined $CDR_TYPES->{$cdr_type->cdrtypename};
67 $CDR_TYPES->{$cdr_type->cdrtypename} = $cdr_type->cdrtypenum;