I would like some help with an issue please (any idea is worth trying, I'm out of ideas already).
Context:
I have a schema (.asn) and a .dat file (binary) and I'm trying to decode the .dat. For now I'm using asn1tools. Some of the fields work but others don't. The code that I'm using is as follows:
import asn1tools
path_asn = './cdr_schema.asn'
schema = asn1tools.compile_files(path_asn, 'ber')
file_path = './cdr_file.dat'
with open(file_path, "rb") as f:
bit_cdr = f.read()
schema.decode('CallEventRecord', bit_cdr)
This code will generate my output, part of the output is as follows:
('pGWRecord',
{'recordType': 85,
'servedIMSI': b'b\x88\x00\x01\x10\x90\xf2',
'p-GWAddress': ('iPBinV4Address', b'\xc3\x17X\x08'),
'chargingID': 1621661753
As can be seem, 'recordType' and 'chargingID' are ok, but the other two are not decoded. Anyone have any idea of what could be the issue? Or any ideas that I could try?
Besides the python decode above, I tried some online tool. it seemed to work for some cases but couldn't figure it out how they do it. ASN1. For the online tool I need to change the file extension .ber instead of .asn and on decode select side "CallEventRecord".
Using the online tool I obtain:
rec1value CallEventRecord ::= pGWRecord : {
recordType pGWRecord,
servedIMSI '62880001102090F2'H,
p-GWAddress iPBinV4Address : 'C3175808'H,
chargingID 1621661753
In this case, servedIMSI and chargingID are ok for now (even though seems to be needing more work), but I don't know this tool were able to get this value.
The link for the schema and CDR can be found github repo