GSM TAP3.12 export, RT#20768
[freeside.git] / FS / FS / cdr / gsm_tap3_12.pm
1 package FS::cdr::gsm_tap3_12;
2 use base qw( FS::cdr );
3
4 use strict;
5 use vars qw( %info %TZ );
6 use Time::Local;
7 #use Data::Dumper;
8
9 %TZ = (
10   '+0000' => 'XXX-0',
11   '+0100' => 'XXX-1',
12   '+0200' => 'XXX-2',
13   '+0300' => 'XXX-3',
14   '+0400' => 'XXX-4',
15   '+0500' => 'XXX-5',
16   '+0600' => 'XXX-6',
17   '+0700' => 'XXX-7',
18   '+0800' => 'XXX-8',
19   '+0900' => 'XXX-9',
20   '+1000' => 'XXX-10',
21   '+1100' => 'XXX-11',
22   '+1200' => 'XXX-12',
23   '-0000' => 'XXX+0',
24   '-0100' => 'XXX+1',
25   '-0200' => 'XXX+2',
26   '-0300' => 'XXX+3',
27   '-0400' => 'XXX+4',
28   '-0500' => 'XXX+5',
29   '-0600' => 'XXX+6',
30   '-0700' => 'XXX+7',
31   '-0800' => 'XXX+8',
32   '-0900' => 'XXX+9',
33   '-1000' => 'XXX+10',
34   '-1100' => 'XXX+11',
35   '-1200' => 'XXX+12',
36 );
37
38 %info = (
39   'name'          => 'GSM TAP3 release 12',
40   'weight'        => 50,
41   'type'          => 'asn.1',
42   'import_fields' => [],
43   'asn_format'    => {
44     'spec'     => _asn_spec(),
45     'macro'    => 'TransferBatch', #XXX & skip the Notification ones?
46     'header_buffer' => sub {
47       my $TransferBatch = shift;
48
49       my $networkInfo = $TransferBatch->{networkInfo};
50
51       my $recEntityInfo = $networkInfo->{recEntityInfo};
52       my %recEntity = map { $_->{recEntityCode} => $_->{recEntityId} } @$recEntityInfo;
53
54       my $utcTimeOffsetInfo = $networkInfo->{utcTimeOffsetInfo};
55       my %utcTimeOffset = map { $_->{utcTimeOffsetCode} => $_->{utcTimeOffset} } @$utcTimeOffsetInfo;
56
57       { recEntity        => \%recEntity,
58         utcTimeOffset    => \%utcTimeOffset,
59         tapDecimalPlaces => $TransferBatch->{accountingInfo}{tapDecimalPlaces},
60       };
61     },
62     'arrayref' => sub { shift->{'callEventDetails'}; },
63     'map'      => {
64       'startdate'          => sub { my($row, $buffer) = @_;
65                                     my $callinfo = $row->{mobileOriginatedCall}{basicCallInformation};
66                                     my $timestamp = $callinfo->{callEventStartTimeStamp};
67
68                                     my $localTimeStamp = $timestamp->{localTimeStamp};
69                                     $localTimeStamp =~ /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/
70                                       or die "unparsable timestamp: $localTimeStamp\n"; #. Dumper($callinfo);
71                                     my($year, $mon, $day, $hour, $min, $sec) = ($1, $2, $3, $4, $5, $6);
72
73                                     my $utcTimeOffsetCode = $timestamp->{utcTimeOffsetCode};
74                                     my $utcTimeOffset = $buffer->{utcTimeOffset}{ $utcTimeOffsetCode };
75                                     local($ENV{TZ}) = $TZ{ $utcTimeOffset };
76
77                                     timelocal($sec, $min, $hour, $day, $mon-1, $year);
78                                   },
79       'duration'           => sub { shift->{mobileOriginatedCall}{basicCallInformation}{totalCallEventDuration} },
80       'billsec'            => sub { shift->{mobileOriginatedCall}{basicCallInformation}{totalCallEventDuration} }, #same..
81       'src'                => sub { shift->{mobileOriginatedCall}{basicCallInformation}{chargeableSubscriber}{simChargeableSubscriber}{msisdn} },
82       'charged_party_imsi' => sub { shift->{mobileOriginatedCall}{basicCallInformation}{chargeableSubscriber}{simChargeableSubscriber}{imsi} },
83       'dst'                => sub { shift->{mobileOriginatedCall}{basicCallInformation}{destination}{calledNumber} }, #dialledDigits?
84       'carrierid'          => sub { my( $row, $buffer ) = @_;
85                                     my $recEntityCode = $row->{mobileOriginatedCall}{locationInformation}{networkLocation}{recEntityCode};
86                                     $buffer->{recEntity}{ $recEntityCode };
87                                   },
88       'userfield'          => sub { shift->{mobileOriginatedCall}{operatorSpecInformation}[0] },
89       'servicecode'        => sub { shift->{mobileOriginatedCall}{basicServiceUsedList}[0]{basicService}{serviceCode}{teleServiceCode} },
90       'upstream_price'     => sub { my($row, $buffer) = @_;
91                                     sprintf('%.'.$buffer->{tapDecimalPlaces}.'f',
92                                       $row->{mobileOriginatedCall}{basicServiceUsedList}[0]{chargeInformationList}[0]{chargeDetailList}[0]{charge}
93                                       / ( 10 ** $buffer->{tapDecimalPlaces} )
94                                     )
95                                   },
96       'calltypenum'        => sub { shift->{mobileOriginatedCall}{basicServiceUsedList}[0]{chargeInformationList}[0]{callTypeGroup}{callTypelevel1} },
97       'quantity'           => sub { shift->{mobileOriginatedCall}{basicServiceUsedList}[0]{chargeInformationList}[0]{chargedUnits} },
98       'quantity_able'      => sub { shift->{mobileOriginatedCall}{basicServiceUsedList}[0]{chargeInformationList}[0]{chargeableUnits} },
99     },
100   },
101 );
102
103 #accepts qsearch parameters as a hash or list of name/value pairs, but not
104 #old-style qsearch('cdr', { field=>'value' })
105
106 use Date::Format;
107 use FS::Conf;
108 sub tap3_12_export {
109   my %qsearch = ();
110   if ( ref($_[0]) eq 'HASH' ) {
111     %qsearch = %{ $_[0] };
112   } else {
113     %qsearch = @_;
114   }
115
116   #if these get huge we might need to get a count and do a paged search
117   my @cdrs = qsearch({ 'table'=>'cdr', %qsearch, 'order_by'=>'calldate ASC' });
118
119   my $conf = new FS::Conf;
120
121   eval "use Convert::ASN1";
122   die $@ if $@;
123
124   my $asn = Convert::ASN1->new;
125   $asn->prepare( _asn_spec() ) or die $asn->error;
126
127   my $TransferBatch = $asn->find('TransferBatch') or die $asn->error;
128
129   my %hash = _TransferBatch(); #static information etc.
130
131   my $now = time;
132   my $utcTimeOffset = time2str('%z', $now);
133
134   ###
135   # accountingInfo
136   ###
137
138   #mandatory
139   $hash{localCurrency} = $conf->config('currency') || 'USD';
140
141   ###
142   # batchControlInfo
143   ###
144
145   #optional
146   $hash{batchControlInfo}->{fileCreationTimeStamp}   = { 'localTimeStamp' => time2str('%Y%m%d%H%M%S', $now),
147                                                          'utcTimeOffset'  => $utcTimeOffset,
148                                                        };
149
150   #The timestamp used to select calls for transfer.  All call records available prior to the timestamp are transferred.
151   # This gives an indication to the HPMN as to how ‘up-to-date’ the information is.
152   $hash{batchControlInfo}->{transferCutOffTimeStamp} = { 'localTimeStamp' => time2str('%Y%m%d%H%M%S', $cdrs[-1]->calldate_unix ),
153                                                          'utcTimeOffset'  => $utcTimeOffset,
154                                                        };
155
156   #The date and time at which the file was made available to the Recipient PMN.
157   # Physically this will normally be the timestamp when the file transfer
158   # commenced to the Recipient PMN, i.e. start of push, however on some systems
159   # this will be the timestamp when the file was made available to be pulled.
160   $hash{batchControlInfo}->{fileAvailableTimeStamp}  = { 'localTimeStamp' => time2str('%Y%m%d%H%M%S', $now),
161                                                           'utcTimeOffset'  => $utcTimeOffset,
162                                                         };
163
164   # A unique identifier used to determine the network which is the Sender of the data.
165   # The full list of codes in use is given in TADIG PRD TD.13: PMN Naming Conventions.
166   $hash{batchControlInfo}->{sender} = $conf->config('cdr-gsm_tap3-sender') || 'ZZZZZ'; #reserved: Y*, ZO-ZZ
167
168   #XXX customer or agent field of some sort
169   # A unique identifier used to determine which network the data is being sent to,
170   #  i.e. the Recipient.
171   # Derivation: GSM Association PRD TD.13: PMN Naming Conventions.
172   $hash{batchControlInfo}->{recipient} = 'GNQHT';
173
174   #XXX
175   #A unique reference which identifies each TAP Data Interchange sent by one PMN to another, specific, PMN.
176   # The sequence commences at 1 and is incremented by one for each subsequent TAP Data Interchange sent by the Sender PMN to a particular Recipient PMN.
177   # Separate sequence numbering must be used for Test Data and Chargeable Data.  Having reached the maximum value (99999) the number must recycle to 1.
178   $hash{batchControlInfo}->{fileSequenceNumber} = '00178';
179
180   ###
181   # networkInfo
182   ###
183
184   $hash{networkInfo}->{utcTimeOffsetInfo}[0]{utcTimeOffset} = $utcTimeOffset;
185
186   #XXX recording entity IDs, referenced by recEntityCode
187   #$hash->{networkInfo}->{recEntityInfo}[0]{recEntityId} = '340010100';
188   #$hash->{networkInfo}->{recEntityInfo}[1]{recEntityId} = '240556000000';
189
190   ###
191   # auditControlInfo
192   ###
193
194   #mandatory
195   $hash{auditControlInfo}->{callEventDetailsCount} = scalar(@cdrs);
196
197   #these two are optional
198   $hash{auditControlInfo}->{earliestCallTimeStamp} = { 'localTimeStamp' => time2str('%Y%m%d%H%M%S', $cdrs[0]->calldate_unix),
199                                                        'utcTimeOffset'  => $utcTimeOffset,
200                                                      };
201   $hash{auditControlInfo}->{latestCallTimeStamp}   = { 'localTimeStamp' => time2str('%Y%m%d%H%M%S', $cdrs[-1]->calldate_unix),
202                                                        'utcTimeOffset'  => $utcTimeOffset,
203                                                      };
204
205   #mandatory
206   my $totalCharge = 0;
207   $totalCharge += $_->rated_price foreach @cdrs;
208   $hash{totalCharge} = sprintf('%.5f', $totalCharge);
209
210   ###
211   # callEventDetails
212   ###
213
214   $hash{callEventDetails} = [ map tap3_12_export_cdr($_), @cdrs ];
215
216   ###
217
218   $TransferBatch->encode( \%hash );
219
220 }
221
222 sub _TransferBatch {
223
224   #accounting related information
225   'accountingInfo'   => {
226                           #mandatory
227                           #'localCurrency'          => 'USD',
228                           'tapDecimalPlaces'       => 5,
229                           'currencyConversionInfo' => [
230                                                         {
231                                                           'numberOfDecimalPlaces' => 5,
232                                                           'exchangeRate'          => 152549, #XXX ??? "exchange rate +VAT" ?
233                                                           'exchangeRateCode'      => 1
234                                                         }
235                                                       ],
236                           #optional: may conditionally include taxation and discounting tables, and, optionally, TAP currency
237                         },
238
239   'batchControlInfo' => {
240                           #mandatory
241                           'specificationVersionNumber' => 3,
242                           'releaseVersionNumber'       => 12,
243
244                           #'sender' => 'MDGTM',
245                           #'recipient' => 'GNQHT',
246                           #'fileSequenceNumber' => '00178',
247
248                           #'transferCutOffTimeStamp' => {
249                           #                               'localTimeStamp' => '20121230050222',
250                           #                               'utcTimeOffset' => '+0300'
251                           #                             },
252                           #'fileAvailableTimeStamp' => {
253                           #                              'localTimeStamp' => '20121230035052',
254                           #                              'utcTimeOffset' => '+0100'
255                           #                            }
256
257                           #optional
258                           #'fileCreationTimeStamp' => {
259                           #                             'localTimeStamp' => '20121230050222',
260                           #                             'utcTimeOffset' => '+0300'
261                           #                           },
262
263                           #optional: file type indicator which will only be present where the file represents test data
264                           #optional: RAP File Sequence Number (used where the batch has previously been returned with a fatal error and is now being resubmitted) (not fileSequenceNumber?)
265
266                           #optional: beyond the scope of TAP and has been bilaterally agreed
267                           #'operatorSpecInformation' => [
268                           #                               '', # '|File proc MTH LUXMA: 1285348027|' Operator Specific Information
269                           #                                   # probably just leave out
270                           #                             ],
271      
272
273                         },
274
275   #Network Information is a group of related information which pertains to the Sender PMN
276   'networkInfo'      => {
277                           #must be present where Recording Entity Codes are present within the TAP file
278                           'recEntityInfo'     => [
279                                                    {
280                                                      'recEntityCode' => 1,
281                                                      'recEntityType' => 1, #MSC
282                                                      #'recEntityId'   => '340010100',
283                                                    },
284                                                    {
285                                                      'recEntityCode' => 2,
286                                                      'recEntityType' => 2, #SMSC
287                                                      #'recEntityId'   => '240556000000',
288                                                    },
289                                                  ],
290                           #mandatory
291                           'utcTimeOffsetInfo' => [
292                                                    {
293                                                      'utcTimeOffsetCode' => 1,
294                                                      #'utcTimeOffset'     => '+0300',
295                                                    }
296                                                  ]
297                         },
298
299   #identifies the end of the Transfer Batch
300   'auditControlInfo' => {
301                           #mandatory
302                           #'callEventDetailsCount' => 4,
303                           'totalTaxValue'         => 0,
304                           'totalDiscountValue'    => 0,
305                           #'totalCharge'           => 50474,
306
307                           #these two are optional
308                           #'earliestCallTimeStamp' => {
309                           #                             'localTimeStamp' => '20121229102501',
310                           #                             'utcTimeOffset' => '+0300'
311                           #                           },
312                           #'latestCallTimeStamp'   => {
313                           #                             'localTimeStamp' => '20121229102807',
314                           #                             'utcTimeOffset' => '+0300'
315                           #                           }
316                           #optional: beyond the scope of TAP and has been bilaterally agreed
317                           #'operatorSpecInformation' => [
318                           #                               '',
319                           #                             ],
320                         },
321 }
322
323 sub tap3_12_export_cdr {
324   my $self = shift;
325
326   #one of Mobile Originated Call, Mobile Terminated Call, Mobile Session, Messaging Event, Supplementary Service Event, Service Centre Usage, GPRS Call, Content Transaction or Location Service
327   # Each occurrence must have no more than one of these present
328
329   { #either tele or bearer service usage originated by the mobile subscription (others?)
330     'mobileOriginatedCall' => {
331
332       #identifies the Network Location, which includes the MSC responsible for handling
333       # the call and, where appropriate, the Geographical Location of the mobile
334       'locationInformation' => {
335                                  'networkLocation' => {
336                                                         'recEntityCode' => $self->carrierid, #XXX Recording Entity (per 2.5, from "Reference Tables")
337                                                       }
338                                },
339
340       #Operator Specific Information: beyond the scope of TAP and has been bilaterally agreed
341       'operatorSpecInformation' => [
342                                      $self->userfield, ##'|Seq: 178 Loc: 1|'
343                                    ],
344
345       #The type of service used together with all related charging information
346       'basicServiceUsedList' => [
347                                   {
348                                     #identifies the actual Basic Service used
349                                     'basicService' => {
350                                                         #one of Teleservice Code or Bearer Service Code as determined by the service type used
351                                                         'serviceCode' => {
352                                                                            #XXX
353                                                                            #00 All teleservices
354                                                                            #10 All Speech transmission services
355                                                                            #11 Telephony
356                                                                            #12 Emergency calls
357                                                                            #20 All SMS Services
358                                                                            #21 Short Message MT/PP
359                                                                            #22 Short Message MO/PP
360                                                                            #60 All Fax Services
361                                                                            #61 Facsimile Group 3 & alternative speech
362                                                                            #62 Automatic Facsimile Group 3
363                                                                            #63 Automatic Facsimile Group 4
364                                                                            #70 All data teleservices (compound)
365                                                                            #80 All teleservices except SMS (compound)
366                                                                            #90 All voice group call services
367                                                                            #91 Voice group call
368                                                                            #92 Voice broadcast call
369                                                                            'teleServiceCode' => $self->servicecode, #'11'
370
371                                                                            #Bearer Service Code
372                                                                            # Must be present within group Service Code where the type of service used
373                                                                            #  was a bearer service. Must not be present when the type of service used
374                                                                            #  was a tele service and, therefore, Teleservice Code is present.
375                                                                            # Group Bearer Codes, identifiable by the description ‘All’, should only
376                                                                            #  be used where details of the specific services affected are not
377                                                                            #  available from the network.
378                                                                            #00 All Bearer Services
379                                                                            #20 All Data Circuit Asynchronous Services
380                                                                            #21 Duplex Asynch. 300bps data circuit
381                                                                            #22 Duplex Asynch. 1200bps data circuit
382                                                                            #23 Duplex Asynch. 1200/75bps data circuit
383                                                                            #24 Duplex Asynch. 2400bps data circuit
384                                                                            #25 Duplex Asynch. 4800bps data circuit
385                                                                            #26 Duplex Asynch. 9600bps data circuit
386                                                                            #27 General Data Circuit Asynchronous Service
387                                                                            #30 All Data Circuit Synchronous Services
388                                                                            #32 Duplex Synch. 1200bps data circuit
389                                                                            #34 Duplex Synch. 2400bps data circuit
390                                                                            #35 Duplex Synch. 4800bps data circuit
391                                                                            #36 Duplex Synch. 9600bps data circuit
392                                                                            #37 General Data Circuit Synchronous Service
393                                                                            #40 All Dedicated PAD Access Services
394                                                                            #41 Duplex Asynch. 300bps PAD access
395                                                                            #42 Duplex Asynch. 1200bps PAD access
396                                                                            #43 Duplex Asynch. 1200/75bps PAD access
397                                                                            #44 Duplex Asynch. 2400bps PAD access
398                                                                            #45 Duplex Asynch. 4800bps PAD access
399                                                                            #46 Duplex Asynch. 9600bps PAD access
400                                                                            #47 General PAD Access Service
401                                                                            #50 All Dedicated Packet Access Services
402                                                                            #54 Duplex Synch. 2400bps PAD access
403                                                                            #55 Duplex Synch. 4800bps PAD access
404                                                                            #56 Duplex Synch. 9600bps PAD access
405                                                                            #57 General Packet Access Service
406                                                                            #60 All Alternat Speech/Asynchronous Services
407                                                                            #70 All Alternate Speech/Synchronous Services
408                                                                            #80 All Speech followed by Data Asynchronous Services
409                                                                            #90 All Speech followed by Data Synchronous Services
410                                                                            #A0 All Data Circuit Asynchronous Services (compound)
411                                                                            #B0 All Data Circuit Synchronous Services (compound)
412                                                                            #C0 All Asynchronous Services (compound)
413                                                                          }
414                                                         #conditionally also contain the following for UMTS: Transparency Indicator, Fixed Network User
415                                                         # Rate, User Protocol Indicator, Guaranteed Bit Rate and Maximum Bit Rate
416                                                       },
417
418                                     #Charge information is provided for all chargeable elements except within Messaging Event and Mobile Session call events
419                                     # must contain Charged Item and at least one occurrence of Charge Detail
420                                     'chargeInformationList' => [
421                                                                  {
422                                                                    #XXX
423                                                                    #mandatory
424                                                                    # the charging principle applied and the unitisation of Chargeable Units.  It
425                                                                    #  is not intended to identify the service used.
426                                                                    #A: Call set up attempt
427                                                                    #C: Content
428                                                                    #D: Duration based charge
429                                                                    #E: Event based charge
430                                                                    #F: Fixed (one-off) charge
431                                                                    #L: Calendar (for example daily usage charge)
432                                                                    #V: Volume (outgoing) based charge
433                                                                    #W: Volume (incoming) based charge
434                                                                    #X: Volume (total volume) based charge
435                                                                    #(?? fields to be used as a basis for the calculation of the correct Charge
436                                                                    #  A: Chargeable Units (if present)
437                                                                    #  D,V,W,X: Chargeable Units
438                                                                    #  C: Depends on the content
439                                                                    #  E: Not Applicable
440                                                                    #  F: Not Applicable
441                                                                    #  L: Call Event Start Timestamp)
442                                                                    'chargedItem' => 'D',
443
444                                                                    # the IOT used by the VPMN to price the call
445                                                                    'callTypeGroup' => {
446
447                                                                                         #The highest category call type in respect of the destination of the call
448                                                                                         #0: Unknown/Not Applicable
449                                                                                         #1: National
450                                                                                         #2: International
451                                                                                         #10: HGGSN/HP-GW
452                                                                                         #11: VGGSN/VP-GW
453                                                                                         #12: Other GGSN/Other P-GW
454                                                                                         #100: WLAN
455                                                                                         'callTypeLevel1' => $self->calltypenum,
456
457                                                                                         #the sub category of Call Type Level 1
458                                                                                         #0: Unknown/Not Applicable
459                                                                                         #1: Mobile
460                                                                                         #2: PSTN
461                                                                                         #3: Non Geographic
462                                                                                         #4: Premium Rate
463                                                                                         #5: Satellite destination
464                                                                                         #6: Forwarded call
465                                                                                         #7: Non forwarded call
466                                                                                         #10: Broadband
467                                                                                         #11: Narrowband
468                                                                                         #12: Conversational
469                                                                                         #13: Streaming
470                                                                                         #14: Interactive
471                                                                                         #15: Background
472                                                                                         'callTypeLevel2' => 0,
473
474                                                                                         #the sub category of Call Type Level 2
475                                                                                         'callTypeLevel3' => 0,
476                                                                                       },
477
478                                                                    #mandatory, at least one occurence must be present
479                                                                    #A repeating group detailing the Charge and/or charge element
480                                                                    # Note that, where a Charge has been levied, even where that Charge is zero,
481                                                                    #  there must be one occurance, and only one, with a Charge Type of '00'
482                                                                    'chargeDetailList' => [
483                                                                                            {
484                                                                                              #mandatory
485                                                                                              # after discounts have been deducted but before any tax is added
486                                                                                              'charge'          => $self->rated_price * 100000, #XXX numberOfDecimalPlaces 
487
488                                                                                              #mandatory
489                                                                                              # the type of charge represented
490                                                                                              #00: Total charge for Charge Information (the invoiceable value)
491                                                                                              #01: Airtime charge
492                                                                                              #02: reserved
493                                                                                              #03: Toll charge
494                                                                                              #04: Directory assistance
495                                                                                              #05–20: reserved
496                                                                                              #21: VPMN surcharge
497                                                                                              #50: Total charge for Charge Information according to the published IOT
498                                                                                              #  Note that the use of value 50 is only for use by bilateral agreement, use without
499                                                                                              #   bilateral agreement can be treated as per reserved values, that is ‘out of range’
500                                                                                              #69–99: reserved
501                                                                                              'chargeType'      => '00',
502
503                                                                                              #conditional
504                                                                                              # the number of units which are chargeable within the Charge Detail, this may not
505                                                                                              # correspond to the number of rounded units charged.
506                                                                                              # The item Charged Item defines what the units represent.
507                                                                                              'chargeableUnits' => $self->quantity_able,
508
509                                                                                              #optional
510                                                                                              # the rounded number of units which are actually charged for
511                                                                                              'chargedUnits'    => $self->quantity,
512                                                                                            }
513                                                                                          ],
514                                                                    'exchangeRateCode' => 1, #from header
515                                                                  }
516                                                                ]
517                                   }
518                                 ],
519
520       #MO Basic Call Information provides the basic detail of who made the call and where to in respect of mobile originated traffic.
521       'basicCallInformation' => {
522                                   #mandatory
523                                   # the identification of the chargeable subscriber.
524                                   #  The group must contain either the IMSI or the MIN of the Chargeable Subscriber, but not both.
525                                   'chargeableSubscriber' => {
526                                                               'simChargeableSubscriber' => {
527                                                                                              'msisdn' => $self->charged_party, #src
528                                                                                              'imsi'   => $self->charged_party_imsi,
529                                                                                            }
530                                                             },
531                                   # the start of the call event
532                                   'callEventStartTimeStamp' => {
533                                                                  'localTimeStamp' => time2str('%Y%m%d%H%M%S', $self->startdate),
534                                                                  'utcTimeOffsetCode' => 1
535                                                                },
536
537                                   # the actual total duration of a call event as a number of seconds
538                                   'totalCallEventDuration' => $self->duration,
539
540                                   #conditional
541                                   # the number dialled by the subscriber (Called Number)
542                                   #  or the SMSC Address in case of SMS usage or in cases involving supplementary services
543                                   #   such as call forwarding or transfer etc., the number to which the call is routed
544                                   'destination' => {
545                                                      #the international representation of the destination
546                                                      'calledNumber' => $self->dst,
547
548                                                      #the actual digits as dialled by the subscriber, i.e. unmodified, in establishing a call
549                                                      # This will contain ‘+’ and ‘#’ where appropriate.
550                                                      #'dialledDigits' => '322221350'
551                                                    },
552                                 }
553     }
554   };
555
556 }
557
558 sub _asn_spec {
559   <<'END';
560 --
561 --
562 -- The following ASN.1 specification defines the abstract syntax for 
563 --
564 --        Data Record Format Version 03 
565 --                           Release 12
566 --
567 -- The specification is structured as follows:
568 --   (1) structure of the Tap batch
569 --   (2) definition of the individual Tap ‘records’ 
570 --   (3) Tap data items and groups of data items used within (2)
571 --   (4) Common, non-Tap data types
572 --   (5) Tap data items for content charging
573 --
574 -- It is mainly a translation from the logical structure
575 -- diagrams. Where appropriate, names used within the 
576 -- logical structure diagrams have been shortened.
577 -- For repeating data items the name as used within the logical
578 -- structure have been extended by adding ‘list’ or ‘table’
579 -- (in some instances).
580 --
581
582
583 -- TAP-0312  DEFINITIONS IMPLICIT TAGS  ::= 
584
585 -- BEGIN 
586
587 --
588 -- Structure of a Tap batch 
589 --
590
591 DataInterChange ::= CHOICE 
592 {
593     transferBatch TransferBatch, 
594     notification  Notification,
595 ...
596 }
597
598 -- Batch Control Information must always, both logically and physically,
599 -- be the first group/item within Transfer Batch – this ensures that the
600 -- TAP release version can be readily identified.  Any new groups/items
601 -- required may be inserted at any point after Batch Control Information
602
603 TransferBatch ::= [APPLICATION 1] SEQUENCE
604 {
605     batchControlInfo       BatchControlInfo            OPTIONAL, -- *m.m.
606     accountingInfo         AccountingInfo              OPTIONAL,
607     networkInfo            NetworkInfo                 OPTIONAL, -- *m.m.
608     messageDescriptionInfo MessageDescriptionInfoList  OPTIONAL,
609     callEventDetails       CallEventDetailList         OPTIONAL, -- *m.m.
610     auditControlInfo       AuditControlInfo            OPTIONAL, -- *m.m.
611 ...
612 }
613
614 Notification ::= [APPLICATION 2] SEQUENCE
615 {
616     sender                     Sender                     OPTIONAL, -- *m.m.
617     recipient                    Recipient                  OPTIONAL, -- *m.m.
618     fileSequenceNumber           FileSequenceNumber         OPTIONAL, -- *m.m.
619     rapFileSequenceNumber        RapFileSequenceNumber      OPTIONAL,
620     fileCreationTimeStamp        FileCreationTimeStamp      OPTIONAL,
621     fileAvailableTimeStamp       FileAvailableTimeStamp     OPTIONAL, -- *m.m.
622     transferCutOffTimeStamp      TransferCutOffTimeStamp    OPTIONAL, -- *m.m.
623     specificationVersionNumber SpecificationVersionNumber OPTIONAL, -- *m.m.
624     releaseVersionNumber         ReleaseVersionNumber       OPTIONAL, -- *m.m.
625     fileTypeIndicator            FileTypeIndicator          OPTIONAL,
626     operatorSpecInformation      OperatorSpecInfoList       OPTIONAL,
627 ...
628 }
629
630 CallEventDetailList ::=  [APPLICATION 3] SEQUENCE OF CallEventDetail
631
632 CallEventDetail ::= CHOICE
633 {
634     mobileOriginatedCall   MobileOriginatedCall,
635     mobileTerminatedCall   MobileTerminatedCall,
636     supplServiceEvent      SupplServiceEvent,
637     serviceCentreUsage     ServiceCentreUsage,
638     gprsCall               GprsCall,
639     contentTransaction     ContentTransaction,
640     locationService        LocationService,
641     messagingEvent         MessagingEvent,
642     mobileSession          MobileSession,
643 ...
644 }
645
646 --
647 -- Structure of the individual Tap records
648 --
649
650 BatchControlInfo ::= [APPLICATION 4] SEQUENCE
651 {
652     sender                       Sender                         OPTIONAL, -- *m.m.
653     recipient                    Recipient                              OPTIONAL, -- *m.m.
654     fileSequenceNumber           FileSequenceNumber             OPTIONAL, -- *m.m.
655     fileCreationTimeStamp        FileCreationTimeStamp          OPTIONAL,
656     transferCutOffTimeStamp      TransferCutOffTimeStamp        OPTIONAL, -- *m.m.
657     fileAvailableTimeStamp       FileAvailableTimeStamp         OPTIONAL, -- *m.m.
658     specificationVersionNumber SpecificationVersionNumber       OPTIONAL, -- *m.m.
659     releaseVersionNumber         ReleaseVersionNumber           OPTIONAL, -- *m.m.
660     fileTypeIndicator            FileTypeIndicator              OPTIONAL,
661     rapFileSequenceNumber        RapFileSequenceNumber          OPTIONAL,
662     operatorSpecInformation      OperatorSpecInfoList           OPTIONAL,
663 ...
664 }
665
666 AccountingInfo ::= [APPLICATION 5] SEQUENCE
667 {
668     taxation                  TaxationList           OPTIONAL,
669     discounting               DiscountingList        OPTIONAL,
670     localCurrency             LocalCurrency          OPTIONAL, -- *m.m.
671     tapCurrency               TapCurrency            OPTIONAL,
672     currencyConversionInfo    CurrencyConversionList OPTIONAL,
673     tapDecimalPlaces          TapDecimalPlaces       OPTIONAL, -- *m.m.
674 ...
675 }
676
677 NetworkInfo ::= [APPLICATION 6] SEQUENCE
678 {
679     utcTimeOffsetInfo         UtcTimeOffsetInfoList OPTIONAL, -- *m.m.
680     recEntityInfo             RecEntityInfoList     OPTIONAL,
681 ...
682 }
683
684 MessageDescriptionInfoList ::= [APPLICATION 8] SEQUENCE OF MessageDescriptionInformation
685
686 MobileOriginatedCall ::= [APPLICATION 9] SEQUENCE
687 {
688     basicCallInformation    MoBasicCallInformation    OPTIONAL, -- *m.m.
689     locationInformation     LocationInformation       OPTIONAL, -- *m.m.
690     equipmentIdentifier     ImeiOrEsn                 OPTIONAL,
691     basicServiceUsedList    BasicServiceUsedList      OPTIONAL, -- *m.m.
692     supplServiceCode        SupplServiceCode          OPTIONAL,
693     thirdPartyInformation   ThirdPartyInformation     OPTIONAL,
694     camelServiceUsed        CamelServiceUsed          OPTIONAL,
695     operatorSpecInformation OperatorSpecInfoList      OPTIONAL,
696 ...
697 }    
698
699 MobileTerminatedCall ::= [APPLICATION 10] SEQUENCE
700 {
701     basicCallInformation    MtBasicCallInformation    OPTIONAL, -- *m.m.
702     locationInformation     LocationInformation       OPTIONAL, -- *m.m.
703     equipmentIdentifier     ImeiOrEsn                 OPTIONAL,
704     basicServiceUsedList    BasicServiceUsedList      OPTIONAL, -- *m.m.
705     camelServiceUsed        CamelServiceUsed          OPTIONAL,
706     operatorSpecInformation OperatorSpecInfoList      OPTIONAL,
707 ...
708 }    
709
710
711 SupplServiceEvent ::= [APPLICATION 11] SEQUENCE
712 {
713     chargeableSubscriber      ChargeableSubscriber    OPTIONAL, -- *m.m.
714     rapFileSequenceNumber     RapFileSequenceNumber   OPTIONAL,
715     locationInformation       LocationInformation     OPTIONAL, -- *m.m.
716     equipmentIdentifier       ImeiOrEsn               OPTIONAL,
717     supplServiceUsed          SupplServiceUsed        OPTIONAL, -- *m.m.
718     operatorSpecInformation   OperatorSpecInfoList    OPTIONAL,
719 ...
720 }
721
722
723 ServiceCentreUsage ::= [APPLICATION 12] SEQUENCE
724 {
725     basicInformation          ScuBasicInformation     OPTIONAL, -- *m.m.
726     rapFileSequenceNumber     RapFileSequenceNumber   OPTIONAL,
727     servingNetwork            ServingNetwork          OPTIONAL,
728     recEntityCode             RecEntityCode           OPTIONAL, -- *m.m.
729     chargeInformation         ChargeInformation       OPTIONAL, -- *m.m.
730     scuChargeType             ScuChargeType           OPTIONAL, -- *m.m.
731     scuTimeStamps             ScuTimeStamps           OPTIONAL, -- *m.m.
732     operatorSpecInformation   OperatorSpecInfoList    OPTIONAL,
733 ...
734 }
735
736 GprsCall ::= [APPLICATION 14] SEQUENCE
737 {
738     gprsBasicCallInformation  GprsBasicCallInformation  OPTIONAL, -- *m.m.
739     gprsLocationInformation   GprsLocationInformation   OPTIONAL, -- *m.m.
740     equipmentIdentifier       ImeiOrEsn                 OPTIONAL,
741     gprsServiceUsed           GprsServiceUsed           OPTIONAL, -- *m.m.
742     camelServiceUsed          CamelServiceUsed          OPTIONAL,
743     operatorSpecInformation   OperatorSpecInfoList      OPTIONAL,
744 ...
745 }
746
747 ContentTransaction ::= [APPLICATION 17] SEQUENCE
748 {
749  contentTransactionBasicInfo ContentTransactionBasicInfo OPTIONAL, -- *m.m.
750  chargedPartyInformation     ChargedPartyInformation     OPTIONAL, -- *m.m.
751  servingPartiesInformation   ServingPartiesInformation   OPTIONAL, -- *m.m.
752  contentServiceUsed          ContentServiceUsedList      OPTIONAL, -- *m.m.
753  operatorSpecInformation     OperatorSpecInfoList        OPTIONAL,
754 ...
755 }
756
757 LocationService ::= [APPLICATION 297] SEQUENCE
758 {
759     rapFileSequenceNumber         RapFileSequenceNumber       OPTIONAL,
760     recEntityCode                         RecEntityCode               OPTIONAL, -- *m.m.
761     callReference                         CallReference               OPTIONAL,
762     trackingCustomerInformation TrackingCustomerInformation OPTIONAL,
763     lCSSPInformation              LCSSPInformation            OPTIONAL,
764     trackedCustomerInformation  TrackedCustomerInformation  OPTIONAL,
765     locationServiceUsage          LocationServiceUsage        OPTIONAL, -- *m.m.
766     operatorSpecInformation       OperatorSpecInfoList        OPTIONAL,
767 ...
768 }
769
770 MessagingEvent ::= [APPLICATION 433] SEQUENCE
771 {
772     messagingEventService       MessagingEventService     OPTIONAL, -- *m.m.
773     chargedParty              ChargedParty              OPTIONAL, -- *m.m.
774     rapFileSequenceNumber       RapFileSequenceNumber     OPTIONAL,
775     simToolkitIndicator         SimToolkitIndicator       OPTIONAL,
776     geographicalLocation        GeographicalLocation      OPTIONAL,
777     eventReference            EventReference              OPTIONAL, -- *m.m.
778
779     recEntityCodeList           RecEntityCodeList         OPTIONAL, -- *m.m.  
780     networkElementList          NetworkElementList        OPTIONAL,
781     locationArea              LocationArea                OPTIONAL,
782     cellId                      CellId                            OPTIONAL,    
783     serviceStartTimestamp       ServiceStartTimestamp     OPTIONAL, -- *m.m.
784     nonChargedParty             NonChargedParty           OPTIONAL,
785     exchangeRateCode            ExchangeRateCode                  OPTIONAL,
786     callTypeGroup                       CallTypeGroup             OPTIONAL, -- *m.m.
787     charge                              Charge                    OPTIONAL, -- *m.m.
788     taxInformationList          TaxInformationList        OPTIONAL,
789     operatorSpecInformation   OperatorSpecInfoList      OPTIONAL,
790 ...
791 }
792
793 MobileSession ::= [APPLICATION 434] SEQUENCE
794 {
795     mobileSessionService        MobileSessionService      OPTIONAL, -- *m.m.
796     chargedParty              ChargedParty              OPTIONAL, -- *m.m.
797     rapFileSequenceNumber       RapFileSequenceNumber     OPTIONAL,
798     simToolkitIndicator         SimToolkitIndicator       OPTIONAL,
799     geographicalLocation        GeographicalLocation      OPTIONAL,
800     locationArea              LocationArea                OPTIONAL,
801     cellId                      CellId                            OPTIONAL,
802     eventReference            EventReference              OPTIONAL, -- *m.m.
803
804     recEntityCodeList           RecEntityCodeList         OPTIONAL, -- *m.m.
805     serviceStartTimestamp       ServiceStartTimestamp     OPTIONAL, -- *m.m.
806     causeForTerm              CauseForTerm              OPTIONAL,
807     totalCallEventDuration      TotalCallEventDuration    OPTIONAL, -- *m.m.
808     nonChargedParty             NonChargedParty           OPTIONAL,
809     sessionChargeInfoList     SessionChargeInfoList     OPTIONAL, -- *m.m.
810     operatorSpecInformation   OperatorSpecInfoList      OPTIONAL,
811 ...
812 }
813
814 AuditControlInfo ::= [APPLICATION 15] SEQUENCE
815 {
816     earliestCallTimeStamp         EarliestCallTimeStamp       OPTIONAL,
817     latestCallTimeStamp           LatestCallTimeStamp         OPTIONAL,
818     totalCharge                   TotalCharge                 OPTIONAL, -- *m.m.
819     totalChargeRefund             TotalChargeRefund           OPTIONAL,
820     totalTaxRefund                TotalTaxRefund              OPTIONAL,
821     totalTaxValue                 TotalTaxValue               OPTIONAL, -- *m.m.
822     totalDiscountValue            TotalDiscountValue          OPTIONAL, -- *m.m.
823     totalDiscountRefund           TotalDiscountRefund         OPTIONAL,
824     totalAdvisedChargeValueList TotalAdvisedChargeValueList OPTIONAL,
825     callEventDetailsCount         CallEventDetailsCount       OPTIONAL, -- *m.m.
826     operatorSpecInformation       OperatorSpecInfoList        OPTIONAL,
827 ...
828 }
829
830
831 -- 
832 -- Tap data items and groups of data items
833 --
834
835 AccessPointNameNI ::= [APPLICATION 261] AsciiString --(SIZE(1..63))
836
837 AccessPointNameOI ::= [APPLICATION 262] AsciiString --(SIZE(1..37))
838
839 ActualDeliveryTimeStamp ::= [APPLICATION 302] DateTime
840
841 AddressStringDigits ::= BCDString
842
843 AdvisedCharge ::= [APPLICATION 349] Charge
844  
845 AdvisedChargeCurrency ::= [APPLICATION 348] Currency
846  
847 AdvisedChargeInformation ::= [APPLICATION 351] SEQUENCE
848 {
849     paidIndicator         PaidIndicator         OPTIONAL,
850     paymentMethod         PaymentMethod         OPTIONAL,
851     advisedChargeCurrency AdvisedChargeCurrency OPTIONAL,
852     advisedCharge         AdvisedCharge         OPTIONAL, -- *m.m.
853     commission            Commission            OPTIONAL,
854 ...
855 }
856  
857 AgeOfLocation ::= [APPLICATION 396] INTEGER
858
859 BasicService ::= [APPLICATION 36] SEQUENCE
860 {
861     serviceCode                 BasicServiceCode       OPTIONAL, -- *m.m.
862     transparencyIndicator       TransparencyIndicator  OPTIONAL,
863     fnur                        Fnur                   OPTIONAL,
864     userProtocolIndicator       UserProtocolIndicator  OPTIONAL,
865     guaranteedBitRate           GuaranteedBitRate      OPTIONAL,
866     maximumBitRate              MaximumBitRate         OPTIONAL,
867 ...
868 }
869
870 BasicServiceCode ::= [APPLICATION 426] CHOICE 
871 {
872     teleServiceCode      TeleServiceCode,
873     bearerServiceCode    BearerServiceCode,
874 ...
875 }
876
877 BasicServiceCodeList ::= [APPLICATION 37] SEQUENCE OF BasicServiceCode
878
879 BasicServiceUsed ::= [APPLICATION 39] SEQUENCE
880 {
881     basicService                BasicService          OPTIONAL, -- *m.m.
882     chargingTimeStamp           ChargingTimeStamp     OPTIONAL,
883     chargeInformationList       ChargeInformationList OPTIONAL, -- *m.m.
884     hSCSDIndicator              HSCSDIndicator        OPTIONAL,
885 ...
886 }
887
888 BasicServiceUsedList ::= [APPLICATION 38] SEQUENCE OF BasicServiceUsed
889
890 BearerServiceCode ::= [APPLICATION 40] HexString --(SIZE(2))
891
892 EventReference ::= [APPLICATION 435]  AsciiString
893
894
895 CalledNumber ::= [APPLICATION 407] AddressStringDigits
896
897 CalledPlace ::= [APPLICATION 42] AsciiString
898
899 CalledRegion ::= [APPLICATION 46] AsciiString
900
901 CallEventDetailsCount ::= [APPLICATION 43] INTEGER 
902
903 CallEventStartTimeStamp ::= [APPLICATION 44] DateTime
904
905 CallingNumber ::= [APPLICATION 405] AddressStringDigits
906
907 CallOriginator ::= [APPLICATION 41]  SEQUENCE
908 {
909     callingNumber               CallingNumber           OPTIONAL,
910     clirIndicator               ClirIndicator         OPTIONAL,
911     sMSOriginator               SMSOriginator         OPTIONAL,
912 ...
913 }
914
915 CallReference ::= [APPLICATION 45] OCTET STRING --(SIZE(1..8))
916
917 CallTypeGroup ::= [APPLICATION 258] SEQUENCE
918 {
919     callTypeLevel1      CallTypeLevel1           OPTIONAL, -- *m.m.
920     callTypeLevel2      CallTypeLevel2           OPTIONAL, -- *m.m.
921     callTypeLevel3      CallTypeLevel3           OPTIONAL, -- *m.m.
922 ...
923 }
924
925 CallTypeLevel1 ::= [APPLICATION 259] INTEGER
926
927 CallTypeLevel2 ::= [APPLICATION 255] INTEGER
928
929 CallTypeLevel3 ::= [APPLICATION 256] INTEGER
930
931 CamelDestinationNumber ::= [APPLICATION 404] AddressStringDigits
932
933 CamelInvocationFee ::= [APPLICATION 422] AbsoluteAmount
934
935 CamelServiceKey ::= [APPLICATION 55] INTEGER
936
937 CamelServiceLevel ::= [APPLICATION 56] INTEGER
938
939 CamelServiceUsed ::= [APPLICATION 57] SEQUENCE
940 {
941     camelServiceLevel         CamelServiceLevel                 OPTIONAL,
942     camelServiceKey           CamelServiceKey                   OPTIONAL, -- *m.m.
943     defaultCallHandling       DefaultCallHandlingIndicator      OPTIONAL,
944     exchangeRateCode          ExchangeRateCode                  OPTIONAL,
945     taxInformation            TaxInformationList                OPTIONAL,
946     discountInformation       DiscountInformation               OPTIONAL,
947     camelInvocationFee        CamelInvocationFee                OPTIONAL,
948     threeGcamelDestination    ThreeGcamelDestination            OPTIONAL,
949     cseInformation            CseInformation                    OPTIONAL,
950 ...
951 }
952
953 CauseForTerm ::= [APPLICATION 58] INTEGER
954
955 CellId ::= [APPLICATION 59] INTEGER 
956
957 Charge ::= [APPLICATION 62] AbsoluteAmount
958
959 ChargeableSubscriber ::= [APPLICATION 427] CHOICE 
960 {
961     simChargeableSubscriber SimChargeableSubscriber,
962     minChargeableSubscriber MinChargeableSubscriber,
963 ...
964 }
965
966 ChargeableUnits ::= [APPLICATION 65]  INTEGER
967
968 ChargeDetail ::= [APPLICATION 63] SEQUENCE
969 {
970     chargeType              ChargeType                  OPTIONAL, -- *m.m.
971     charge                  Charge                      OPTIONAL, -- *m.m.
972     chargeableUnits         ChargeableUnits             OPTIONAL,
973     chargedUnits            ChargedUnits                OPTIONAL,
974     chargeDetailTimeStamp   ChargeDetailTimeStamp       OPTIONAL,
975 ...
976 }
977
978 ChargeDetailList ::= [APPLICATION 64] SEQUENCE OF ChargeDetail
979
980 ChargeDetailTimeStamp ::= [APPLICATION 410] ChargingTimeStamp
981
982 ChargedItem ::= [APPLICATION 66]  AsciiString --(SIZE(1))
983
984 ChargedParty ::= [APPLICATION 436] SEQUENCE
985 {
986     imsi                        Imsi                            OPTIONAL, -- *m.m.
987     msisdn                              Msisdn                  OPTIONAL,         
988     publicUserId                        PublicUserId            OPTIONAL,
989     homeBid                             HomeBid                 OPTIONAL,
990     homeLocationDescription     HomeLocationDescription OPTIONAL,
991     imei                                Imei                            OPTIONAL,
992 ...
993 }
994
995 ChargedPartyEquipment ::= [APPLICATION 323] SEQUENCE
996 {
997     equipmentIdType EquipmentIdType OPTIONAL, -- *m.m.
998     equipmentId     EquipmentId     OPTIONAL, -- *m.m.
999 ...
1000 }
1001  
1002 ChargedPartyHomeIdentification ::= [APPLICATION 313] SEQUENCE
1003 {
1004     homeIdType     HomeIdType     OPTIONAL, -- *m.m.
1005     homeIdentifier HomeIdentifier OPTIONAL, -- *m.m.
1006 ...
1007 }
1008
1009 ChargedPartyHomeIdList ::= [APPLICATION 314] SEQUENCE OF
1010                                              ChargedPartyHomeIdentification
1011
1012 ChargedPartyIdentification ::= [APPLICATION 309] SEQUENCE
1013 {
1014     chargedPartyIdType         ChargedPartyIdType         OPTIONAL, -- *m.m.
1015     chargedPartyIdentifier     ChargedPartyIdentifier     OPTIONAL, -- *m.m.
1016 ...
1017 }
1018
1019 ChargedPartyIdentifier ::= [APPLICATION 287] AsciiString
1020
1021 ChargedPartyIdList ::= [APPLICATION 310] SEQUENCE OF ChargedPartyIdentification
1022
1023 ChargedPartyIdType ::= [APPLICATION 305] INTEGER
1024
1025 ChargedPartyInformation ::= [APPLICATION 324] SEQUENCE
1026 {
1027     chargedPartyIdList       ChargedPartyIdList        OPTIONAL, -- *m.m.
1028     chargedPartyHomeIdList   ChargedPartyHomeIdList    OPTIONAL,
1029     chargedPartyLocationList ChargedPartyLocationList  OPTIONAL,
1030     chargedPartyEquipment    ChargedPartyEquipment     OPTIONAL,
1031 ...
1032 }
1033  
1034 ChargedPartyLocation ::= [APPLICATION 320] SEQUENCE
1035 {
1036     locationIdType     LocationIdType     OPTIONAL, -- *m.m.
1037     locationIdentifier LocationIdentifier OPTIONAL, -- *m.m.
1038 ...
1039 }
1040  
1041 ChargedPartyLocationList ::= [APPLICATION 321] SEQUENCE OF ChargedPartyLocation
1042  
1043 ChargedPartyStatus ::= [APPLICATION 67] INTEGER 
1044
1045 ChargedUnits ::= [APPLICATION 68]  INTEGER 
1046
1047 ChargeInformation ::= [APPLICATION 69] SEQUENCE
1048 {
1049     chargedItem         ChargedItem         OPTIONAL, -- *m.m.
1050     exchangeRateCode    ExchangeRateCode    OPTIONAL,
1051     callTypeGroup       CallTypeGroup       OPTIONAL,
1052     chargeDetailList    ChargeDetailList    OPTIONAL, -- *m.m.
1053     taxInformation      TaxInformationList  OPTIONAL,
1054     discountInformation DiscountInformation OPTIONAL,
1055 ...
1056 }
1057
1058 ChargeInformationList ::= [APPLICATION 70] SEQUENCE OF ChargeInformation
1059
1060 ChargeRefundIndicator ::= [APPLICATION 344] INTEGER
1061  
1062 ChargeType ::= [APPLICATION 71] NumberString --(SIZE(2..3))
1063
1064 ChargingId ::= [APPLICATION 72] INTEGER
1065
1066 ChargingPoint ::= [APPLICATION 73]  AsciiString --(SIZE(1))
1067
1068 ChargingTimeStamp ::= [APPLICATION 74]  DateTime
1069
1070 ClirIndicator ::= [APPLICATION 75] INTEGER
1071
1072 Commission ::= [APPLICATION 350] Charge
1073  
1074 CompletionTimeStamp ::= [APPLICATION 76] DateTime
1075
1076 ContentChargingPoint ::= [APPLICATION 345] INTEGER
1077  
1078 ContentProvider ::= [APPLICATION 327] SEQUENCE
1079 {
1080     contentProviderIdType     ContentProviderIdType     OPTIONAL, -- *m.m.
1081     contentProviderIdentifier ContentProviderIdentifier OPTIONAL, -- *m.m.
1082 ...
1083 }
1084  
1085 ContentProviderIdentifier ::= [APPLICATION 292] AsciiString
1086
1087 ContentProviderIdList ::= [APPLICATION 328] SEQUENCE OF ContentProvider
1088
1089 ContentProviderIdType ::= [APPLICATION 291] INTEGER
1090
1091 ContentProviderName ::= [APPLICATION 334] AsciiString
1092  
1093 ContentServiceUsed ::= [APPLICATION 352] SEQUENCE
1094 {
1095     contentTransactionCode       ContentTransactionCode       OPTIONAL, -- *m.m.
1096     contentTransactionType       ContentTransactionType       OPTIONAL, -- *m.m.
1097     objectType                   ObjectType                   OPTIONAL,
1098     transactionDescriptionSupp   TransactionDescriptionSupp   OPTIONAL,
1099     transactionShortDescription  TransactionShortDescription  OPTIONAL, -- *m.m.
1100     transactionDetailDescription TransactionDetailDescription OPTIONAL,
1101     transactionIdentifier          TransactionIdentifier        OPTIONAL, -- *m.m.
1102     transactionAuthCode          TransactionAuthCode          OPTIONAL,
1103     dataVolumeIncoming           DataVolumeIncoming           OPTIONAL,
1104     dataVolumeOutgoing           DataVolumeOutgoing           OPTIONAL,
1105     totalDataVolume              TotalDataVolume              OPTIONAL,
1106     chargeRefundIndicator        ChargeRefundIndicator        OPTIONAL,
1107     contentChargingPoint         ContentChargingPoint         OPTIONAL,
1108     chargeInformationList        ChargeInformationList        OPTIONAL,
1109     advisedChargeInformation     AdvisedChargeInformation     OPTIONAL,
1110 ...
1111 }
1112
1113 ContentServiceUsedList ::= [APPLICATION 285] SEQUENCE OF ContentServiceUsed
1114  
1115 ContentTransactionBasicInfo ::= [APPLICATION 304] SEQUENCE
1116 {
1117     rapFileSequenceNumber      RapFileSequenceNumber      OPTIONAL,
1118     orderPlacedTimeStamp       OrderPlacedTimeStamp       OPTIONAL,
1119     requestedDeliveryTimeStamp RequestedDeliveryTimeStamp OPTIONAL,
1120     actualDeliveryTimeStamp    ActualDeliveryTimeStamp    OPTIONAL,
1121     totalTransactionDuration   TotalTransactionDuration   OPTIONAL,
1122     transactionStatus          TransactionStatus          OPTIONAL,
1123 ...
1124 }
1125
1126 ContentTransactionCode ::= [APPLICATION 336] INTEGER
1127  
1128 ContentTransactionType ::= [APPLICATION 337] INTEGER
1129  
1130 CseInformation ::= [APPLICATION 79] OCTET STRING --(SIZE(1..40))
1131
1132 CurrencyConversion ::= [APPLICATION 106] SEQUENCE
1133 {
1134     exchangeRateCode      ExchangeRateCode      OPTIONAL, -- *m.m.
1135     numberOfDecimalPlaces NumberOfDecimalPlaces OPTIONAL, -- *m.m.
1136     exchangeRate          ExchangeRate          OPTIONAL, -- *m.m.
1137 ...
1138 }
1139
1140 CurrencyConversionList ::= [APPLICATION 80] SEQUENCE OF CurrencyConversion
1141
1142 CustomerIdentifier ::= [APPLICATION 364] AsciiString
1143
1144 CustomerIdType ::= [APPLICATION 363] INTEGER
1145
1146 DataVolume ::= INTEGER 
1147
1148 DataVolumeIncoming ::= [APPLICATION 250] DataVolume
1149
1150 DataVolumeOutgoing ::= [APPLICATION 251] DataVolume
1151
1152 --
1153 --  The following datatypes are used to denote timestamps.
1154 --  Each timestamp consists of a local timestamp and a
1155 --  corresponding UTC time offset. 
1156 --  Except for the timestamps used within the Batch Control 
1157 --  Information and the Audit Control Information 
1158 --  the UTC time offset is identified by a code referencing
1159 --  the UtcTimeOffsetInfo.
1160 --  
1161  
1162 --
1163 -- We start with the “short” datatype referencing the 
1164 -- UtcTimeOffsetInfo.
1165 -- 
1166
1167 DateTime ::= SEQUENCE 
1168 {
1169      -- 
1170      -- Local timestamps are noted in the format
1171      --
1172      --     CCYYMMDDhhmmss
1173      --
1174      -- where CC  =  century  (‘19’, ‘20’,...)
1175      --       YY  =  year     (‘00’ – ‘99’)
1176      --       MM  =  month    (‘01’, ‘02’, ... , ‘12’)
1177      --       DD  =  day      (‘01’, ‘02’, ... , ‘31’)
1178      --       hh  =  hour     (‘00’, ‘01’, ... , ‘23’)
1179      --       mm  =  minutes  (‘00’, ‘01’, ... , ‘59’)
1180      --       ss  =  seconds  (‘00’, ‘01’, ... , ‘59’)
1181      -- 
1182     localTimeStamp     LocalTimeStamp    OPTIONAL, -- *m.m.
1183     utcTimeOffsetCode  UtcTimeOffsetCode OPTIONAL, -- *m.m.
1184 ...
1185 }
1186
1187 --
1188 -- The following version is the “long” datatype
1189 -- containing the UTC time offset directly. 
1190 --
1191
1192 DateTimeLong ::= SEQUENCE 
1193 {
1194     localTimeStamp     LocalTimeStamp OPTIONAL, -- *m.m.
1195     utcTimeOffset      UtcTimeOffset  OPTIONAL, -- *m.m.
1196 ...
1197 }
1198
1199 DefaultCallHandlingIndicator ::= [APPLICATION 87] INTEGER
1200
1201 DepositTimeStamp ::= [APPLICATION 88] DateTime
1202
1203 Destination ::= [APPLICATION 89] SEQUENCE
1204 {
1205     calledNumber                CalledNumber            OPTIONAL,
1206     dialledDigits               DialledDigits         OPTIONAL,
1207     calledPlace                 CalledPlace           OPTIONAL,
1208     calledRegion                CalledRegion          OPTIONAL,
1209     sMSDestinationNumber        SMSDestinationNumber  OPTIONAL,
1210 ...
1211 }
1212
1213 DestinationNetwork ::= [APPLICATION 90] NetworkId 
1214
1215 DialledDigits ::= [APPLICATION 279] AsciiString
1216
1217 Discount ::= [APPLICATION 412] DiscountValue
1218
1219 DiscountableAmount ::= [APPLICATION 423] AbsoluteAmount
1220
1221 DiscountApplied ::= [APPLICATION 428] CHOICE 
1222 {
1223     fixedDiscountValue    FixedDiscountValue, 
1224     discountRate          DiscountRate,
1225 ...
1226 }
1227
1228 DiscountCode ::= [APPLICATION 91] INTEGER
1229
1230 DiscountInformation ::= [APPLICATION 96] SEQUENCE
1231 {
1232     discountCode        DiscountCode            OPTIONAL, -- *m.m.
1233     discount            Discount                OPTIONAL,
1234     discountableAmount  DiscountableAmount      OPTIONAL,
1235 ...
1236 }
1237
1238 Discounting ::= [APPLICATION 94] SEQUENCE
1239 {
1240     discountCode    DiscountCode    OPTIONAL, -- *m.m.
1241     discountApplied DiscountApplied OPTIONAL, -- *m.m.
1242 ...
1243 }
1244
1245 DiscountingList ::= [APPLICATION 95]  SEQUENCE OF Discounting
1246
1247 DiscountRate ::= [APPLICATION 92] PercentageRate
1248
1249 DiscountValue ::= AbsoluteAmount
1250
1251 DistanceChargeBandCode ::= [APPLICATION 98] AsciiString --(SIZE(1))
1252
1253 EarliestCallTimeStamp ::= [APPLICATION 101] DateTimeLong
1254
1255 ElementId ::= [APPLICATION 437] AsciiString
1256
1257 ElementType ::= [APPLICATION 438] INTEGER
1258
1259 EquipmentId ::= [APPLICATION 290] AsciiString
1260
1261 EquipmentIdType ::= [APPLICATION 322] INTEGER
1262
1263 Esn ::= [APPLICATION 103] NumberString
1264
1265 ExchangeRate ::= [APPLICATION 104] INTEGER
1266
1267 ExchangeRateCode ::= [APPLICATION 105] Code
1268
1269 FileAvailableTimeStamp ::= [APPLICATION 107] DateTimeLong
1270
1271 FileCreationTimeStamp ::= [APPLICATION 108] DateTimeLong
1272
1273 FileSequenceNumber ::= [APPLICATION 109] NumberString --(SIZE(5))
1274
1275 FileTypeIndicator ::= [APPLICATION 110] AsciiString --(SIZE(1))
1276
1277 FixedDiscountValue ::= [APPLICATION 411] DiscountValue
1278
1279 Fnur ::= [APPLICATION 111] INTEGER
1280
1281 GeographicalLocation ::= [APPLICATION 113]  SEQUENCE
1282 {
1283     servingNetwork              ServingNetwork                  OPTIONAL,
1284     servingBid                  ServingBid                      OPTIONAL,
1285     servingLocationDescription  ServingLocationDescription  OPTIONAL,
1286 ...
1287 }
1288
1289 GprsBasicCallInformation ::= [APPLICATION 114] SEQUENCE
1290 {
1291     gprsChargeableSubscriber    GprsChargeableSubscriber OPTIONAL, -- *m.m.
1292     rapFileSequenceNumber       RapFileSequenceNumber    OPTIONAL,
1293     gprsDestination             GprsDestination          OPTIONAL, -- *m.m.
1294     callEventStartTimeStamp     CallEventStartTimeStamp  OPTIONAL, -- *m.m.
1295     totalCallEventDuration      TotalCallEventDuration   OPTIONAL, -- *m.m.
1296     causeForTerm                CauseForTerm             OPTIONAL,
1297     partialTypeIndicator        PartialTypeIndicator     OPTIONAL,
1298     pDPContextStartTimestamp    PDPContextStartTimestamp OPTIONAL,
1299     networkInitPDPContext       NetworkInitPDPContext    OPTIONAL,
1300     chargingId                  ChargingId               OPTIONAL, -- *m.m.
1301 ...
1302 }
1303
1304 GprsChargeableSubscriber ::= [APPLICATION 115] SEQUENCE
1305 {
1306     chargeableSubscriber        ChargeableSubscriber    OPTIONAL,
1307     pdpAddress                  PdpAddress              OPTIONAL,
1308     networkAccessIdentifier     NetworkAccessIdentifier OPTIONAL,
1309 ...
1310 }
1311
1312 GprsDestination ::= [APPLICATION 116] SEQUENCE
1313 {
1314     accessPointNameNI           AccessPointNameNI      OPTIONAL, -- *m.m.
1315     accessPointNameOI           AccessPointNameOI      OPTIONAL,
1316 ...
1317 }
1318
1319 GprsLocationInformation ::= [APPLICATION 117] SEQUENCE
1320 {
1321     gprsNetworkLocation         GprsNetworkLocation     OPTIONAL, -- *m.m.
1322     homeLocationInformation     HomeLocationInformation OPTIONAL,
1323     geographicalLocation        GeographicalLocation    OPTIONAL, 
1324 ...
1325
1326
1327 GprsNetworkLocation ::= [APPLICATION 118] SEQUENCE
1328 {
1329     recEntity                   RecEntityCodeList OPTIONAL, -- *m.m.
1330     locationArea                LocationArea      OPTIONAL,
1331     cellId                      CellId            OPTIONAL,
1332 ...
1333 }
1334
1335 GprsServiceUsed ::= [APPLICATION 121]  SEQUENCE
1336 {
1337     iMSSignallingContext        IMSSignallingContext  OPTIONAL,
1338     dataVolumeIncoming          DataVolumeIncoming    OPTIONAL, -- *m.m.
1339     dataVolumeOutgoing          DataVolumeOutgoing    OPTIONAL, -- *m.m.
1340     chargeInformationList       ChargeInformationList OPTIONAL, -- *m.m.
1341 ...
1342 }
1343
1344 GsmChargeableSubscriber ::= [APPLICATION 286] SEQUENCE
1345 {
1346     imsi     Imsi   OPTIONAL,
1347     msisdn   Msisdn OPTIONAL,
1348 ...
1349 }
1350
1351 GuaranteedBitRate ::= [APPLICATION 420] OCTET STRING --(SIZE (1))
1352
1353 HomeBid ::= [APPLICATION 122]  Bid
1354
1355 HomeIdentifier ::= [APPLICATION 288] AsciiString
1356
1357 HomeIdType ::= [APPLICATION 311] INTEGER
1358
1359 HomeLocationDescription ::= [APPLICATION 413] LocationDescription
1360
1361 HomeLocationInformation ::= [APPLICATION 123] SEQUENCE
1362 {
1363     homeBid                     HomeBid                         OPTIONAL, -- *m.m.
1364     homeLocationDescription     HomeLocationDescription OPTIONAL, -- *m.m.
1365 ...
1366 }
1367
1368 HorizontalAccuracyDelivered ::= [APPLICATION 392] INTEGER
1369
1370 HorizontalAccuracyRequested ::= [APPLICATION 385] INTEGER
1371
1372 HSCSDIndicator ::= [APPLICATION 424] AsciiString --(SIZE(1))
1373
1374 Imei ::= [APPLICATION 128] BCDString --(SIZE(7..8))
1375
1376 ImeiOrEsn ::= [APPLICATION 429] CHOICE 
1377 {
1378     imei  Imei,
1379     esn   Esn,
1380 ...
1381
1382
1383 Imsi ::= [APPLICATION 129] BCDString --(SIZE(3..8))
1384
1385 IMSSignallingContext ::= [APPLICATION 418] INTEGER
1386
1387 InternetServiceProvider ::= [APPLICATION 329] SEQUENCE
1388 {
1389     ispIdType        IspIdType        OPTIONAL, -- *m.m.
1390     ispIdentifier    IspIdentifier    OPTIONAL, -- *m.m.
1391 ...
1392 }
1393  
1394 InternetServiceProviderIdList ::= [APPLICATION 330] SEQUENCE OF InternetServiceProvider
1395
1396 IspIdentifier ::= [APPLICATION 294] AsciiString
1397  
1398 IspIdType ::= [APPLICATION 293] INTEGER
1399
1400 ISPList ::= [APPLICATION 378] SEQUENCE OF InternetServiceProvider
1401
1402 NetworkIdType ::= [APPLICATION 331] INTEGER
1403
1404 NetworkIdentifier ::= [APPLICATION 295] AsciiString
1405
1406 Network ::= [APPLICATION 332] SEQUENCE
1407 {
1408     networkIdType     NetworkIdType     OPTIONAL, -- *m.m.
1409     networkIdentifier NetworkIdentifier OPTIONAL, -- *m.m.
1410 ...
1411 }
1412  
1413 NetworkList ::= [APPLICATION 333] SEQUENCE OF Network
1414  
1415 LatestCallTimeStamp ::= [APPLICATION 133] DateTimeLong
1416
1417 LCSQosDelivered ::= [APPLICATION 390] SEQUENCE
1418 {
1419     lCSTransactionStatus          LCSTransactionStatus        OPTIONAL,
1420     horizontalAccuracyDelivered   HorizontalAccuracyDelivered OPTIONAL,
1421     verticalAccuracyDelivered     VerticalAccuracyDelivered   OPTIONAL,
1422     responseTime                  ResponseTime                OPTIONAL,
1423     positioningMethod             PositioningMethod           OPTIONAL,
1424     trackingPeriod                TrackingPeriod              OPTIONAL,
1425     trackingFrequency             TrackingFrequency           OPTIONAL,
1426     ageOfLocation                 AgeOfLocation               OPTIONAL,
1427 ...
1428 }
1429
1430 LCSQosRequested ::= [APPLICATION 383] SEQUENCE
1431 {
1432     lCSRequestTimestamp           LCSRequestTimestamp         OPTIONAL, -- *m.m.
1433     horizontalAccuracyRequested   HorizontalAccuracyRequested OPTIONAL,
1434     verticalAccuracyRequested     VerticalAccuracyRequested   OPTIONAL,
1435     responseTimeCategory          ResponseTimeCategory        OPTIONAL,
1436     trackingPeriod                TrackingPeriod              OPTIONAL,
1437     trackingFrequency             TrackingFrequency           OPTIONAL,
1438 ...
1439 }
1440
1441 LCSRequestTimestamp ::= [APPLICATION 384] DateTime
1442
1443 LCSSPIdentification ::= [APPLICATION 375] SEQUENCE
1444 {
1445  contentProviderIdType         ContentProviderIdType     OPTIONAL, -- *m.m.
1446  contentProviderIdentifier     ContentProviderIdentifier OPTIONAL, -- *m.m.
1447 ...
1448 }
1449
1450 LCSSPIdentificationList ::= [APPLICATION 374] SEQUENCE OF LCSSPIdentification
1451
1452 LCSSPInformation ::= [APPLICATION 373] SEQUENCE
1453 {
1454     lCSSPIdentificationList       LCSSPIdentificationList OPTIONAL, -- *m.m.
1455     iSPList                       ISPList                 OPTIONAL,
1456     networkList                   NetworkList             OPTIONAL,
1457 ...
1458 }
1459
1460 LCSTransactionStatus ::= [APPLICATION 391] INTEGER
1461
1462 LocalCurrency ::= [APPLICATION 135] Currency
1463
1464 LocalTimeStamp ::= [APPLICATION 16] NumberString --(SIZE(14))
1465
1466 LocationArea ::= [APPLICATION 136] INTEGER 
1467
1468 LocationDescription ::= AsciiString
1469
1470 LocationIdentifier ::= [APPLICATION 289] AsciiString
1471
1472 LocationIdType ::= [APPLICATION 315] INTEGER
1473
1474 LocationInformation ::= [APPLICATION 138]  SEQUENCE
1475 {
1476     networkLocation             NetworkLocation         OPTIONAL, -- *m.m.
1477     homeLocationInformation     HomeLocationInformation OPTIONAL,
1478     geographicalLocation        GeographicalLocation    OPTIONAL,
1479 ...
1480
1481
1482 LocationServiceUsage ::= [APPLICATION 382] SEQUENCE
1483 {
1484     lCSQosRequested               LCSQosRequested       OPTIONAL, -- *m.m.
1485     lCSQosDelivered               LCSQosDelivered       OPTIONAL,
1486     chargingTimeStamp             ChargingTimeStamp     OPTIONAL,
1487     chargeInformationList         ChargeInformationList OPTIONAL, -- *m.m.
1488 ...
1489 }
1490
1491 MaximumBitRate ::= [APPLICATION 421] OCTET STRING --(SIZE (1))
1492
1493 Mdn ::= [APPLICATION 253] NumberString
1494
1495 MessageDescription ::= [APPLICATION 142] AsciiString
1496
1497 MessageDescriptionCode ::= [APPLICATION 141] Code
1498
1499 MessageDescriptionInformation ::= [APPLICATION 143] SEQUENCE
1500 {
1501     messageDescriptionCode MessageDescriptionCode OPTIONAL, -- *m.m.
1502     messageDescription     MessageDescription     OPTIONAL, -- *m.m.
1503 ...
1504 }
1505
1506 MessageStatus ::= [APPLICATION 144] INTEGER
1507
1508 MessageType ::= [APPLICATION 145] INTEGER
1509
1510 MessagingEventService ::= [APPLICATION 439] INTEGER
1511
1512 Min ::= [APPLICATION 146] NumberString --(SIZE(2..15)) 
1513
1514 MinChargeableSubscriber ::= [APPLICATION 254] SEQUENCE
1515 {
1516     min     Min    OPTIONAL, -- *m.m.
1517     mdn     Mdn    OPTIONAL,
1518 ...
1519 }
1520
1521 MoBasicCallInformation ::= [APPLICATION 147] SEQUENCE
1522 {
1523     chargeableSubscriber        ChargeableSubscriber    OPTIONAL, -- *m.m.
1524     rapFileSequenceNumber       RapFileSequenceNumber   OPTIONAL,
1525     destination                 Destination             OPTIONAL,
1526     destinationNetwork          DestinationNetwork      OPTIONAL,
1527     callEventStartTimeStamp     CallEventStartTimeStamp OPTIONAL, -- *m.m.
1528     totalCallEventDuration      TotalCallEventDuration  OPTIONAL, -- *m.m.
1529     simToolkitIndicator         SimToolkitIndicator     OPTIONAL,
1530     causeForTerm                CauseForTerm            OPTIONAL,
1531 ...
1532 }
1533
1534 MobileSessionService ::= [APPLICATION 440] INTEGER      
1535
1536 Msisdn ::= [APPLICATION 152] BCDString --(SIZE(1..9))
1537
1538 MtBasicCallInformation ::= [APPLICATION 153] SEQUENCE
1539 {
1540     chargeableSubscriber        ChargeableSubscriber    OPTIONAL, -- *m.m.
1541     rapFileSequenceNumber       RapFileSequenceNumber   OPTIONAL,
1542     callOriginator              CallOriginator          OPTIONAL,
1543     originatingNetwork          OriginatingNetwork      OPTIONAL,
1544     callEventStartTimeStamp     CallEventStartTimeStamp OPTIONAL, -- *m.m.
1545     totalCallEventDuration      TotalCallEventDuration  OPTIONAL, -- *m.m.
1546     simToolkitIndicator         SimToolkitIndicator     OPTIONAL,
1547     causeForTerm                CauseForTerm            OPTIONAL,
1548 ...
1549 }
1550
1551 NetworkAccessIdentifier ::= [APPLICATION 417] AsciiString
1552
1553 NetworkElement ::= [APPLICATION 441]  SEQUENCE
1554 {
1555 elementType             ElementType  OPTIONAL, -- *m.m.
1556 elementId               ElementId    OPTIONAL, -- *m.m.
1557 ...
1558 }
1559
1560 NetworkElementList ::= [APPLICATION 442] SEQUENCE OF NetworkElement
1561
1562 NetworkId ::= AsciiString --(SIZE(1..6))
1563
1564 NetworkInitPDPContext ::= [APPLICATION 245] INTEGER
1565
1566 NetworkLocation ::= [APPLICATION 156]  SEQUENCE
1567 {
1568     recEntityCode               RecEntityCode OPTIONAL, -- *m.m.
1569     callReference               CallReference OPTIONAL,
1570     locationArea                LocationArea  OPTIONAL,
1571     cellId                      CellId        OPTIONAL,
1572 ...
1573 }
1574
1575 NonChargedNumber ::= [APPLICATION 402] AsciiString
1576
1577 NonChargedParty ::= [APPLICATION 443]  SEQUENCE
1578 {
1579     nonChargedPartyNumber       NonChargedPartyNumber    OPTIONAL,
1580     nonChargedPublicUserId      NonChargedPublicUserId OPTIONAL,
1581 ...
1582 }
1583
1584 NonChargedPartyNumber ::= [APPLICATION 444] AddressStringDigits
1585
1586 NonChargedPublicUserId ::= [APPLICATION 445] AsciiString 
1587
1588 NumberOfDecimalPlaces ::= [APPLICATION 159] INTEGER
1589
1590 ObjectType ::= [APPLICATION 281] INTEGER
1591
1592 OperatorSpecInfoList ::= [APPLICATION 162] SEQUENCE OF OperatorSpecInformation
1593
1594 OperatorSpecInformation ::= [APPLICATION 163] AsciiString
1595
1596 OrderPlacedTimeStamp ::= [APPLICATION 300] DateTime
1597
1598 OriginatingNetwork ::= [APPLICATION 164] NetworkId 
1599
1600 PacketDataProtocolAddress ::= [APPLICATION 165] AsciiString 
1601
1602 PaidIndicator ::= [APPLICATION 346] INTEGER
1603  
1604 PartialTypeIndicator ::=  [APPLICATION 166] AsciiString --(SIZE(1))
1605
1606 PaymentMethod ::= [APPLICATION 347] INTEGER
1607
1608 PdpAddress ::= [APPLICATION 167] PacketDataProtocolAddress
1609
1610 PDPContextStartTimestamp ::= [APPLICATION 260] DateTime
1611
1612 PlmnId ::= [APPLICATION 169] AsciiString --(SIZE(5))
1613
1614 PositioningMethod ::= [APPLICATION 395] INTEGER
1615
1616 PriorityCode ::= [APPLICATION 170] INTEGER
1617
1618 PublicUserId ::= [APPLICATION 446] AsciiString 
1619
1620 RapFileSequenceNumber ::= [APPLICATION 181]  FileSequenceNumber
1621
1622 RecEntityCode ::= [APPLICATION 184] Code
1623
1624 RecEntityCodeList ::= [APPLICATION 185] SEQUENCE OF RecEntityCode
1625
1626 RecEntityId ::= [APPLICATION 400] AsciiString
1627
1628 RecEntityInfoList ::= [APPLICATION 188] SEQUENCE OF RecEntityInformation
1629
1630 RecEntityInformation ::= [APPLICATION 183] SEQUENCE
1631 {
1632     recEntityCode  RecEntityCode OPTIONAL, -- *m.m.
1633     recEntityType  RecEntityType OPTIONAL, -- *m.m.
1634     recEntityId    RecEntityId   OPTIONAL, -- *m.m.
1635 ...
1636 }
1637  
1638 RecEntityType ::= [APPLICATION 186] INTEGER
1639
1640 Recipient ::= [APPLICATION 182]  PlmnId
1641
1642 ReleaseVersionNumber ::= [APPLICATION 189] INTEGER
1643
1644 RequestedDeliveryTimeStamp ::= [APPLICATION 301] DateTime
1645
1646 ResponseTime ::= [APPLICATION 394] INTEGER
1647
1648 ResponseTimeCategory ::= [APPLICATION 387] INTEGER
1649
1650 ScuBasicInformation ::= [APPLICATION 191] SEQUENCE
1651 {
1652     chargeableSubscriber      ScuChargeableSubscriber    OPTIONAL, -- *m.m.
1653     chargedPartyStatus        ChargedPartyStatus         OPTIONAL, -- *m.m.
1654     nonChargedNumber          NonChargedNumber           OPTIONAL, -- *m.m.
1655     clirIndicator             ClirIndicator              OPTIONAL,
1656     originatingNetwork        OriginatingNetwork         OPTIONAL,
1657     destinationNetwork        DestinationNetwork         OPTIONAL,
1658 ...
1659 }
1660
1661 ScuChargeType ::= [APPLICATION 192]  SEQUENCE
1662 {
1663     messageStatus               MessageStatus          OPTIONAL, -- *m.m.
1664     priorityCode                PriorityCode           OPTIONAL, -- *m.m.
1665     distanceChargeBandCode      DistanceChargeBandCode OPTIONAL,
1666     messageType                 MessageType            OPTIONAL, -- *m.m.
1667     messageDescriptionCode      MessageDescriptionCode OPTIONAL, -- *m.m.
1668 ...
1669 }
1670
1671 ScuTimeStamps ::= [APPLICATION 193]  SEQUENCE
1672 {
1673     depositTimeStamp            DepositTimeStamp    OPTIONAL, -- *m.m.
1674     completionTimeStamp         CompletionTimeStamp OPTIONAL, -- *m.m.
1675     chargingPoint               ChargingPoint       OPTIONAL, -- *m.m.
1676 ...
1677 }
1678
1679 ScuChargeableSubscriber ::= [APPLICATION 430] CHOICE 
1680 {
1681     gsmChargeableSubscriber    GsmChargeableSubscriber,
1682     minChargeableSubscriber    MinChargeableSubscriber,
1683 ...
1684 }
1685
1686 Sender ::= [APPLICATION 196]  PlmnId
1687
1688 ServiceStartTimestamp ::= [APPLICATION 447] DateTime
1689
1690 ServingBid ::= [APPLICATION 198]  Bid
1691
1692 ServingLocationDescription ::= [APPLICATION 414] LocationDescription
1693
1694 ServingNetwork ::= [APPLICATION 195]  AsciiString
1695
1696 ServingPartiesInformation ::= [APPLICATION 335] SEQUENCE
1697 {
1698   contentProviderName           ContentProviderName           OPTIONAL, -- *m.m.
1699   contentProviderIdList         ContentProviderIdList         OPTIONAL,
1700   internetServiceProviderIdList InternetServiceProviderIdList OPTIONAL,
1701   networkList                   NetworkList                   OPTIONAL,
1702 ...
1703 }
1704
1705 SessionChargeInfoList ::= [APPLICATION 448] SEQUENCE OF SessionChargeInformation
1706
1707 SessionChargeInformation ::= [APPLICATION 449] SEQUENCE
1708 {
1709 chargedItem                     ChargedItem              OPTIONAL, -- *m.m.    
1710 exchangeRateCode                ExchangeRateCode         OPTIONAL,
1711         callTypeGroup           CallTypeGroup            OPTIONAL, -- *m.m.
1712         chargeDetailList        ChargeDetailList         OPTIONAL, -- *m.m.
1713         taxInformationList      TaxInformationList       OPTIONAL,
1714 ...
1715 }         
1716  
1717 SimChargeableSubscriber ::= [APPLICATION 199] SEQUENCE
1718 {
1719     imsi     Imsi   OPTIONAL, -- *m.m.
1720     msisdn   Msisdn OPTIONAL,
1721 ...
1722 }
1723
1724 SimToolkitIndicator ::= [APPLICATION 200] AsciiString --(SIZE(1)) 
1725
1726 SMSDestinationNumber ::= [APPLICATION 419] AsciiString
1727
1728 SMSOriginator ::= [APPLICATION 425] AsciiString
1729
1730 SpecificationVersionNumber  ::= [APPLICATION 201] INTEGER
1731
1732 SsParameters ::= [APPLICATION 204] AsciiString --(SIZE(1..40))
1733
1734 SupplServiceActionCode ::= [APPLICATION 208] INTEGER
1735
1736 SupplServiceCode ::= [APPLICATION 209] HexString --(SIZE(2))
1737
1738 SupplServiceUsed ::= [APPLICATION 206] SEQUENCE
1739 {
1740     supplServiceCode       SupplServiceCode       OPTIONAL, -- *m.m.
1741     supplServiceActionCode SupplServiceActionCode OPTIONAL, -- *m.m.
1742     ssParameters           SsParameters           OPTIONAL,
1743     chargingTimeStamp      ChargingTimeStamp      OPTIONAL,
1744     chargeInformation      ChargeInformation      OPTIONAL,
1745     basicServiceCodeList   BasicServiceCodeList   OPTIONAL,
1746 ...
1747 }
1748
1749 TapCurrency ::= [APPLICATION 210] Currency
1750
1751 TapDecimalPlaces ::= [APPLICATION 244] INTEGER
1752
1753 TaxableAmount ::= [APPLICATION 398] AbsoluteAmount
1754
1755 Taxation ::= [APPLICATION 216] SEQUENCE
1756 {
1757     taxCode      TaxCode      OPTIONAL, -- *m.m.
1758     taxType      TaxType      OPTIONAL, -- *m.m.
1759     taxRate      TaxRate      OPTIONAL,
1760     chargeType   ChargeType   OPTIONAL,
1761     taxIndicator TaxIndicator OPTIONAL,
1762 ...
1763 }
1764
1765 TaxationList ::= [APPLICATION 211]  SEQUENCE OF Taxation
1766
1767 TaxCode ::= [APPLICATION 212] INTEGER
1768
1769 TaxIndicator ::= [APPLICATION 432] AsciiString --(SIZE(1))
1770
1771 TaxInformation ::= [APPLICATION 213] SEQUENCE
1772 {
1773     taxCode          TaxCode       OPTIONAL, -- *m.m.
1774     taxValue         TaxValue      OPTIONAL, -- *m.m.
1775     taxableAmount    TaxableAmount OPTIONAL,
1776 ...
1777 }
1778
1779 TaxInformationList ::= [APPLICATION 214]  SEQUENCE OF TaxInformation
1780
1781 -- The TaxRate item is of a fixed length to ensure that the full 5 
1782 -- decimal places is provided.
1783
1784 TaxRate ::= [APPLICATION 215] NumberString --(SIZE(7))
1785
1786 TaxType ::= [APPLICATION 217] AsciiString --(SIZE(2))
1787
1788 TaxValue ::= [APPLICATION 397] AbsoluteAmount
1789
1790 TeleServiceCode ::= [APPLICATION 218] HexString --(SIZE(2))
1791
1792 ThirdPartyInformation ::= [APPLICATION 219]  SEQUENCE
1793 {
1794     thirdPartyNumber            ThirdPartyNumber        OPTIONAL,
1795     clirIndicator               ClirIndicator         OPTIONAL,
1796 ...
1797 }
1798
1799 ThirdPartyNumber ::= [APPLICATION 403] AddressStringDigits
1800
1801 ThreeGcamelDestination ::= [APPLICATION 431] CHOICE
1802 {
1803     camelDestinationNumber    CamelDestinationNumber,
1804     gprsDestination           GprsDestination,
1805 ...
1806 }
1807
1808 TotalAdvisedCharge ::= [APPLICATION 356] AbsoluteAmount
1809  
1810 TotalAdvisedChargeRefund ::= [APPLICATION 357] AbsoluteAmount
1811  
1812 TotalAdvisedChargeValue ::= [APPLICATION 360] SEQUENCE
1813 {
1814     advisedChargeCurrency    AdvisedChargeCurrency    OPTIONAL,
1815     totalAdvisedCharge       TotalAdvisedCharge       OPTIONAL, -- *m.m.
1816     totalAdvisedChargeRefund TotalAdvisedChargeRefund OPTIONAL,
1817     totalCommission          TotalCommission          OPTIONAL,
1818     totalCommissionRefund    TotalCommissionRefund    OPTIONAL,
1819 ...
1820 }
1821  
1822 TotalAdvisedChargeValueList ::= [APPLICATION 361] SEQUENCE OF TotalAdvisedChargeValue
1823
1824 TotalCallEventDuration ::= [APPLICATION 223] INTEGER 
1825
1826 TotalCharge ::= [APPLICATION 415] AbsoluteAmount
1827
1828 TotalChargeRefund ::= [APPLICATION 355] AbsoluteAmount
1829  
1830 TotalCommission ::= [APPLICATION 358] AbsoluteAmount
1831  
1832 TotalCommissionRefund ::= [APPLICATION 359] AbsoluteAmount
1833  
1834 TotalDataVolume ::= [APPLICATION 343] DataVolume
1835  
1836 TotalDiscountRefund ::= [APPLICATION 354] AbsoluteAmount
1837  
1838 TotalDiscountValue ::= [APPLICATION 225] AbsoluteAmount
1839
1840 TotalTaxRefund ::= [APPLICATION 353] AbsoluteAmount
1841  
1842 TotalTaxValue ::= [APPLICATION 226] AbsoluteAmount
1843
1844 TotalTransactionDuration ::= [APPLICATION 416] TotalCallEventDuration
1845
1846 TrackedCustomerEquipment ::= [APPLICATION 381] SEQUENCE
1847 {
1848     equipmentIdType               EquipmentIdType OPTIONAL, -- *m.m.
1849     equipmentId                   EquipmentId     OPTIONAL, -- *m.m.
1850 ...
1851 }
1852
1853 TrackedCustomerHomeId ::= [APPLICATION 377] SEQUENCE
1854 {
1855     homeIdType                    HomeIdType     OPTIONAL, -- *m.m.
1856     homeIdentifier                HomeIdentifier OPTIONAL, -- *m.m.
1857 ...
1858 }
1859
1860 TrackedCustomerHomeIdList ::= [APPLICATION 376] SEQUENCE OF TrackedCustomerHomeId
1861
1862 TrackedCustomerIdentification ::= [APPLICATION 372] SEQUENCE
1863 {
1864     customerIdType                CustomerIdType     OPTIONAL, -- *m.m.
1865     customerIdentifier            CustomerIdentifier OPTIONAL, -- *m.m.
1866 ...
1867 }
1868
1869 TrackedCustomerIdList ::= [APPLICATION 370] SEQUENCE OF TrackedCustomerIdentification
1870
1871 TrackedCustomerInformation ::= [APPLICATION 367] SEQUENCE
1872 {
1873     trackedCustomerIdList         TrackedCustomerIdList     OPTIONAL, -- *m.m.
1874     trackedCustomerHomeIdList     TrackedCustomerHomeIdList OPTIONAL,
1875     trackedCustomerLocList        TrackedCustomerLocList    OPTIONAL,
1876     trackedCustomerEquipment      TrackedCustomerEquipment  OPTIONAL,
1877 ...
1878 }
1879
1880 TrackedCustomerLocation ::= [APPLICATION 380] SEQUENCE
1881 {
1882     locationIdType                LocationIdType     OPTIONAL, -- *m.m.
1883     locationIdentifier            LocationIdentifier OPTIONAL, -- *m.m.
1884 ...
1885 }
1886
1887 TrackedCustomerLocList ::= [APPLICATION 379] SEQUENCE OF TrackedCustomerLocation
1888
1889 TrackingCustomerEquipment ::= [APPLICATION 371] SEQUENCE
1890 {
1891     equipmentIdType               EquipmentIdType OPTIONAL, -- *m.m.
1892     equipmentId                   EquipmentId     OPTIONAL, -- *m.m.
1893 ...
1894 }
1895
1896 TrackingCustomerHomeId ::= [APPLICATION 366] SEQUENCE
1897 {
1898     homeIdType                    HomeIdType     OPTIONAL, -- *m.m.
1899     homeIdentifier                HomeIdentifier OPTIONAL, -- *m.m.
1900 ...
1901 }
1902
1903 TrackingCustomerHomeIdList ::= [APPLICATION 365] SEQUENCE OF TrackingCustomerHomeId
1904
1905 TrackingCustomerIdentification ::= [APPLICATION 362] SEQUENCE
1906 {
1907     customerIdType                CustomerIdType     OPTIONAL, -- *m.m.
1908     customerIdentifier            CustomerIdentifier OPTIONAL, -- *m.m.
1909 ...
1910 }
1911
1912 TrackingCustomerIdList ::= [APPLICATION 299] SEQUENCE OF TrackingCustomerIdentification
1913
1914 TrackingCustomerInformation ::= [APPLICATION 298] SEQUENCE
1915 {
1916     trackingCustomerIdList        TrackingCustomerIdList     OPTIONAL, -- *m.m.
1917     trackingCustomerHomeIdList    TrackingCustomerHomeIdList OPTIONAL,
1918     trackingCustomerLocList       TrackingCustomerLocList    OPTIONAL,
1919     trackingCustomerEquipment     TrackingCustomerEquipment  OPTIONAL,
1920 ...
1921 }
1922
1923 TrackingCustomerLocation ::= [APPLICATION 369] SEQUENCE
1924 {
1925     locationIdType                LocationIdType     OPTIONAL, -- *m.m.
1926     locationIdentifier            LocationIdentifier OPTIONAL, -- *m.m.
1927 ...
1928 }
1929
1930 TrackingCustomerLocList ::= [APPLICATION 368] SEQUENCE OF TrackingCustomerLocation
1931
1932 TrackingFrequency ::= [APPLICATION 389] INTEGER
1933
1934 TrackingPeriod ::= [APPLICATION 388] INTEGER
1935
1936 TransactionAuthCode ::= [APPLICATION 342] AsciiString
1937  
1938 TransactionDescriptionSupp ::= [APPLICATION 338] INTEGER
1939  
1940 TransactionDetailDescription ::= [APPLICATION 339] AsciiString
1941
1942 TransactionIdentifier ::= [APPLICATION 341] AsciiString
1943  
1944 TransactionShortDescription ::= [APPLICATION 340] AsciiString
1945  
1946 TransactionStatus ::= [APPLICATION 303] INTEGER
1947
1948 TransferCutOffTimeStamp ::= [APPLICATION 227] DateTimeLong
1949
1950 TransparencyIndicator ::= [APPLICATION 228] INTEGER
1951
1952 UserProtocolIndicator ::= [APPLICATION 280] INTEGER
1953
1954 UtcTimeOffset ::= [APPLICATION 231] AsciiString --(SIZE(5))
1955
1956 UtcTimeOffsetCode ::= [APPLICATION 232] Code
1957
1958 UtcTimeOffsetInfo ::= [APPLICATION 233] SEQUENCE
1959 {
1960     utcTimeOffsetCode   UtcTimeOffsetCode OPTIONAL, -- *m.m.
1961     utcTimeOffset       UtcTimeOffset     OPTIONAL, -- *m.m.
1962 ...
1963 }
1964
1965 UtcTimeOffsetInfoList ::= [APPLICATION 234]  SEQUENCE OF UtcTimeOffsetInfo
1966
1967 VerticalAccuracyDelivered ::= [APPLICATION 393] INTEGER
1968
1969 VerticalAccuracyRequested ::= [APPLICATION 386] INTEGER
1970
1971
1972 --
1973 -- Tagged common data types
1974 --
1975
1976 --
1977 -- The AbsoluteAmount data type is used to 
1978 -- encode absolute revenue amounts.
1979 -- The accuracy of all absolute amount values is defined
1980 -- by the value of TapDecimalPlaces within the group
1981 -- AccountingInfo for the entire TAP batch.
1982 -- Note, that only amounts greater than or equal to zero are allowed.
1983 -- The decimal number representing the amount is 
1984 -- derived from the encoded integer 
1985 -- value by division by 10^TapDecimalPlaces.
1986 -- for example for TapDecimalPlaces = 3 the following values
1987 -- will be derived:
1988 --       0   represents    0.000
1989 --      12   represents    0.012
1990 --    1234   represents    1.234
1991 -- for TapDecimalPlaces = 5 the following values will be
1992 -- derived:
1993 --       0   represents    0.00000
1994 --    1234   represents    0.01234
1995 --  123456   represents    1.23456
1996 -- This data type is used to encode (total) 
1997 -- charges, (total) discount values and 
1998 -- (total) tax values. 
1999 -- 
2000 AbsoluteAmount ::= INTEGER 
2001
2002 Bid ::=  AsciiString --(SIZE(5))
2003
2004 Code ::= INTEGER
2005
2006 --
2007 -- Non-tagged common data types
2008 --
2009 --
2010 -- Recommended common data types to be used for file encoding:
2011 --
2012 -- The following definitions should be used for TAP file creation instead of
2013 -- the default specifications (OCTET STRING)
2014 --
2015 --    AsciiString ::= VisibleString
2016 --
2017 --    Currency ::= VisibleString
2018 --
2019 --    HexString ::= VisibleString
2020 --
2021 --    NumberString ::= NumericString
2022 --
2023 --    AsciiString contains visible ISO 646 characters.
2024 --    Leading and trailing spaces must be discarded during processing.
2025 --    An AsciiString cannot contain only spaces.
2026
2027 AsciiString ::= OCTET STRING
2028
2029 --
2030 -- The BCDString data type (Binary Coded Decimal String) is used to represent
2031 -- several digits from 0 through 9, a, b, c, d, e.
2032 -- Two digits are encoded per octet.  The four leftmost bits of the octet represent
2033 -- the first digit while the four remaining bits represent the following digit.  
2034 -- A single f must be used as a filler when the total number of digits to be 
2035 -- encoded is odd.
2036 -- No other filler is allowed.
2037
2038 BCDString ::= OCTET STRING
2039
2040
2041 --
2042 -- The currency codes from ISO 4217
2043 -- are used to identify a currency 
2044 --
2045 Currency ::= OCTET STRING
2046
2047 --
2048 -- HexString contains ISO 646 characters from 0 through 9, A, B, C, D, E, F.
2049 --
2050
2051 HexString ::= OCTET STRING
2052
2053 --
2054 -- NumberString contains ISO 646 characters from 0 through 9.
2055 --
2056
2057 NumberString ::= OCTET STRING
2058
2059
2060 --
2061 -- The PercentageRate data type is used to
2062 -- encode percentage rates with an accuracy of 2 decimal places. 
2063 -- This data type is used to encode discount rates.
2064 -- The decimal number representing the percentage
2065 -- rate is obtained by dividing the integer value by 100
2066 -- Examples:
2067 --
2068 --     1500  represents  15.00 percent
2069 --     1     represents   0.01 percent
2070 --
2071 PercentageRate ::= INTEGER 
2072
2073
2074 -- END
2075 END
2076 }
2077
2078 1;