asn1tools: Getting (asn1tools.errors.CompileError) error

import asn1tools foo = asn1tools.compile_files(‘huawei-cdr.asn’)

asn1tools.errors.CompileError: Type 'GraphicString' not found in module 'CS-R99-R4-CHARGING'.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 33 (13 by maintainers)

Most upvoted comments

Try the code below with release 0.55.0 of asn1tools. Then open cdr.xml to see the data in XML.

import asn1tools

ber = asn1tools.compile_files('huawei-cdr.asn', 'ber')
xer = asn1tools.compile_files('huawei-cdr.asn', 'xer')

with open('cdr.dat', 'rb') as fin:
    encoded_ber = fin.read()

decoded = ber.decode('CallEventDataFile', encoded_ber)
encoded_xer = xer.encode('CallEventDataFile', decoded)

with open('cdr.xml', 'w') as fout:
    fout.write(encoded_xer.decode('ascii'))

hey @eerimoq @Immasarti I have reworked ber.MembersType.decode() to add support for SET members in any order, and also improved decode performance at the same time. See my fork: https://github.com/Finndersen/asn1tools There is also an open pull request

It worked like a charm! Thank you so much @eerimoq!!!

Worked like charm, Have a great day!!