1 2#------------------------------------------------------------------------------ 3# $File: ber,v 1.3 2024/09/01 13:49:15 christos Exp $ 4# ber: file(1) magic for several BER formats used in the mobile 5# telecommunications industry (Georg Sauthoff) 6 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. 12 13# The magic file covers: 14 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 18 19# 20# TAP 3 Files 21# TAP -> Transferred Account Procedure 22# cf. https://www.gsma.com/newsroom/wp-content/uploads/TD.57-v32.31.pdf 23# TransferBatch short tag 240 byte 0x61 25# BatchControlInfo short tag 26>&1 search/b5 \x64 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) 32 33# Notification short tag 340 byte 0x62 35# Sender long 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) 40 41 42# NRT Files 43# NRT a.k.a. NRTRDE 44# <SpecificationVersionNumber>2</><ReleaseVersionNumber> block 45>&1 search/b8 \x5f\x29\x01\x02\x5f\x25\x01 46>>&0 byte x NRT 2.%d (TD.35, Near Real Time Roaming Data Exchange) 47 48# RAP Files 49# cf. https://www.gsma.com/newsroom/wp-content/uploads/TD.32-v6.11.pdf 50# Long ReturnBatch tag 510 string \x7f\x84\x16 52# Long RapBatchControlInfo tag 53>&1 search/b8 \x7f\x84\x19 54# <SpecificationVersionNumber>3</><ReleaseVersionNumber> block 55>>&64 search/b64 \x5f\x81\x49\x01\x03\x5f\x81\x3d\x01 56# <RapSpecificationVersionNumber>1</><RapReleaseVersionNumber> block 57>>>&1 string/b \x5f\x84\x20\x01\x01\x5f\x84\x1f\x01 58>>>>&0 byte x RAP 1.%d Batch (TD.32, Returned Account Procedure), 59>>>&0 byte x TAP 3.%d 60 61# Long Acknowledgement tag 620 string \x7f\x84\x17 63# Long Sender tag 64>&1 search/b5 \x5f\x81\x44 RAP Acknowledgement (TD.32, Returned Account Procedure) 65