SantMan
SantMan

Reputation: 77

ASN.1 decoding of TCAP GSM messages

I'm trying to decode the TCAP GSM messages and wanted to undertand few things on the ASN.1 struct for few of the elements.

enter image description here

Wanted to understand what does the values in the rectangle brace [] indicate? (shown highlighted in the image above).

Here is the link to the ETS standard which I'm using to extract this info. look page at 773 for more details.

Any help in making me understand the same is aprreciated.

Upvotes: 2

Views: 1183

Answers (2)

Kemal Atik
Kemal Atik

Reputation: 337

While decoding the arguments of MAP sequence, you access the child elements of sequence using the tag values but bear in the mind that they do not have to be sequential, optional tags might not have been set by encoded party.

e.g. sample code using bounty castle

    DLSequence sequence = (DLSequence)derTaggedObject.getObject();
    for(int i =0; i < sequence.size(); i++){
        DERTaggedObject seqElement = (DERTaggedObject)sequence.getObjectAt(i);
        switch (seqElement.getTagNo()) {
            case MSCRecordType:

TCAP and MAP ASN.1 module definitions can be found on this github page.

Upvotes: 0

pepo
pepo

Reputation: 8877

It's a TAG number. You can read more about encoding of a TAG value here.

If you look at the insertSubscriberData structure you have imsi, msisdn and category of the same type (OCTET STRING) and all are optional. TAG number is necessary tool to distinguish what value was encoded because sender will not encode the value if it is null. When the decoder gets binary data and has to reconstruct the insertSubscriberData structure it needs to know if it is reading imsi, msisdn or category. Based on the tag number it knows what part of the structure it is.

Upvotes: 4

Related Questions