fixup pivot code handling in netcentrex CDR handling, RT#4081
[freeside.git] / FS / FS / cdr / netcentrex.pm
1 package FS::cdr::netcentrex;
2
3 use strict;
4 use vars qw(@ISA %info);
5 use FS::cdr qw(_cdr_date_parser_maker);
6
7 @ISA = qw(FS::cdr);
8
9 #close enough http://wiki.freeswitch.org/wiki/Hangup_causes
10 #my %disposition = (
11 #  16 => 'ANSWERED',
12 #  17 => 'BUSY',
13 #  18 => 'NO USER RESPONSE',
14 #  19 => 'NO ANSWER',
15 #  156 => '??' #???
16 #);
17
18 %info = (
19   'name'          => 'NetCentrex',
20   'weight'        => 150,
21   'type'          => 'csv',
22   'sep_char'      => ';',
23   'import_fields' => [
24     '', #00 SU Identifier
25     '', #01 SU IP Address
26     '', #02 Conference ID
27     '', #03 Call ID
28     '', #04 Leg number (all 0)
29     _cdr_date_parser_maker('startdate'),  #05 Authorize timestamp
30     _cdr_date_parser_maker('answerdate'), #06 Start timestamp
31     'billsec', #'duration', #07 Duration
32     _e164_parser_maker('src',      'charged_party'),                 #08 Caller
33     _e164_parser_maker('dcontext', 'dst', 'norewrite_pivotonly'=>1) ,#09 Callee
34     'channel', #10 Source IP
35     'dstchannel', #11 Destination IP
36     'userfield', #12 selector Tag
37     '', #13 *service Tag
38     '', #14 *announcement Tag
39     '', #15 *route Table Tag
40     '', #16 vTrunkGroup Tag
41     '', #17 vTrunk Tag XXX ? another userfield?
42     '', #18 *termination Tag
43     '', #19 *location group Tag
44     '', #20 *GK Originating IP
45     '', #21 *GK Terminating IP
46     '', #22 *GK Originating Domain
47     '', #23 *GK Terminating Domain
48     '', #24 Malicious Call (all 0)
49     '', #25 Service (all 0)
50     'disposition', #26 Termination Cause 16/17/18/156
51     '', #27 Simulation Call (all 0) supposedly don't bill 1
52     '', #28 Type (all C)
53     _cdr_date_parser_maker('enddate'), #29 ReleaseTimeStamp
54         #seems empty from here in sampes...
55     '', #30
56     '', #31
57     '', #32
58     '', #33
59     '', #34
60     '', #35
61     '', #36
62     '', #37
63     '', #38
64     '', #39
65     '', #40
66     '', #41
67     '', #42
68     '', #43
69     '', #44
70     '', #45
71     '', #46
72     '', #47
73     '', #48
74     '', #49
75     '', #50
76
77         # * empty
78   ],
79
80 );
81
82 sub _e164_parser_maker {
83   my( $field, $pivot_field, %opt ) = @_;
84   return sub {
85     my( $cdr, $e164 ) = @_;
86     my( $pivot, $number ) = _e164_parse($e164);
87     if ( $opt{'norewrite_pivotonly'} && ! $pivot ) { 
88       $cdr->$pivot_field( $number );
89     } else {
90       $cdr->$field( $number );
91       $cdr->$pivot_field( $pivot );
92     }
93   };
94 }
95
96 sub _e164_parse {
97   my $e164 = shift;
98
99   $e164 =~ s/^e164://;
100
101   my ($pivot, $number);
102   if ( $e164 =~ /^O(\d+)$/ ) {
103     $pivot = ''; #?
104     $number = $1;
105   } elsif ( $e164 =~ /^000000(\d+)$/ ) {
106     $pivot = '';
107     $number = $1;
108   } elsif ( $e164 =~ /^(1\d{5})(\d+)$/ ) {
109     $pivot = $1;
110     $number = $2;
111   } else {
112     $pivot = '';
113     $number = $e164; #unparsable...
114   }
115
116   ( $pivot, $number );
117 }
118
119 1;
120
121 =pod
122
123        calldate - Call timestamp (SQL timestamp)
124        clid - Caller*ID with text
125                                           src - Caller*ID number / Source number
126                                           dst - Destination extension
127        dcontext - Destination context
128                                           channel - Channel used
129                                           dstchannel - Destination channel if appropriate
130        lastapp - Last application if appropriate
131        lastdata - Last application data
132                                           startdate - Start of call (UNIX-style integer timestamp)
133                                           answerdate - Answer time of call (UNIX-style integer timestamp)
134                                           enddate - End time of call (UNIX-style integer timestamp)
135        duration - Total time in system, in seconds
136                                           billsec - Total time call is up, in seconds
137                                           disposition - What happened to the call: ANSWERED, NO ANSWER, BUSY
138        amaflags - What flags to use: BILL, IGNORE etc, specified on a per
139        channel basis like accountcode.
140        accountcode - CDR account number to use: account
141        uniqueid - Unique channel identifier (Unitel/RSLCOM Event ID)
142                                           userfield - CDR user-defined field
143        cdr_type - CDR type - see FS::cdr_type (Usage = 1, S&E = 7, OC&C = 8)
144        charged_party - Service number to be billed
145        upstream_currency - Wholesale currency from upstream
146        upstream_price - Wholesale price from upstream
147        upstream_rateplanid - Upstream rate plan ID
148        rated_price - Rated (or re-rated) price
149        distance - km (need units field?)
150        islocal - Local - 1, Non Local = 0
151        calltypenum - Type of call - see FS::cdr_calltype
152        description - Description (cdr_type 7&8 only) (used for
153        cust_bill_pkg.itemdesc)
154        quantity - Number of items (cdr_type 7&8 only)
155        carrierid - Upstream Carrier ID (see FS::cdr_carrier)
156        upstream_rateid - Upstream Rate ID
157        svcnum - Link to customer service (see FS::cust_svc)
158        freesidestatus - NULL, done (or something)
159        cdrbatch
160
161 No. Field         Type/Length Format / Remarks              Description                          Example
162 00  SU Identifier String      This field is never empty.    SU Identifier (as defined by su-     su01
163                   <= 16 chars                               core.ini/[SU]/SUInstance key at SU
164                                                                                                  192.168.121.1
165                                                             initialization).
166                                                             By default, the SUInstance is set to
167                                                             a string that represents the SU
168                                                             private IP address.
169 01  SU IP address String      ipv4:xx.xx.xx.xx<:port>       SU IP address (and ASM port) as      ipv4:213.56.136.29: 2518
170                   <= 26 chars                               provided by su-
171                               This field is never empty.
172                                                             crouting.ini/[crRouting]/localASMa
173                                                             ddress key.
174 02  Conference ID String      When [CDR_FIELDS]             Unique call session identifier       Advised format
175                   <= 64 chars ReadlIDFormat is set to 1 in  provided by the SU, as received in   (ReadlIDFormat=1):
176                               ncx-cdr-wrapper.ini (advised  call initiation message (H.225       910a4b12 cd67d93f
177                               format):                      conferenceID field in Setup or       4300abd2 cc10a0a0
178                                                             ARQ).
179                               4x4 bytes as an hexadecimal                                        RealIDFormat=0:
180                               string; double words are
181                                                                                                  12.123.54.125.67.235.255.2
182                               space-separated
183                                                                                                  31.9.12.4.3.7.19.245.65
184                               When [CDR_FIELDS]
185                               ReadlIDFormat is set to 0 in
186                               ncx-cdr-wrapper.ini:
187                               16xdecimal notation of a 1-
188                               byte number (0..255), dot-
189                               separated.
190                               This field is never empty.
191 03  Call ID       String      When [CDR_FIELDS]             Call identifier provided by the ASM  Advised format
192                   <= 64 chars ReadlIDFormat is set to 1 in  in the SU (it can be the CallID or   (ReadlIDFormat=1):
193                               ncx-cdr-wrapper.ini (advised  the RealCallID according to what is  910a4b12 cd67d93f
194                               format):                      set in the ncx-cdr-wrapper.ini       4300abd2 cc10a0a0
195                                                             UseRealCallID field). It is received
196                               4x4 bytes as an hexadecimal                                        RealIDFormat=0:
197                                                             in call initiation message (H.225
198                               string; double words are
199                                                             callID field in Setup or ARQ).       12.123.54.125.67.235.255.2
200                               space-separated
201                                                                                                  31.9.12.4.3.7.19.245.65
202                               When [CDR_FIELDS]
203                               ReadlIDFormat is set to 0 in
204                               ncx-cdr-wrapper.ini:
205                               16xdecimal notation of a 1-
206                               byte number (0..255), dot-
207                               separated.
208                               This field may be empty if no
209                               H.225 callID is present in
210                               ARQ.
211 04  Leg number    Integer     Always set to 0 when the call Call attempt index, starting at 0.   0
212                   ~ 1 char    is not deflected.             Incremented whenever a call leg
213                                                             to a new destination is created.
214                               This field is never empty.
215                                                             A single call without any call
216                                                             forward service will only have 1
217                                                             CDR line, whose Leg number is set
218                                                             to 0.
219                                                             If a call is redirected (on
220                                                             CFU/CFB/CNFR), it will generate a
221                                                             second CDR line, leg number 1.
222                                                             The leg number is then
223                                                             incremented on each subsequent
224                                                             redirection.
225
226 05 Authorize       Long        It can have two formats as       Authorize date and time of the call    1039189431
227    timestamp       10 chars    given in the ncx-cdr-            leg => enable to have a date and
228                                wrapper.ini by the               time if a call is not connected.
229                                TimestampFormat field.           UTC.
230                                If TimestampFormat is set to     This is the ARQ or SETUP or
231                                0, the result string             INVITE reception timestamp for
232                                corresponds to the "epoch"       the first call leg. For next tickets,
233                                time, the number of elapsed      this is the call deflection processing
234                                seconds since 1970/01/01         start time. Thus, this value may
235                                00:00:00 (UTC)                   vary in tickets related to a
236                                                                 complete call.
237                                If TimestampFormat is set to
238                                1, the result string is 20 chars
239                                in length (format: YYYY-MM-
240                                DD HH:MM:SS)
241                                NOTE: if you choose
242                                TimestampFormat = 0 you
243                                can have the tenth of second
244                                (UseTenthOfSecond = 1) or
245                                the micro second
246                                (UseMicroSecond = 1)
247                                NOTE: you can hide
248                                timestamp equal to 0 (or
249                                1970/01/01 00:00:00) with
250                                the key HideNullTimestamp
251                                set to 1.
252                                This field is never empty.
253 06 Start timestamp Long        It can have two formats as       Starting date and time of the call     1039189431
254                    10 chars    given in the ncx-cdr-            leg. UTC.
255                                wrapper.ini by the
256                                                                 This is the CONNECT or OK (after
257                                TimestampFormat field.
258                                                                 INVITE) reception timestamp. It is
259                                If TimestampFormat is set to     set to the same value for all tickets
260                                0, the result string             related to a call.
261                                corresponds to the "epoch"
262                                time, the number of elapsed
263                                seconds since 1970/01/01
264                                00:00:00 (UTC)
265                                If TimestampFormat is set to
266                                1, the result string is 20 chars
267                                in length (format: YYYY-MM-
268                                DD HH:MM:SS)
269                                0 (or 1970/01/01 00:00:00)
270                                means the connection was not
271                                established for this call leg.
272                                NOTE: if you choose
273                                TimestampFormat = 0 you
274                                can have the tenth of second
275                                (UseTenthOfSecond = 1) or
276                                the micro second
277                                (UseMicroSecond = 1)
278                                NOTE: you can hide
279                                timestamp equal to 0 (or
280                                1970/01/01 00:00:00) with
281                                the key HideNullTimestamp
282                                set to 1.
283                                This field may be empty if the
284                                call is not connected.
285 07 Duration        Long        In seconds (0 means the          Duration of the call leg (in           6
286                    <= 10 chars connection was not               seconds), after the connection was
287                                established for this call leg).  established.
288                                NOTE: you can have the tenth     Set to 0 for SIP NOTIFICATION
289                                of second (UseTenthOfSecond      and SIP MESSAGE reports.
290                                = 1) or the micro second
291                                (UseMicroSecond = 1)
292                                This field is never empty.
293 08 Caller         String            e164:[number] or h323:[alias]  Main Source Alias in pivot format     e164:0010033575
294                                     or email:[alias]               (provided by the ASM)
295                   <= 128 chars
296                                     This field may be empty if the If pivot format cannot be
297                                     Caller pivot alias cannot be   computed then the main source
298                                     computed.                      alias is presented in originating
299                                                                    format and the "O" char is inserted
300                                     See Use Cases section for
301                                                                    at the beginning of the alias or
302                                     possible cases.
303                                                                    number.
304                                                                    NOTE: the phone-context and
305                                                                    trunk-context are set if present.
306 09 Callee         String            e164:[number] or h323:[alias]  E.164 Called Party Number alias or    e164:0010033762
307                                     or email:[alias]               H323 destination ID in pivot
308                   <= 128 chars
309                                                                    format (provided by the ASM)
310                                     This field may be empty if the
311                                     Callee pivot alias cannot be   If pivot format cannot be
312                                     computed.                      computed then the originating
313                                                                    format is presented and the "O"
314                                                                    char is inserted at the beginning of
315                                                                    the alias or number.
316                                                                    NOTE: the phone-context and
317                                                                    trunk-context are set if present.
318 10 Source IP      String            ipv4:xx.xx.xx.xx<:port>        If ncx-cdr-wrapper.ini/useFullIP =    ipv4:192.168.1.2:34123
319                                                                    0:
320                   <= 26 chars       This field may be empty if the
321                                     Source IP cannot be retrieved  Source IP address of the caller, as
322                                     in IP message mode.            used for IP filtering (thus, may be
323                                                                    either Packet IP address or
324                                                                    CallSignalAddress, depending on
325                                                                    su-
326                                                                    crouting.ini/[defaultH323Parameter
327                                                                    s]/ipFiltering key
328                                                                    It can also be changed by the
329                                                                    selector "extended actions"
330                                                                    parameter. See "selector extended
331                                                                    actions" dedicated documentation
332                                                                    for further information.
333                                                                    If ncx-cdr-wrapper.ini/useFullIP =
334                                                                    1:
335                                                                    Source IP packet address for the
336                                                                    call leg
337 11 Destination IP String            ipv4:xx.xx.xx.xx<:port>        If ncx-cdr-wrapper.ini/useFullIP =    ipv4:213.56.162.17
338                                                                    0:
339                   <= 26 chars       This field may be empty if
340                                     destination IP cannot be       Destination IP signaling address
341                                     resolved.                      for the call leg
342                                                                    If ncx-cdr-wrapper.ini/useFullIP =
343                                                                    1:
344                                                                    Destination IP packet address for
345                                                                    the call leg
346                                                                    NOTE: Can be different from the
347                                                                    signaling address when routing
348                                                                    through a proxy group. This field
349                                                                    refers to the proxy IP address.
350                                                                    Otherwise IP signaling address and
351                                                                    IP packet address are the same.
352 12 selector Tag   String            This field is empty for non    Extensible tag. See extension tag     in=33231412345,vp=165,si
353                   <= 199 chars      Business Services managed      format below.                         =123 tz=Europe/Berlin,
354                                     sources and for Sites with no
355                                                                    Selector Tag placed on the selector
356                                     PSTN ranges allocated.
357                                                                    for this call
358                                                                    See [ref: 2] and [ref: 3] for further
359                                                                          2            2
360                                                                    information.
361 13 service Tag    Full alphanumeric This field is empty for now.   Service Tag placed on the selector
362                   string                                           or on the vTrunkGroup for this call.
363                                                                    See [ref: 2] and [ref: 3] for further
364                                                                            2
365                                                                    information.
366 14 announcement Full alphanumeric This field is empty for now. Announcement Tag placed on the
367    Tag          string                                         selector, routeTable or
368                                                                vTrunkGroup for this call.
369                                                                See [ref: 2]and [ref: 3] for further
370                                                                                2
371                                                                information.
372 15 route Table Tag Full alphanumeric This field is empty for now.    Route table Tag placed on the
373                    string                                            route table for this call.
374                                                                      See [ref: 2] and [ref: 3] for further
375                                                                           2             2
376                                                                      information.
377 16 vTrunkGroup     Full alphanumeric This field is empty for now.    vTrunkGroupTag placed on the
378    Tag             string                                            vTrunkGroup for this call.
379                                                                      See [ref: 2] and [ref: 3] for further
380                                                                             2
381                                                                      information.
382 17 vTrunk Tag      String            This field is empty for non     Extensible tag. See extension tag     in=33156341289,vp=4232,s
383                    <= 199 chars      Business Services managed       format below.                         i=132,tz=Europe/Paris
384                                      destinations and for Sites with
385                                                                      vTrunk Tag placed on the vTrunk
386                                      no PSTN ranges allocated.
387                                                                      for this call.
388                                                                      See [ref: 2] and [ref: 3] for further
389                                                                               2           2
390                                                                      information.
391 18 termination Tag Full alphanumeric This field is empty for now.    Termination Tag placed on the
392                    string                                            Termination for this call.
393                                                                      See [ref: 2] and [ref: 3] for further
394                                                                                 2           2
395                                                                      information.
396 19 location group  Full alphanumeric This field is empty for now.    location group Tag placed on the
397    Tag             string                                            selector for this call.
398                                                                      See [ref: 2] and [ref: 3] for further
399                                                                                   2           2
400                                                                      information.
401 20 GK Originating  Full alphanumeric This field is empty for now.    Parameter provided by the ASM in
402    IP              string                                            the SU (reserved for future usage).
403 21 GK Terminating  Full alphanumeric This field is empty for now.    Parameter provided by the ASM in
404    IP              string                                            the SU (reserved for future usage).
405 22 GK Originating  Full alphanumeric This field is empty for now.    Parameter provided by the ASM in
406    Domain          string                                            the SU (reserved for future usage).
407 23 GK Terminating  Full alphanumeric This field is empty for now.    Parameter provided by the ASM in
408    Domain          string                                            the SU (reserved for future usage).
409 24 Malicious Call  Boolean           0/1                             Indicate if a call is malicious or    0
410                                                                      not. All calls to a specific called
411                    1 char
412                                                                      party will be tagged as malicious
413                                                                      when the malicious feature has
414                                                                      been activated.
415 25 Service         Long              0..31                           Bit mask for activated services for   6: at least one
416                    <= 3 chars                                        this call.                            TECHNOLOGY and one
417                                      This field is never empty.
418                                                                                                            REMOVE service objects
419                                                                      This is a combination between the
420                                                                                                            have been used during
421                                                                      following values:
422                                                                                                            routing process
423                                                                      1: if at least one CLIR service
424                                                                                                            10: at least one BASIC-
425                                                                      object has been used during
426                                                                                                            XACTION and one REMOVE
427                                                                      routing process
428                                                                                                            service objects have been
429                                                                      2: if at least one REMOVE service     used during routing process
430                                                                      object has been used during
431                                                                      routing process
432                                                                      4: if at least one TECHNOLOGY
433                                                                      service object has been used
434                                                                      during routing process
435                                                                      8: if at least one BASIC-XACTION
436                                                                      service object has been used
437                                                                      during routing process
438                                                                      16: if at least one SUBSTITUTION
439                                                                      service object has been used
440                                                                      during routing process
441                                                                      This is independent from the su-
442                                                                      crouting.ini configuration file and
443                                                                      in particular from the SPE
444                                                                      activation.
445 26 Termination     Long              Causes in the range [1-127]       Cause of the call termination.      16
446    Cause           <= 3 chars        are standard Q.850 causes
447                                      Causes >= 128 are specific
448                                      Comverse extension causes.
449                                      See [ref. 5] for possible values
450                                      and meanings.
451                                      This field is never empty.
452 27 Simulation Call Boolean           0/1                               Indicates if a call is a simulation 0
453                    1 char                                              call or not.
454                                      This field is never empty.
455                                                                        SIMULATION CALLS MUST NOT BE
456                                                                        BILLED.
457                                                                        Simulation calls can only be
458                                                                        generated through the Telnet
459                                                                        interface (tests and diagnostic
460                                                                        only).
461 28 Type            One character     Optional field depending on       Type of CDR:                        C
462                                      the UseType entry in ncx-cdr-
463                    1 char                                              - Call ('C'): for INVITE and SETUP
464                                      wrapper.ini. If set to 1, a
465                                      value in this field will be       - Notification ('N') for SIP
466                                      always printed: 'C' by default.   NOTIFICATION
467                                      'C', 'N' or 'M'.                  - Message ('M') for SIP MESSAGE
468                                      This field is never empty.
469 29 ReleaseTimeSta  Long              Optional field depending of       Release date of the leg.            1039189431
470    mp              10 chars          the UseReleaseTimeStamp
471                                      entry in ncx-cdr-wrapper.ini.
472                                      It can have two formats as
473                                      given in the ncx-cdr-
474                                      wrapper.ini by the
475                                      TimestampFormat field.
476                                      If TimestampFormat is set to
477                                      0, the result string
478                                      corresponds to the "epoch"
479                                      time, the number of elapsed
480                                      seconds since 1970/01/01
481                                      00:00:00 (UTC)
482                                      If TimestampFormat is set to
483                                      1, the result string is 20 chars
484                                      in length (format: YYYY-MM-
485                                      DD HH:MM:SS)
486                                      NOTE: if you choose
487                                      TimestampFormat = 0 you
488                                      can have the tenth of second
489                                      (UseTenthOfSecond = 1) or
490                                      the micro second
491                                      (UseMicroSecond = 1)
492                                      NOTE: you can hide
493                                      timestamp equal to 0 (or
494                                      1970/01/01 00:00:00) with
495                                      the key HideNullTimestamp
496                                      set to 1.
497                                      This field is empty when no
498                                      CRR message is received and
499                                      therefore it will be empty for
500                                      the CDR describing presence
501                                      message (SIP NOTIFY and SIP
502                                      MESSAGE). It is also empty
503                                      when the CDR is closed by the
504                                      AMU (e.g. if the SU is
505                                      detected as DOWN).
506                                      In all other cases, this field is
507                                      never empty
508 30 cgIdentity Tag  Full alphanumeric Optional: this field is filled if Extensible tag for Calling Party.   pu=33231345123,pr=23
509                    string            usecgidentitytag is set to 1 in   See extension tag format below.
510                    <= 132 chars      ncx-cdr-wrapper.ini.
511                                      This field is empty for non
512                                      Business Services/class V
513                                      managed sources.
514                                      The content of this field differs
515                                      between BS and MyCall
516                                      solutions.
517 31 cdIdentity Tag Full alphanumeric Optional: this field is filled if Extensible tag for Called Party. See pr=1111,bi=ADMIN
518                   string            usecdidentitytag is set to 1 in   extension tag format below.
519                   <= 132 chars      ncx-cdr-wrapper.ini
520                                     This field is empty for non
521                                     Business Services/class V
522                                     managed destinations.
523                                     The content of this field differs
524                                     between BS and MyCall
525                                     solutions.
526 32 Originating    String            Optional: this field is filled if E.164 Main Source alias or H323      e164:0010033575
527    Caller         <= 128 chars      useoriginatingcaller is set to 1  source ID in originating format (as
528                                     in ncx-cdr-wrapper.ini            received from the network)
529                                     e164:[number] or h323:[alias]     The Main Source alias is computed
530                                     or email:[alias]                  according to su-core.ini
531                                                                       configuration.
532                                                                       NOTE: the phone-context and
533                                                                       trunk-context are set if present.
534 33 Originating    String            Optional: this field is filled if E.164 Main Destination alias or      e164:0010033762
535    Callee         <= 128 chars      useoriginatingcallee is set to 1  H323 destination ID in originating
536                                     in ncx-cdr-wrapper.ini            format (as received from the
537                                                                       network)
538                                     e164:[number] or h323:[alias]
539                                     or email:[alias]                  The Main Destination alias is
540                                                                       computed according to su-core.ini
541                                                                       configuration.
542                                                                       NOTE: the phone-context and
543                                                                       trunk-context are set if present.
544 34 Terminating    String            Optional: this field is filled if E.164 Calling Party Number alias or  e164:0010033575
545    Caller         <= 128 chars      useterminatingcaller is set to 1  H323 source ID in terminating
546                                     in ncx-cdr-wrapper.ini            format (as provided to the
547                                                                       network).
548                                     e164:[number] or h323:[alias]
549                                     or email:[alias]                  NOTE: the phone-context and
550                                                                       trunk-context are set if present.
551 35 Terminating    String            Optional: this field is filled if E.164 Called Party Number alias or   e164:0010033762
552    Callee         <= 128 chars      useterminatingcallee is set to    H323 destination ID in terminating
553                                     1 in ncx-cdr-wrapper.ini.         format (as provided to the
554                                                                       network).
555                                     e164:[number] or h323:[alias]
556                                     or email:[alias]                  NOTE: the phone-context and
557                                                                       trunk-context are set if present.
558                                     This field may be empty if no
559                                     terminating destination aliases
560                                     can be computed by the CRE
561                                     (missing vtrunk transformation
562                                     or unable to found a vtrunk
563                                     for whatever routing reason),
564                                     or if the pivot to terminating
565                                     destination alias
566                                     transformation leads to an
567                                     empty alias.
568 36 Network          Long        Optional: this field is filled if  For H.323 the network timestamp      1039189431
569    Timestamp        10 chars    usenetworkcompletiontimesta        is measured at the first Progress or
570                                 mp is set to 1 in ncx-cdr-         ALERT or CONNECT received by
571                                 wrapper.ini.                       the CCS for direct call.
572                                                                    For redirected call, the network
573                                 It can have two formats as
574                                                                    timestamp is measured by the
575                                 given in the ncx-cdr-
576                                                                    CCS at the redirection decision
577                                 wrapper.ini by the
578                                                                    point,
579                                 TimestampFormat field.
580                                                                    NOTE: For H.323 calls, the tcp-ack
581                                 If TimestampFormat is set to
582                                                                    of the outgoing TCP connection is
583                                 0, the result string
584                                                                    not considered in the measure of
585                                 corresponds to the "epoch"
586                                                                    network timestamp
587                                 time, the number of elapsed
588                                 seconds since 1970/01/01           For SIP the network timestamp is
589                                 00:00:00 (UTC)                     measured at the first SESSION
590                                                                    PROGRESS or RINGING or OK
591                                 If TimestampFormat is set to
592                                                                    received by the CCS for direct call.
593                                 1, the result string is 20 chars
594                                 in length (format: YYYY-MM-        The network timestamp is
595                                 DD HH:MM:SS)                       measured at the redirection
596                                                                    decision point for redirected call.
597                                 NOTE: if you choose
598                                 TimestampFormat = 0 you
599                                 can have the tenth of second
600                                 (UseTenthOfSecond = 1) or
601                                 the micro second
602                                 (UseMicroSecond = 1)
603                                 NOTE: you can hide
604                                 timestamp equal to 0 (or
605                                 1970/01/01 00:00:00) with
606                                 the key HideNullTimestamp
607                                 set to 1.
608                                 This field may be empty if the
609                                 callee does not answer.
610 37 Targeted         Integer     Optional: this field is filled if  Provides information on the          12
611    adaptor                      UseTargetedAdaptors is set to      adaptor that has been used: "1"
612                     <= 2 chars
613                                 1 in ncx-cdr-wrapper.ini.          for adaptor1, "2" for adaptor2 and
614                                                                    "12" for adaptor1 and adaptor2
615                                 "1", "2" or "12"
616                                                                    See the amu-core.ini file section
617                                                                    for further details on adaptors
618                                                                    definition.
619 38 Adaptor1 errors  String      Optional: this field is filled if  Report errors on adaptor1 at the     cra,crr
620                                 UseAdaptor1Errors is set to 1      adaptor API level.
621                     <= 15 chars
622                                 in ncx-cdr-wrapper.ini.
623                                 "nca" (error on the new call
624                                 authorize)
625                                 "cra" (error on the call re-
626                                 authorize)
627                                 "ncr" (error on the new call
628                                 report)
629                                 "crr" (error on the call release
630                                 report)
631                                 When several errors occurred,
632                                 comma separated notation will
633                                 be used.
634                                 Empty when no error has
635                                 been detected.
636 39 Source signaling String      Optional: this field is filled in  Source IP signaling address for the  ipv4:192.168.1.2:34123
637    IP                           only if useFullIP is set to 1 in   call leg.
638                     <= 26 chars
639                                 the ncx-cdr-wrapper.ini file.
640                                                                    It can be changed by the selector
641                                 ipv4:xx.xx.xx.xx<:port>            "extended actions" parameter. See
642                                                                    "selector extended actions"
643                                 This field may be empty if the
644                                                                    dedicated documentation for
645                                 Source IP cannot be retrieved
646                                                                    further information.
647                                 in IP message mode.
648 40 Destination      String      Optional: this fields is filled in Destination IP signaling address     ipv4:213.56.162.17
649    signaling IP                 only if useFullIP is set to 1 in   for the call leg
650                     <= 26 chars
651                                 ncx-cdr-wrapper.ini file.
652                                 ipv4:xx.xx.xx.xx<:port>, can
653                                 be empty if destination IP
654                                 cannot be resolved.
655 41 Source point      Unsigned integer  Optional: this field is filled in   SS7 point code, node identifier 1234
656    code                                only if usePC is set to 1 in the
657                      <= 5 chars
658                                        ncx-cdr-wrapper.ini file.
659                                        SIP: FROM header [TG-TEL]:
660                                        PC is Encoded in the trunk-
661                                        group part of a "tel" URI
662                                        extension (see also RFC
663                                        3966).
664                                        H.323: H.225/circuitInfo:
665                                        Encoded in an
666                                        sourceCircuitID.cic.pointCode.
667 42 Destination point Unsigned integer  Optional: this field is filled in   SS7 point code, node identifier 1234
668    code                                only if usePC is set to 1 in the
669                      <= 5 chars
670                                        ncx-cdr-wrapper.ini file.
671                                        SIP: TO header [TG-TEL]: PC
672                                        is encoded in the trunk-group
673                                        part of a "tel" URI extension
674                                        (see also RFC 3966).
675                                        H.323: H.225/circuitInfo:
676                                        Encoded in a
677                                        destinationCircuitID.cic.pointC
678                                        ode.
679 43 Origination tag   Full alphanumeric Optional: this field is filled in   Origination tag placed on the   crr=...,poi=...
680                      string            only if useOriginationTag is        origination for this call.
681                                        set to 1 in the ncx-cdr-
682                                        wrapper.ini file.
683 44 Proxy group tag   Full alphanumeric Optional: this field is filled in   Proxy group Tag placed on the
684                      string            only if useProxyGroupTag is         proxy group for this call.
685                                        set to 1 in the ncx-cdr-
686                                        wrapper.ini file.
687                                        This field is empty for now.
688 45 Advice of Charge  String            Optional: this field only is filled AOC received.                   rend=10.2,unit=EURO
689                                        in if UseAoc is set to 1 in ncx-
690                      <= 50 chars       cdr-wrapper.ini file.               Available with CCS 3.8.4.
691                                        This field may be empty if
692                                        AOC service is not used or if
693                                        no AOC value is available.
694                                        <aocType>=<amount>,unit=
695                                        <string> with:
696                                        1. <aocType> (max length:
697                                        7 chars):
698                                        Received AOC-D: 'rduring'
699                                        Received AOC-E, 'rend'
700                                        Other AOC types are not yet
701                                        supported by the su-core and
702                                        therefore are ignored.
703                                        2. <amount> (max length:
704                                        14 chars):
705                                        The amount is decoded from
706                                        the received AOC-D or AOC-E.
707                                        This value is mandatory in an
708                                        AOC.
709                                        3. unit=<string> (max length:
710                                        15 chars):
711                                        The unit string is the decoded
712                                        unit value in the received
713                                        AOC-D or AOC-E. This value is
714                                        mandatory in an AOC.
715 46 Routing Context String       Optional                          Routing context of the leg.          basic
716                    <= 5 chars   3 possible values:                For IMS calls, routing context has
717                                                                   the value "orig" or "term".
718                                 - basic                           Otherwise, it is set to "basic".
719                                 - orig
720                                                                   Dependencies:
721                                 - term
722                                                                   -            amu-core-4.8.0
723                                                                   -            adaptor-generic-cdr-
724                                                                     1.8.0
725                                                                   -            ncx-cdr-wrapper-1.8.0
726 47 Originating     String       Optional: this field is filled if E164 Main Source alias or H323       e164:33762
727    Original Caller <= 128 chars useoriginatingoriginalcaller is   source ID in originating format (as
728                                 set to 1 in ncx-cdr-              received from the network) of the
729                                 wrapper.ini.                      original caller.
730                                 e164:[number] or h323:[alias]     The main source alias is computed
731                                 or email:[alias]                  according to su-core.ini
732                                                                   configuration.
733                                                                   NOTE: the phone-context and
734                                                                   trunk-context are set if present.
735                                                                   Dependencies:
736                                                                   -            amu-core-4.10.0
737                                                                   -            adaptor-generic-cdr-
738                                                                     1.10.0
739                                                                   -            ncx-cdr-wrapper-1.10.0
740 48 Pivot Original  String       Optional: this field is filled if E164 Main Source alias or H323       E164:0010033762
741    Caller          <= 128 chars usepivotoriginalcaller is set to  source ID in pivot format (as
742                                 1 in ncx-cdr-wrapper.ini.         received from the network) of the
743                                                                   original caller
744                                 e164:[number] or h323:[alias]
745                                 or email:[alias]                  They are sent if present by SU if
746                                                                   su-
747                                                                   crouting.ini/[compatibility]/aliasRe
748                                                                   porting is 5_0_0 or greater
749                                                                   NOTE: the phone-context and
750                                                                   trunk-context are set if present.
751                                                                   Dependencies:
752                                                                   -            amu-core-4.10.0
753                                                                   -            adaptor-generic-cdr-
754                                                                     1.10.0
755                                                                   -            ncx-cdr-wrapper-1.10.0
756 49 Terminating     String       Optional: this field is filled if E164 Main Source alias or H323       E164:0010033762
757    Original Caller <= 128 chars useterminatingoriginalcaller is   source ID in terminating format (as
758                                 set to 1 in ncx-cdr-              received from the network) of the
759                                 wrapper.ini.                      original caller.
760                                 e164:[number] or h323:[alias]     They are sent if present by SU if
761                                 or email:[alias]                  su-
762                                                                   crouting.ini/[compatibility]/aliasRe
763                                                                   porting is 5_0_0 or greater
764                                                                   NOTE: the phone-context and
765                                                                   trunk-context are set if present.
766                                                                   Dependencies:
767                                                                   -            amu-core-4.10.0
768                                                                   -            adaptor-generic-cdr-
769                                                                     1.10.0
770                                                                   -            ncx-cdr-wrapper-1.10.0
771 50 Pivotclir Boolean Optional: this field is filled if Pivot CLIR calculated with caller  clir=0
772                      UsePivotClir is set to 1 in ncx-  information.
773              6 chars cdr-wrapper.ini.
774                                                        Dependencies:
775                      0 means that Calling Line
776                      Identification is showed.         -           amu-core-4.12.0
777                      1 means that Calling Line         -           adaptor-generic-cdr-
778                      Identification is hidden.           1.12.0
779                                                        -           ncx-cdr-wrapper-1.12.0
780