Megaco woes with ServiceChangeReason = ReasonToken EQUAL VALUE

Micael Karlberg micael.karlberg@REDACTED
Wed Feb 5 08:02:05 CET 2003


Hi,

I would like to see your erlang message, because when I try,
it works just fine. Here's an example:

Erlang megaco (service change) message
{'MegacoMessage',asn1_NOVALUE,
                 {'Message',1,
                            {ip4Address,{'IP4Address',"|||Þ",asn1_NOVALUE}},
                            {transactions,
                                [{transactionRequest,
                                     {'TransactionRequest',
                                         9998,
                                         [{'ActionRequest',
                                              0,
                                              asn1_NOVALUE,
                                              asn1_NOVALUE,
                                              [{'CommandRequest',
                                                   {serviceChangeReq,
                                                       {'ServiceChangeRequest',
                                                           [{megaco_term_id,
                                                                false,
                                                                ["root"]}],
                                                           {'ServiceChangeParm',                                                               restart,
                                                               {portNumber,
                                                                   55555},
                                                               asn1_NOVALUE,
                                                               {'ServiceChangeProfile',
                                                                   "resgw",
                                                                   1},
                                                               ["901 mg col boot"],
                                                               asn1_NOVALUE,
                                                               asn1_NOVALUE,
                                                               asn1_NOVALUE,
                                                               asn1_NOVALUE}}},
                                                   asn1_NOVALUE,
                                                   asn1_NOVALUE}]}]}}]}}}

And this is what it looks like pretty-encoded:

MEGACO/1 [124.124.124.222]
Transaction = 9998 {
	Context = - {
		ServiceChange = root {
			Services {
				Method = Restart,
				ServiceChangeAddress = 55555,
				Profile = resgw/1,
				Reason = "901 mg col boot"
			}
		}
	}
}

And this is what it looks like compact-encoded:

!/1 [124.124.124.222]
T=9998{C=-{SC=root{SV{MT=RS,AD=55555,PF=resgw/1,RE="901 mg col boot"}}}}


Regards,
	/BMK

Peter-Henry Mander writes:
 > Good evening Erlang Megaco gurus,
 > 
 > I have a question concerning the interpretation of the 
 > serviceChangeReason ABNF description (versions one and two *), which 
 > quotes (**):
 > 
 >    ; A serviceChangeReason consists of a numeric reason code
 >    ; and an optional text description.
 >    ; A serviceChangeReason MUST be encoded using the quotedString  
 >    ; form of VALUE.
 >    ; The quotedString SHALL contain a decimal reason code,
 >    ; optionally followed by a single space character and a  
 >    ; textual description string.                       
 > 
 >    serviceChangeReason  = ReasonToken  EQUAL VALUE
 > 
 > ... and a little further down we have (***):
 > 
 >    VALUE                = quotedString / 1*(SafeChar)
 > 
 > The Erlang Megaco implementation follows the VALUE spec, not the 
 > quotedString requirement as described in the comment. i.e.
 > 
 > MEGACO/1 [10.1.0.200]:2944
 > Transaction = 1 {
 >     Context = - {
 >         ServiceChange = root {
 >             Services {
 >                 Method = Restart,
 >                 Version = 2,
 >                 Reason = 901   <-------  1*(SafeChar)
 >             }
 >         }
 >     }
 > }
 > 
 > -OR-
 > 
 > MEGACO/1 [10.1.0.200]:2944
 > Transaction = 1 {
 >     Context = - {
 >         ServiceChange = root {
 >             Services {
 >                 Method = Restart,
 >                 Version = 2,
 >                 Reason = "901 Cold Boot"  <------- quotedString
 >             }
 >         }
 >     }
 > }
 > 
 > But if the comments are followed to the letter (and I understood 
 > correctly) the Reason should be quoted every time, thus:
 > 
 > MEGACO/1 [10.1.0.200]:2944
 > Transaction = 1 {
 >     Context = - {
 >         ServiceChange = root {
 >             Services {
 >                 Method = Restart,
 >                 Version = 2,
 >                 Reason = "901"  <------- quotedString even when 
 > 1*(SafeChar) matches.
 >             }
 >         }
 >     }
 > }
 > 
 > Erlang Megaco is technically correct if the ABNF is stripped of comments 
 > (which is what happens when building the Erlang Megaco stack from the 
 > spec, the ABNF/ASN.1 compiler won't read comments, or am I 
 > underestimating Erlang? :-). It looks as if those knowledgable fellows 
 > of the IETF should have specified:
 > 
 > serviceChangeReason = ReasonToken  EQUAL quotedString (instead of VALUE)
 > 
 > Am I correct? How do I force Erlang Megaco to _always_ send 
 > quotedString, not just when there are unSafeChars in the string? Is it 
 > strictly necessary to enforce quotedString?
 > 
 > Help!
 > 
 > Pete.
 > 
 > * Versions 1.03 as in draft-ietf-megaco-3015corr-03.txt and 2.03 as in 
 > draft-ietf-megaco-h248v2-03.txt
 > 
 > ** line 6557 in v1.03 and line 7275 in v2.03
 > 
 > *** line 6623 in v1.03 and 7531in v2.03
 > 

-- 
Micael Karlberg          Ericsson AB, Älvsjö Sweden
Tel:  +46 8 727 5668     EAB/UHK/KD - OTP Product Development
ECN:  851 5668           Mail: micael.karlberg@REDACTED
Fax:  +46 8 727 5775    



More information about the erlang-questions mailing list