![](/img/trans.png)
[英]Decode and parse a file encoded with BER(Basic encoding rules) to output relevant fields to csv without a .asn (ASN.1) schema?
[英]How to decode TS32297 headers in ASN.1 schema for BER
I am trying to write asn.1 schema for IMS cdrs having file header and repeating cdr headers(TS 32297 headers) but not able to decode these headers
In a specification shared by the client these headers are defined like this:
FileHeader ::= SEQUENCE
{ fileLength [0] INTEGER (SIZE(4) CODE("DEC")) OPTIONAL,
headerlength [1] INTEGER (SIZE (3) CODE ("DEC")) OPTIONAL,
highreleaseIdentifier [2] OCTET STRING (SIZE (1)CODE ("LEFT")) OPTIONAL,
lowreleaseIdentifier [3] OCTET STRING (SIZE (1)CODE ("LEFT")) OPTIONAL,
fileTimestamp [4] OCTET STRING (SIZE (4)CODE ("LEFT")) OPTIONAL,
lastcdrTimestamp [5] OCTET STRING (SIZE (4)CODE ("LEFT")) OPTIONAL,
dataRecordIdentifier [6] OCTET STRING (SIZE (8)CODE ("LEFT")) OPTIONAL,
totalCdr [10] OCTET STRING (SIZE (4)CODE ("LEFT")) OPTIONAL,
filesequencenumber [11] OCTET STRING (SIZE (4)CODE ("LEFT")) OPTIONAL,
filecloserReason [12] IMPLICIT FilecloserReason (SIZE (4)CODE("DEC")) OPTIONAL,
ipnodeaddress [13] OCTET STRING (SIZE (20)CODE ("LEFT")) OPTIONAL,
lostCdrindicator [14] OCTET STRING (SIZE (1)CODE ("LEFT")) OPTIONAL,
lengthCdrFilter [15] INTEGER (SIZE (2)CODE ("LEFT")) OPTIONAL,
cdrroutingFilter [16] OCTET STRING (SIZE (5)CODE ("LEFT")) OPTIONAL
}
CDRHeader ::= SEQUENCE
{
cDRLength [0] INTEGER (SIZE(2) CODE("DEC")) OPTIONAL,
releaseIdentifier [1] IMPLICIT OCTET STRING (SIZE (1)CODE ("LEFT")) OPTIONAL, -- This comprises of Release Id and Version Id
dataRecordIdentifier [2] IMPLICIT OCTET STRING (SIZE (1)CODE ("LEFT")) OPTIONAL, -- It comprises of Data Record Number and TS Number
releaseIdentifierextension [3] IMPLICIT ReleaseIdentifierextension (SIZE (1)CODE("DEC")) OPTIONAL
}
但是 ASNVE1 无法理解这些 CODE("DEC")/CODE ("LEFT"),因此无法编译此 asn 规范。
请建议如何修改标头的 ASN 架构
您的规格无效
您可以删除所有的 CODE("DEC") 和 CODE ("LEFT")
你不能做你想做的事。 TS 32.297 标头未在 ASN.1 中指定并且不符合 ASN.1 编码。 如果您使用Objective System 的ASN1VE 工具查看此数据,它可以解析标题然后显示ASN.1 数据,但您必须告诉它您的数据有32.297 个标题。 然后使用描述 ASN.1 编码数据的未修改 ASN.1 模式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.