1 package FS::cdr::bell_west;
4 use base qw( FS::cdr );
5 use vars qw( %info $tmp_mon $tmp_mday $tmp_year );
7 #use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
10 'name' => 'Bell West',
17 # CDR FIELD / REQUIRED / Notes
19 # CHG TYPE / No / Internal Code only (no need to import)
22 # ACCOUNT # / No / Internal Number only (no need to import)
25 # DATE / Yes / "DATE" Excel date format MM/DD/YYYY
26 # XXX false laziness w/troop.pm
27 sub { my($cdr, $date) = @_;
29 my $datetime = DateTime::Format::Excel->parse_datetime( $date );
30 $tmp_mon = $datetime->mon_0;
31 $tmp_mday = $datetime->mday;
32 $tmp_year = $datetime->year;
35 # CUST NO / Yes / "TIME" "075959" Text based time
36 # Note: This is really the start time but Bell header says "Cust No" which
38 sub { my($cdr, $time) = @_;
39 #my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
40 $time =~ /^(\d{2})(\d{2})(\d{2})$/
41 or die "unparsable time: $time"; #maybe we shouldn't die...
42 #$cdr->startdate( timelocal($3, $2, $1 ,$mday, $mon, $year) );
44 timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year)
48 # BTN / Yes / Main billing number but not DID or real number
52 # ORIG CITY / No / We will use your Freeside rating and description name
55 # TERM / YES / All calls should be billed, however all calls are
56 # missing "1+" and "011+" & DIR ASST = "411"
59 # TERM CITY / No / We will use your Freeside rating and description name
62 # WTN / Yes / Bill to number (put in "charged_party")
65 # CODE / Yes / Account Code (security) and we need on invoice
68 # PROV/COUNTRY / No / We will use your Freeside rating and description name
69 # (but use this to add "011" for "International" calls)
70 sub { my( $cdr, $prov ) = @_;
71 my $pre = ( $prov =~ /^\s*International\s*/i ) ? '011' : '1';
72 $cdr->dst( $pre. $cdr->dst ) unless $cdr->dst =~ /^$pre/;
75 # CALL TYPE / Possibly / Not sure if you need this to determine correct
77 # DDD normal call (Direct Dial Dsomething? ="LD"?)
79 # (toll free dst# should be sufficient to rate)
80 # DAT Directory AssisTance
81 # (dst# 411 "area code" should be sufficient to rate)
82 # DNS (Another sort of directory assistance?... only one record with
83 # "8195551212" in the dst#)
84 'dcontext', #probably don't need... map to cdr_type? calltypenum?
86 # DURATION Yes Units = seconds
87 'billsec', #need to trim .00 ?
89 # AMOUNT CHARGED No Will use Freeside rating and description name
90 sub { my( $cdr, $amount) = @_;
92 $cdr->upstream_price( $amount );
106 DATE startdate (+ CUST NO)
107 CUST NO (startdate time)
108 - Start of call (UNIX-style integer timestamp)
110 BTN *src - Caller*ID number / Source number
111 ORIG CITY channel - Channel used
112 TERM # *dst - Destination extension
113 TERM CITY dstchannel - Destination channel if appropriate
114 WTN *charged_party - Service number to be billed
115 CODE *accountcode - CDR account number to use: account
117 PROV/COUNTRY (used to prefix TERM # w/ 1 or 011)
119 CALL TYPE dcontext - Destination context
120 DURATION *billsec - Total time call is up, in seconds
121 AMOUNT CHARGED *upstream_price - Wholesale price from upstream