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