ebb2d00550b4b9a9bf226c6bb00804aa2f126fd4
[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                                               'dst',    #originalCalledPartyNumber      
54                                            skip(17),    #finalCalledPartyNumber 
55                                                         #finalCalledPartyUnicodeLoginUserID
56                                                         #destCause_location     
57                                                         #destCause_value
58                                                         #destPrecedenceLevel
59                                                         #destMediaTransportAddress_IP
60                                                         #destMediaTransportAddress_Port 
61                                                         #destMediaCap_payloadCapability 
62                                                         #destMediaCap_maxFramesPerPacket
63                                                         #destMediaCap_g723BitRate
64                                                         #destVideoCap_Codec
65                                                         #destVideoCap_Bandwidth
66                                                         #destVideoCap_Resolution
67                                                         #destVideoTransportAddress_IP
68                                                         #destVideoTransportAddress_Port
69                                                         #destRSVPAudioStat
70                                                         #destRSVPVideoStat
71                                         'answerdate',   #dateTimeConnect        
72                                            'enddate',   #dateTimeDisconnect
73                                         skip(6),        #lastRedirectDn 
74                                                         #pkid
75                                                         #originalCalledPartyNumberPartition     
76                                                         #callingPartyNumberPartition    
77                                                         #finalCalledPartyNumberPartition
78                                                         #lastRedirectDnPartition
79                                        'billsec',       #duration
80                                         skip(48),       #origDeviceName
81                                                         #destDeviceName
82                                                         #origCallTerminationOnBehalfOf
83                                                         #destCallTerminationOnBehalfOf
84                                                         #origCalledPartyRedirectOnBehalfOf
85                                                         #lastRedirectRedirectOnBehalfOf 
86                                                         #origCalledPartyRedirectReason
87                                                         #lastRedirectRedirectReason
88                                                         #destConversationId
89                                                         #globalCallId_ClusterID
90                                                         #joinOnBehalfOf
91                                                         #comment        
92                                                         #authCodeDescription
93                                                         #authorizationLevel     
94                                                         #clientMatterCode
95                                                         #origDTMFMethod
96                                                         #destDTMFMethod 
97                                                         #callSecuredStatus
98                                                         #origConversationId
99                                                         #origMediaCap_Bandwidth
100                                                         #destMediaCap_Bandwidth 
101                                                         #authorizationCodeValue
102                                                         #outpulsedCallingPartyNumber
103                                                         #outpulsedCalledPartyNumber
104                                                         #origIpv4v6Addr 
105                                                         #destIpv4v6Addr 
106                                                         #origVideoCap_Codec_Channel2
107                                                         #origVideoCap_Bandwidth_Channel2
108                                                         #origVideoCap_Resolution_Channel2
109                                                         #origVideoTransportAddress_IP_Channel2  
110                                                         #origVideoTransportAddress_Port_Channel2
111                                                         #origVideoChannel_Role_Channel2
112                                                         #destVideoCap_Codec_Channel2
113                                                         #destVideoCap_Bandwidth_Channel2
114                                                         #destVideoCap_Resolution_Channel2
115                                                         #destVideoTransportAddress_IP_Channel2
116                                                         #destVideoTransportAddress_Port_Channel2
117                                                         #destVideoChannel_Role_Channel2
118                                                         #IncomingProtocolID
119                                                         #IncomingProtocolCallRef
120                                                         #OutgoingProtocolID
121                                                         #OutgoingProtocolCallRef        
122                                                         #currentRoutingReason
123                                                         #origRoutingReason
124                                                         #lastRedirectingRoutingReason
125                                                         #huntPilotPartition
126                                                         #huntPilotDN
127                                                         #calledPartyPatternUsage
128   ],
129
130 );
131
132
133
134
135 sub skip { map {''} (1..$_[0]) }
136
137 1;
138