Subject: [Megaco] (no subject)

From: "kumaraswamy Uppu" <[email-masked]>
Date: 9 Feb 2004 13:10:04 -0000

Hi All,
  I have a query about BER encoding of serviceChangeReason Parameter. As per rfc 3525 , this string is first BER-encoded as an IA5String.
The result of this BER-encoding is then encoded as an ASN.1 OCTET STRING type.
  This is the encoded buffer for this Parameter.
  04 0F 16 0D 39 30 31 20  43 6F 6C 64 20 42 6F 6F 74 
  First I encoded it as IA5 string (16 0D 39 30 31 20  43 6F 6C 64 20 42 6F 6F 74) and then the result I encoded it as OctetString.
  When I tried to decode with Hammer Call Anaylzer its not decoding  serviceChangeReason properly.

Here Is the capture this packet.

---- UDP ----
   ---- UDP header ----
      0B-81 = B81h [2945d] source port
      0B-81 = B81h [2945d] destination port
      00-7D = 7Dh [125d] length: octets include header (not less than 8)
      E4-9B = E49Bh [58523d] checksum: checksum is correct
   ---- UDP datagram ----
---- H.248 ----
   {1010 0000}= A0h [160d]  tag: 0x00 [000]
   ---- Message ----
      ---- version ----
         {0000 0001}= 01h [001d] version
      ---- MId ----
         ---- IP4Address ----
            ---- address ----
               address: 192.168.5.8
      ---- Transactions ----
         ---- TransactionRequest ----
            ---- TransactionID ----
               {0110 0101}= 65h [101d] transactionID
            ---- actions ----
               ---- ActionRequest ----
                  ---- ContextID ----
                     {0000 0000}= 00h [000d] contextID
                  ---- commandsRequest ----
                     ---- CommandRequest ----
                        ---- Command ----
                           ---- serviceChangeRequest ----
                              ---- TerminationIDList ----
                                 ---- TerminationID ----
                                    ---- wildcard ----
                                       ---- WildcardField ----
                                       ---- WildcardField ----
                                          wildcardField: FF-FF-FF-FF-FF-FF-FF-FF- 00
                              ---- ServiceChangeParm ----
                                 ---- ServiceChangeMethod ----
                                    {0000 0011}= 03h [003d] ServiceChangeMethodrestart
                                 ---- ServiceChangeVersion ----
                                    {0000 0001}= 01h [001d] ServiceChangeVersion
                                 ---- Value ----
                                    value: 16-0D-39-30-31-20-43-6F- 6C-64-20-42-6F-6F-74

  Is it correct ? 
  Can any one help me in this.

Thanks,
Kumar

---

From: Troy Cauble <[email-masked]>
Date: Mon, 09 Feb 2004 14:05:42 -0500

>   Can any one help me in this.

I have two guesses.

It's been too long since I looked at BER internals,
but looking at the last part of your output.

 >         ---- Value ----
 >       value: 16-0D-39-30-31-20-43-6F-6C-64-20-42-6F-6F-74
 >
                       9  0  1 sp  C  o  l  d sp  B  o  o  t

16-0D is the tag-len for an IA5String.

Also, judging from the structured output of your call analyzer,
it appears that it found the positional OCTET-STRING tag-len
that proceeds the one for the IA5String.

So one GUESS is that your call analyzer is broken/obsolete.
H.248 was out for some time before the serviceChangeReason was
clarified via an IG to be double wrapped.  Actually, it's not
decoding anything wrong, it's just not decoding it fully.

 >   04 0F 16 0D 39 30 31 20  43 6F 6C 64 20 42 6F 6F 74

04-0F should be the tag-len for the OCTET STRING.  0F is
the correct len.  04 appears to be an incorrect or paritial
tag.  The tag should be 0x8004 before encoding.  0x8000
comes from it being a context specific class (not universal).
The 0x8004 gets encoded into a multibyte form and comes out

	11 04 0f 16 0d 39 ...

-troy

_______________________________________________
Megaco mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/megaco

---

From: Troy Cauble <[email-masked]>
Date: Mon, 09 Feb 2004 14:05:42 -0500

I have two guesses.

	11 04 0f 16 0d 39 ...

-troy

---

From: Troy Cauble <[email-masked]>
Date: Wed, 11 Feb 2004 09:11:13 -0500

Troy Cauble wrote:
> kumaraswamy Uppu wrote:
> 
>> Hi All,
>>   I have a query about BER encoding of serviceChangeReason Parameter. 
>> As per rfc 3525 , this string is first BER-encoded as an IA5String.
>>   04 0F 16 0D 39 30 31 20  43 6F 6C 64 20 42 6F 6F 74   First I 
>> encoded it as IA5 string (16 0D 39 30 31 20  43 6F 6C 64 20 42 6F 6F 
>> 74) and then the result I encoded it as OctetString.
>>   Is it correct ?   Can any one help me in this.
>>
> 
> I have two guesses.
> 

On review, my second guess is wrong. 04-0F is the correct
tag-len for the octet string.  It is not a context specific
class.

The context specific class is the Value level which requires
another tag-len encoding.  So the whole scReason would be

	a4 11 04 0f 16 0d 39 ...

-troy

---

From: Troy Cauble <[email-masked]>
Date: Wed, 11 Feb 2004 09:11:13 -0500

a4 11 04 0f 16 0d 39 ...

-troy