def extract_details_from_filepath (nrt_file_path):
"""
Extract some details of call events
"""
# Build a NRT structure from the DER-serialized ASN.1 string
nrt = None
with open (nrt_file_path, mode='rb') as nrt_file:
nrt_file_content = nrt_file.read()
# Undo DER serialization, reconstruct NRT structure
try:
nrt, rest_of_input = ber_decoder.decode (nrt_file_content,
asn1Spec = Nrtrde.Nrtrde())
except SubstrateUnderrunError:
print ("Error in decoding '" + nrt_file_path + "'. Skipping it")
nrt = None
# Translate the NRT structure into a Python one
py_nrt = None
if nrt is not None:
py_nrt = extract_details_from_nrt (nrt)
#
return py_nrt
评论列表
文章目录