fix TeleAPI import (what kind of crack was Christopher smoking that he couldn't fix...
[freeside.git] / FS / FS / cdr / cisco.pm
1 package FS::cdr::cisco;
2
3 use strict;
4 use base qw( FS::cdr );
5 use vars qw( %info );
6 use FS::cdr qw( _cdr_date_parser_maker _cdr_min_parser_maker );
7 use Date::Parse;
8
9 %info = (
10   'name'          => 'Cisco Unified Call Manager',
11   'weight'        => 160,
12   'header'        => 2,     #0 default, set to 1 to ignore the first line, or
13                             # to higher numbers to ignore that number of lines
14   'type'          => 'csv', #csv (default), fixedlength or xls
15   'sep_char'      => ',',   #for csv, defaults to ,
16   'disabled'      => 0,     #0 default, set to 1 to disable
17
18   'import_fields' => [
19
20                                              skip(2),   #cdrRecordType
21                                                         #globalCallID_callManagerId
22                                               'clid',   #globalCallID_callId    
23                                              skip(1),   #origLegCallIdentifier  
24                 sub { my ($cdr, $calldate) = @_;
25                         $cdr->set('startdate', $calldate);
26                         $calldate = str2time($calldate);
27                         $cdr->set('calldate', $calldate);
28                                                   },    #dateTimeOrigination
29                                              skip(3),   #origNodeId     
30                                                         #origSpan
31                                                         #origIpAddr     
32                                                'src',   #callingPartyNumber     
33                                             skip(20),   #callingPartyUnicodeLoginUserID 
34                                                         #origCause_location     
35                                                         #origCause_value        
36                                                         #origPrecedenceLevel    
37                                                         #origMediaTransportAddress_IP   
38                                                         #origMediaTransportAddress_Port 
39                                                         #origMediaCap_payloadCapability
40                                                         #origMediaCap_maxFramesPerPacket
41                                                         #origMediaCap_g723BitRate       
42                                                         #origVideoCap_Codec     
43                                                         #origVideoCap_Bandwidth 
44                                                         #origVideoCap_Resolution        
45                                                         #origVideoTransportAddress_IP   
46                                                         #origVideoTransportAddress_Port 
47                                                         #origRSVPAudioStat      
48                                                         #origRSVPVideoStat      
49                                                         #destLegIdentifier      
50                                                         #destNodeId     
51                                                         #destSpan       
52                                                         #destIpAddr     
53                 sub { my ($cdr, $dst) = @_;
54                 $dst =~ s/\#//;
55                 $cdr->set('dst', $dst);                       
56                                                 },      #originalCalledPartyNumber      
57                                            skip(17),    #finalCalledPartyNumber 
58                                                         #finalCalledPartyUnicodeLoginUserID
59                                                         #destCause_location     
60                                                         #destCause_value
61                                                         #destPrecedenceLevel
62                                                         #destMediaTransportAddress_IP
63                                                         #destMediaTransportAddress_Port 
64                                                         #destMediaCap_payloadCapability 
65                                                         #destMediaCap_maxFramesPerPacket
66                                                         #destMediaCap_g723BitRate
67                                                         #destVideoCap_Codec
68                                                         #destVideoCap_Bandwidth
69                                                         #destVideoCap_Resolution
70                                                         #destVideoTransportAddress_IP
71                                                         #destVideoTransportAddress_Port
72                                                         #destRSVPAudioStat
73                                                         #destRSVPVideoStat
74                                         'answerdate',   #dateTimeConnect        
75                                            'enddate',   #dateTimeDisconnect
76                                         skip(3),        #lastRedirectDn 
77                                                         #pkid
78                                                         #originalCalledPartyNumberPartition     
79                                    'accountcode',       #callingPartyNumberPartition    
80                                          skip(2),       #finalCalledPartyNumberPartition
81                                                         #lastRedirectDnPartition
82                                        'billsec',       #duration
83                                         skip(23),       #origDeviceName
84                                                         #destDeviceName
85                                                         #origCallTerminationOnBehalfOf
86                                                         #destCallTerminationOnBehalfOf
87                                                         #origCalledPartyRedirectOnBehalfOf
88                                                         #lastRedirectRedirectOnBehalfOf 
89                                                         #origCalledPartyRedirectReason
90                                                         #lastRedirectRedirectReason
91                                                         #destConversationId
92                                                         #globalCallId_ClusterID
93                                                         #joinOnBehalfOf
94                                                         #comment        
95                                                         #authCodeDescription
96                                                         #authorizationLevel     
97                                                         #clientMatterCode
98                                                         #origDTMFMethod
99                                                         #destDTMFMethod 
100                                                         #callSecuredStatus
101                                                         #origConversationId
102                                                         #origMediaCap_Bandwidth
103                                                         #destMediaCap_Bandwidth 
104                                                         #authorizationCodeValue
105                                                         #outpulsedCallingPartyNumber
106                                               skip(23), #outpulsedCalledPartyNumber
107                                                         #origIpv4v6Addr 
108                                                         #destIpv4v6Addr 
109                                                         #origVideoCap_Codec_Channel2
110                                                         #origVideoCap_Bandwidth_Channel2
111                                                         #origVideoCap_Resolution_Channel2
112                                                         #origVideoTransportAddress_IP_Channel2  
113                                                         #origVideoTransportAddress_Port_Channel2
114                                                         #origVideoChannel_Role_Channel2
115                                                         #destVideoCap_Codec_Channel2
116                                                         #destVideoCap_Bandwidth_Channel2
117                                                         #destVideoCap_Resolution_Channel2
118                                                         #destVideoTransportAddress_IP_Channel2
119                                                         #destVideoTransportAddress_Port_Channel2
120                                                         #destVideoChannel_Role_Channel2
121                                                         #IncomingProtocolID
122                                                         #IncomingProtocolCallRef
123                                                         #OutgoingProtocolID
124                                                         #OutgoingProtocolCallRef        
125                                                         #currentRoutingReason
126                                                         #origRoutingReason
127                                                         #lastRedirectingRoutingReason
128                                                         #huntPilotPartition
129                                                         #huntPilotDN
130                                                         #calledPartyPatternUsage
131   ],
132
133 );
134
135
136
137 sub skip { map {''} (1..$_[0]) }
138
139 1;
140