Megaco woes with ServiceChangeReason = ReasonToken EQUAL VALUE

Peter-Henry Mander erlang@REDACTED
Tue Feb 4 18:53:54 CET 2003


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





More information about the erlang-questions mailing list