remove index for removed column cdr.cdrbatch
[freeside.git] / FS / FS / cdr / avaya_ipo.pm
1 package FS::cdr::avaya_ipo;
2
3 use strict;
4 use vars qw( @ISA %info $tmp_mon $tmp_mday $tmp_year );
5 use Time::Local;
6 use FS::cdr;
7 use Date::Parse;
8
9 @ISA = qw(FS::cdr);
10
11 %info = (
12   'name'          => 'Avaya IPO',
13   'weight'        => 124,
14   'header'        => 0,
15   'import_fields' => [
16
17
18          sub { my ($cdr, $info) = @_;
19                 my @data = split(/\s+/, $info);
20                 my $calldate = $data[4]. " ". $data[5];
21
22                 $cdr->set('calldate', $calldate);
23                 $calldate =~ /^(\d{4})\/(\d{2})\/(\d{2})\s*(\d{2}):(\d{2}):(\d{2})$/
24                         or die "unparseable date: $calldate";
25                 my $tmp_date = "$2/$3/$1 $4:$5:$6";
26                 $tmp_date = str2time($tmp_date);
27                 $cdr->set('startdate', $tmp_date);
28
29               }, #DateTime
30
31          sub { my ($cdr, $duration) = @_;
32                 my ($hours,$min,$sec) = split(/:/, $duration);
33                 my $seconds += ($min * 60)+ ($hours * 60*60) + $sec;
34                 $cdr->set('billsec',$seconds); 
35              } , # Duration 00:00:00
36         skip(1), # Ring time
37         sub { my ($cdr, $info) = @_;
38                 my ($src,$ip) = split(/@/,$info);
39                 $cdr->set('src',$src); 
40
41               }, # Callers number
42         skip(2), # direction
43                  # Called number
44           'dst', # Dialed number
45   'accountcode', # Accountcode
46      'uniqueid', # call ID
47         skip(5), # continuation
48    'disposition',# Party2Device
49         skip(9)  # AuthValid
50                  # User Charged
51                  # call Charge
52                  # Currency
53                  # Amount at Last User Change
54                  # Call Units
55                  # Units at Last User Change
56                  # Cost per Unit
57                  # Markup
58
59
60 ],
61 );
62
63 sub skip { map {''} (1..$_[0]) }
64
65 1;
66