ASN.1 decoding problems with H.323

Bertil Karlsson bertil.karlsson@REDACTED
Mon May 21 19:05:36 CEST 2001


Bruce Fitzsimons wrote:
> 
> Hello again,
> 
> I am having problems with the ASN.1 per decoding in R7B. If you are familiar
> with H323 then this is specifically when the endpointAlias field of the
> Gatekeeper contains an E164 alias. It works fine with H323 aliases, but
> consistently fails if there is an E164 (telephone number). This is from
> several different clients on the sending side, so I don't believe that the
> source encoding is faulty.
> 
> If someone could give me an hints on debugging the ASN.1 decoding it would
> be appreciated. I'm going to start reverse-engineering what its doing
> internally...
> 
> The decoding failed with reason {function_clause,
>                                     [{asn1rt_per_v1,getbit1,[{0,[]}]},
>                                      {asn1rt_per_v1,getbits,3},
>                                      {asn1rt_per_v1,chars_decode2,5},
>                                      {'H323-MESSAGES',dec_AliasAddress,2},
>                                      {'H323-MESSAGES',
> 
> dec_GatekeeperRequest_endpointAlias_components,
>                                          4},
> 
> {'H323-MESSAGES',dec_GatekeeperRequest,2},
>                                      {'H323-MESSAGES',dec_RasMessage,2},
>                                      {asn1rt,decode,3}|
>                                      more]}
Hello,

I did the following in R7B, and it seems to work fine:
> erlc -bper H323-MESSAGES.asn
> erl
Erlang (BEAM) emulator version 5.0.2.4 [threads]

Eshell V5.0.2.4  (abort with ^G)
1> GR =
{'GatekeeperRequest',11111,{1,2,3},asn1_NOVALUE,{'TransportAddress',{ipAddress,[[17,13,19,20],5555]}},{'EndpointType',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,true,false},asn1_NOVALUE,asn1_NOVALUE,[{e164,[35,48,49,50,51,52,53,54,55,56,57,42,44]}],asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}.
{'GatekeeperRequest',11111,
                     {1,2,3},
                     asn1_NOVALUE,
                    
{'TransportAddress',{ipAddress,[[17,13,19,20],5555]}},
                     {'EndpointType',asn1_NOVALUE,
                                     asn1_NOVALUE,
                                     asn1_NOVALUE,
                                     asn1_NOVALUE,
                                     asn1_NOVALUE,
                                     asn1_NOVALUE,
                                     true,
                                     false},
                     asn1_NOVALUE,
                     asn1_NOVALUE,
                     [{e164,"#0123456789*,"}],
                     asn1_NOVALUE,
                     asn1_NOVALUE,
                     asn1_NOVALUE,
                     asn1_NOVALUE,
                     asn1_NOVALUE,
                     asn1_NOVALUE,
                     asn1_NOVALUE}
2> asn1rt:encode('H323-MESSAGES','GatekeeperRequest',GR).
{ok,[8,43,102,2,42,3,0,17,13,19,20,21,179,1,0,1,6,0,3,69,103,137,171,193,32]}
3>
asn1rt:decode('H323-MESSAGES','GatekeeperRequest',[8,43,102,2,42,3,0,17,13,19,20,21,179,1,0,1,6,0,3,69,103,137,171,193,32]).
{ok,{'GatekeeperRequest',11111,
                         {1,2,3},
                         asn1_NOVALUE,
                         {ipAddress,{'TransportAddress_ipAddress',
                                        [17,13,19,20],
                                        5555}},
                         {'EndpointType',
                             asn1_NOVALUE,
                             asn1_NOVALUE,
                             asn1_NOVALUE,
                             asn1_NOVALUE,
                             asn1_NOVALUE,
                             asn1_NOVALUE,
                             true,
                             false},
                         asn1_NOVALUE,
                         asn1_NOVALUE,
                         [{e164,"#0123456789*,"}],
                         asn1_NOVALUE,
                         asn1_NOVALUE,
                         asn1_NOVALUE,
                         asn1_NOVALUE,
                         asn1_NOVALUE,
                         asn1_NOVALUE,
                         asn1_NOVALUE}}

Maybe is not my encoding values enough realistic?

I have not done any tests on an unpatched R7B. The version I have used
includes an update of the ASN.1 compiler, which will be released as open
source in about a week. If you have an Erlang licens it is available for
download.


> PS Is there any plans for a per_bin option?
Yes, we are developing a verion that uses the bit syntax. The plan is to
include it in R8.

Regards,
Bertil

-- 
  ------------------------
  Bertil Karlsson

  Ericsson Utvecklings AB
  Box 1505
  SE-125 25 Älvsjö
  SWEDEN

  Phone: +46 8 727 3927
  ------------------------



More information about the erlang-questions mailing list