2 #------------------------------------------------------------------------------
3 # $File: ber,v 1.1 2016/06/05 00:21:30 christos Exp $
4 # ber: file(1) magic for several BER formats used in the mobile
5 # telecommunications industry (Georg Sauthoff)
7 # The file formats are standardized by the GSMA (GSM association).
8 # They are specified via ASN.1 schemas and some prose. Basic encoding
9 # rules (BER) is the used encoding. The formats are used for exchanging
10 # call data records (CDRs) between mobile operators and associated
11 # parties for roaming clearing purposes and fraud detection.
13 # The magic file covers:
15 # - TAP files (TD.57) - CDR batches and notifications
16 # - RAP files (TD.32) - return batches and acknowledgements
17 # - NRT files (TD.35) - CDR batches for 'near real time' processing
21 # TAP -> Transferred Account Procedure
22 # cf. http://www.gsma.com/newsroom/wp-content/uploads/TD.57-v32.31.pdf
23 # TransferBatch short tag
25 # BatchControlInfo short tag
27 # Sender long tag #TAP 3.x (BER encoded)
28 >>&1 search/b8 \x5f\x81\x44
29 # <SpecificationVersionNumber>3</><ReleaseVersionNumber> block
30 >>>&64 search/b64 \x5f\x81\x49\x01\x03\x5f\x81\x3d\x01
31 >>>>&0 byte x TAP 3.%d Batch (TD.57, Transferred Account)
33 # Notification short tag
36 >2 search/b8 \x5f\x81\x44
37 # <SpecificationVersionNumber>3</><ReleaseVersionNumber> block
38 >>&64 search/b64 \x5f\x81\x49\x01\x03\x5f\x81\x3d\x01
39 >>>&0 byte x TAP 3.%d Notification (TD.57, Transferred Account)
45 # <SpecificationVersionNumber>2</><ReleaseVersionNumber> block
46 >&1 search/b8 \x5f\x29\x01\x02\x5f\x25\x01
47 >>&0 byte x NRT 2.%d (TD.35, Near Real Time Roaming Data Exchange)
50 # cf. http://www.gsma.com/newsroom/wp-content/uploads/TD.32-v6.11.pdf
51 # Long ReturnBatch tag
53 # Long RapBatchControlInfo tag
54 >&1 search/b8 \x7f\x84\x19
55 # <SpecificationVersionNumber>3</><ReleaseVersionNumber> block
56 >>&64 search/b64 \x5f\x81\x49\x01\x03\x5f\x81\x3d\x01
57 # <RapSpecificationVersionNumber>1</><RapReleaseVersionNumber> block
58 >>>&1 string/b \x5f\x84\x20\x01\x01\x5f\x84\x1f\x01
59 >>>>&0 byte x RAP 1.%d Batch (TD.32, Returned Account Procedure),
62 # Long Acknowledgement tag
65 >&1 search/b5 \x5f\x81\x44 RAP Acknowledgement (TD.32, Returned Account Procedure)