nrt.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:ti-data-samples 作者: bom4v 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号