I need help with regards to decoding my this file. In this my code here when I tried to decode the `MTCallRecord I do see an empty { } in my save.txt file.
import asn1tools
# Compile ASN.1 schema
path_asn = 'cdr_schema.asn'
schema = asn1tools.compile_files(path_asn, codec='der')
# Input file path
file_path = 'b06044079.dat'
# Output file path
output_file_path = 'output_decode.txt'
with open(file_path, "rb") as f:
bit_cdr = f.read()
# Decode the data
decoded_data = schema.decode('MTCallRecord', bit_cdr)
# Save the decoded data to a text file
with open(output_file_path, "w") as output_file:
output_file.write(str(decoded_data))
print(f"Decoded data saved to: {output_file_path}")
but when I change the type that I want to decode let's say for instance to CallEventRecord I get an error like this.
"raise MissingMandatoryFieldError(member, offset) asn1tools.codecs.ber.MissingMandatoryFieldError: CallEventRecord.outGatewayRecord:"
If i also try to change the decoding to CallEventDataFIle i do get an output but almost all the data in the output file will still be encoded and not practically decoded.
I will definity appreciate it if assisted. link to the asn file am using: https://drive.google.com/file/d/19dfbl6TUEZDNm61zEm8UEp3qNco8SoGH/view?usp=sharing dat link: https://drive.google.com/file/d/1ibNekvIGXrmW7-bYENRBNMXkDwdNWDIJ/view?usp=sharing