MeGaCo PropertyParm formatting question

Peter-Henry Mander erlang@REDACTED
Wed Aug 21 12:12:19 CEST 2002


Hello everyone,

I've learnt and been using Erlang over the last couple of weeks to build 
a Gateway Emulator for testing purposes. So far it's been a successful 
project, with good results in staggeringly little time. But now I'm 
stuck and need some help, and I hope you'll forgive me if the answer is 
obvious.

I'm having trouble when trying to construct a PropertyParm record. Up to 
now, all I needed to do was understand the ASN.1 specs and simply 
transfer that into records, and it all worked. Maybe I've misunderstood 
the ASN.1 for PropertyParm, or got the wrong idea about the 
corresponding record in Erlang.

Here's the ASN.1:
PropertyParm ::= SEQUENCE
{
         name                    PkgdName,
         value                   SEQUENCE OF OCTET STRING,
         extraInfo               CHOICE
         {
                 relation        Relation,
                 range           BOOLEAN,
                 sublist         BOOLEAN
         } OPTIONAL,
         ...
}

And here's the offending code:
	PropParm = #'PropertyParm'{
		name = Name,
		value = Values,
% 
	extraInfo = {sublist, true}
% 
	extraInfo = {range, true}
% 
	extraInfo = {relation, greaterThan}
	},

My understanding is this:
Without extraInfo (since it's optional) using:

Name = "aName"
Value = "aValue"

should work, which it does. But when extraInfo = {range, true} I should 
supply exactly two values, so I assume that I should use:

Name = "aName"
Value = ["lower", "upper"]

but it doesn't work, and I get:

{error,
{
{badmatch,[[97,86,97,108,117,101],[117,112,112,101,114]]},
[
	{megaco_pretty_text_encoder,enc_PropertyGroupParm,2},
	{megaco_pretty_text_encoder,'-enc_PropertyGroup/3-lc^0/1-0-',2},
	{megaco_pretty_text_encoder,enc_PropertyGroup,3},
	{megaco_pretty_text_encoder,enc_LocalRemoteDescriptor,2},
	{megaco_pretty_text_encoder,enc_localDescriptor,2},
	{megaco_pretty_text_encoder,do_enc_list,5},
	{megaco_pretty_text_encoder,enc_list,4},
	{megaco_pretty_text_encoder,enc_MediaDescriptor,2}|more
]}}

So what do I need to do for each case of extraInfo?

Pete.





More information about the erlang-questions mailing list