backup the schema for tables we don't need the data from. RT#85959
[freeside.git] / FS / FS / cdr / cia_callblast.pm
1 package FS::cdr::cia_callblast;
2
3 use strict;
4 use vars qw( @ISA %info $date $tmp_mday $tmp_mon $tmp_year);
5 use FS::cdr qw(_cdr_date_parser_maker);
6 use Time::Local;
7
8 @ISA = qw(FS::cdr);
9
10 %info = (
11   'name'          => 'Client Instant Access Callblast',
12   'weight'        => 510,
13   'header'        => 1,
14   'type'          => 'csv',
15   'sep_char'      => "|",
16   'import_fields' => [
17     'accountcode',
18     skip(2),          # First and last name
19
20     sub { my($cdr, $date) = @_;
21           $date =~ /^(\d{1,2})\/(\d{1,2})\/(\d\d(\d\d)?)$/
22             or die "unparsable date: $date"; #maybe we shouldn't die...
23           ($tmp_mday, $tmp_mon, $tmp_year) = ( $2, $1-1, $3 );
24         }, #Date
25
26     sub { my($cdr, $time) = @_;
27           #my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
28           $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2})$/
29             or die "unparsable time: $time"; #maybe we shouldn't die...
30           $cdr->startdate( timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year));
31           $cdr->answerdate( timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year));
32          
33         }, # Start time
34
35     sub { my($cdr, $time) = @_;
36           #my($sec, $min, $hour, $mday, $mon, $year)= localtime($cdr->startdate);
37           $time =~ /^(\d{1,2}):(\d{1,2}):(\d{1,2})$/
38             or die "unparsable time: $time"; #maybe we shouldn't die...
39           #$cdr->startdate( timelocal($3, $2, $1 ,$mday, $mon, $year) );
40           $cdr->enddate(
41             timelocal($3, $2, $1 ,$tmp_mday, $tmp_mon, $tmp_year) ); 
42         }, # End time
43
44     'disposition',    # Disposition
45     'dst',            # PhoneNumber
46     skip(3),          # Extension, Service Type, Filler
47     'src',            # ClientContactID
48     ],
49
50 );
51
52 sub skip { map {''} (1..$_[0]) }
53
54 1;