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