Tech-invite3GPPspaceIETFspace
96959493929190898887868584838281807978777675747372717069686766656463626160595857565554535251504948474645444342414039383736353433323130292827262524232221201918171615141312111009080706050403020100
in Index   Prev   Next

RFC 3525

Gateway Control Protocol Version 1

Pages: 213
Obsoletes:  3015
Obsoleted by:  5125
Part 4 of 7 – Pages 90 to 127
First   Prev   Next

ToP   noToC   RFC3525 - Page 90   prevText

ANNEX A - Binary encoding of the protocol

This annex specifies the syntax of messages using the notation defined in Recommendation X.680; Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation. Messages shall be encoded for transmission by applying the basic encoding rules specified in Recommendation X.690, Information Technology - ASN.1 Encoding Rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules.

A.1 Coding of wildcards

The use of wildcards ALL and CHOOSE is allowed in the protocol. This allows a MGC to partially specify Termination IDs and to let the MG choose from the values that conform to the partial specification. Termination IDs may encode a hierarchy of names. This hierarchy is provisioned. For instance, a TerminationID may consist of a trunk group, a trunk within the group and a circuit. Wildcarding must be possible at all levels. The following paragraphs explain how this is achieved. The ASN.1 description uses octet strings of up to 8 octets in length for Termination IDs. This means that Termination IDs consist of at most 64 bits. A fully specified Termination ID may be preceded by a sequence of wildcarding fields. A wildcarding field is one octet in length. Bit 7 (the most significant bit) of this octet specifies what type of wildcarding is invoked: if the bit value equals 1, then the ALL wildcard is used; if the bit value if 0, then the CHOOSE wildcard is used. Bit 6 of the wildcarding field specifies whether the wildcarding pertains to one level in the hierarchical naming scheme (bit value 0) or to the level of the hierarchy specified in the wildcarding field plus all lower levels (bit value 1). Bits 0 through 5 of the wildcarding field specify the bit position in the Termination ID at which the wildcarding starts. We illustrate this scheme with some examples. In these examples, the most significant bit in a string of bits appears on the left hand side. Assume that Termination IDs are three octets long and that each octet represents a level in a hierarchical naming scheme. A valid Termination ID is: 00000001 00011110 01010101.
ToP   noToC   RFC3525 - Page 91
   Addressing ALL names with prefix 00000001 00011110 is done as
   follows:

      wildcarding field: 10000111

      Termination ID: 00000001 00011110 xxxxxxxx.

   The values of the bits labeled "x" is irrelevant and shall be ignored
   by the receiver.

   Indicating to the receiver that it must choose a name with 00011110
   as the second octet is done as follows:

      wildcarding fields: 00010111 followed by 00000111

      Termination ID: xxxxxxxx 00011110 xxxxxxxx.

   The first wildcard field indicates a CHOOSE wildcard for the level in
   the naming hierarchy starting at bit 23, the highest level in our
   assumed naming scheme.  The second wildcard field indicates a CHOOSE
   wildcard for the level in the naming hierarchy starting at bit 7, the
   lowest level in our assumed naming scheme.

   Finally, a CHOOSE-wildcarded name with the highest level of the name
   equal to 00000001 is specified as follows:

      wildcard field: 01001111

      Termination ID: 0000001 xxxxxxxx xxxxxxxx .

   Bit value 1 at bit position 6 of the first octet of the wildcard
   field indicates that the wildcarding pertains to the specified level
   in the naming hierarchy and all lower levels.

   Context IDs may also be wildcarded.  In the case of Context IDs,
   however, specifying partial names is not allowed.  Context ID 0x0
   SHALL be used to indicate the NULL Context, Context ID 0xFFFFFFFE
   SHALL be used to indicate a CHOOSE wildcard, and Context ID
   0xFFFFFFFF SHALL be used to indicate an ALL wildcard.

   TerminationID 0xFFFFFFFFFFFFFFFF SHALL be used to indicate the ROOT
   Termination.
ToP   noToC   RFC3525 - Page 92

A.2 ASN.1 syntax specification

This subclause contains the ASN.1 specification of the H.248.1 protocol syntax. NOTE 1 - In case a transport mechanism is used that employs application level framing, the definition of Transaction below changes. Refer to the annex or to the Recommendation of the H.248 sub-series defining the transport mechanism for the definition that applies in that case. NOTE 2 - The ASN.1 specification below contains a clause defining TerminationIDList as a sequence of TerminationIDs. The length of this sequence SHALL be one, except possibly when used in contextAuditResult. NOTE 3 - This syntax specification does not enforce all restrictions on element inclusions and values. Some additional restrictions are stated in comments and other restrictions appear in the text of this RFC. These additional restrictions are part of the protocol even though not enforced by this specification. NOTE 4 - The ASN.1 module in this Annex uses octet string types to encode values for property parameter, signal parameter and event parameter values and statistics. The actual types of these values vary and are specified in Annex C or the relevant package definition. A value is first BER-encoded based on its type using the table below. The result of this BER-encoding is then encoded as an ASN.1 octet string, "double wrapping" the value. The format specified in Annex C or the package relates to BER encoding according to the following table: Type Specified in Package ASN.1 BER Type String IA5String or UTF8String (Note 4) Integer (4 Octet) INTEGER Double (8 octet signed int) INTEGER (Note 3) Character (UTF-8, Note 1) IA5String Enumeration ENUMERATED Boolean BOOLEAN
ToP   noToC   RFC3525 - Page 93
   Unsigned Integer (Note 2)   INTEGER  (Note 3)

   Octet (String)              OCTET STRING

     Note 1: Can be more than one byte

     Note 2: Unsigned integer is referenced in Annex C

     Note 3: The BER encoding of INTEGER does not imply the use of 4
     bytes.

     Note 4: String should be encoded as IA5String when the contents
     are all ASCII characters, but as UTF8String if it contains any
     Non-ASCII characters.

   See ITU-T Rec.  X.690, 8.7, for the definition of the encoding of an
   octet string value.

   MEDIA-GATEWAY-CONTROL DEFINITIONS AUTOMATIC TAGS::=
   BEGIN

   MegacoMessage ::= SEQUENCE
   {
      authHeader     AuthenticationHeader OPTIONAL,
      mess           Message
   }

   AuthenticationHeader ::= SEQUENCE
   {
      secParmIndex   SecurityParmIndex,
      seqNum         SequenceNum,
      ad             AuthData
   }

   SecurityParmIndex ::= OCTET STRING(SIZE(4))

   SequenceNum       ::= OCTET STRING(SIZE(4))

   AuthData          ::= OCTET STRING (SIZE (12..32))

   Message ::= SEQUENCE
   {
      version           INTEGER(0..99),
      -- The version of the protocol defined here is equal to 1.
      mId               MId,  -- Name/address of message originator
      messageBody       CHOICE
      {
         messageError      ErrorDescriptor,
ToP   noToC   RFC3525 - Page 94
         transactions      SEQUENCE OF Transaction
      },
      ...
   }

   MId ::= CHOICE
   {
      ip4Address           IP4Address,
      ip6Address           IP6Address,
      domainName           DomainName,
      deviceName           PathName,
      mtpAddress           OCTET STRING(SIZE(2..4)),
      -- Addressing structure of mtpAddress:
      --     25 - 15           0
      --        |  PC        | NI |
      --      24 - 14 bits    2 bits
      -- Note: 14 bits are defined for international use.
      -- Two national options exist where the point code is 16 or 24
      -- bits.
      -- To octet align the mtpAddress, the MSBs shall be encoded as 0s.
             ...
   }

   DomainName ::= SEQUENCE
   {
      name        IA5String,
      -- The name starts with an alphanumeric digit followed by a
      -- sequence of alphanumeric digits, hyphens and dots.  No two
      -- dots shall occur consecutively.
      portNumber     INTEGER(0..65535) OPTIONAL
   }

   IP4Address ::= SEQUENCE
   {
      address        OCTET STRING (SIZE(4)),
      portNumber     INTEGER(0..65535) OPTIONAL
   }

   IP6Address ::= SEQUENCE
   {
      address        OCTET STRING (SIZE(16)),
      portNumber     INTEGER(0..65535) OPTIONAL
   }

   PathName ::= IA5String(SIZE (1..64))
   -- See A.3

   Transaction ::= CHOICE
ToP   noToC   RFC3525 - Page 95
   {
      transactionRequest   TransactionRequest,
      transactionPending   TransactionPending,
      transactionReply     TransactionReply,
      transactionResponseAck  TransactionResponseAck,
          -- use of response acks is dependent on underlying transport
      ...
   }

   TransactionId ::= INTEGER(0..4294967295)  -- 32-bit unsigned integer

   TransactionRequest ::= SEQUENCE
   {
      transactionId        TransactionId,
      actions              SEQUENCE OF ActionRequest,
      ...
   }

   TransactionPending ::= SEQUENCE
   {
      transactionId        TransactionId,
      ...
   }

   TransactionReply ::= SEQUENCE
   {
      transactionId        TransactionId,
      immAckRequired       NULL OPTIONAL,
      transactionResult    CHOICE
      {
           transactionError   ErrorDescriptor,
           actionReplies      SEQUENCE OF ActionReply
      },
      ...
   }

   TransactionResponseAck ::= SEQUENCE OF TransactionAck
   TransactionAck ::= SEQUENCE
   {
      firstAck       TransactionId,
      lastAck        TransactionId OPTIONAL
   }

   ErrorDescriptor ::= SEQUENCE
   {
      errorCode      ErrorCode,
      errorText      ErrorText OPTIONAL
   }
ToP   noToC   RFC3525 - Page 96
   ErrorCode ::= INTEGER(0..65535)
   -- See clause 13 for IANA Considerations with respect to error codes

   ErrorText ::= IA5String

   ContextID ::= INTEGER(0..4294967295)

   -- Context   NULL Value: 0
   -- Context CHOOSE Value: 4294967294 (0xFFFFFFFE)
   -- Context    ALL Value: 4294967295 (0xFFFFFFFF)


   ActionRequest ::= SEQUENCE
   {
      contextId         ContextID,
      contextRequest       ContextRequest OPTIONAL,
      contextAttrAuditReq  ContextAttrAuditRequest OPTIONAL,
      commandRequests   SEQUENCE OF CommandRequest
   }

   ActionReply ::= SEQUENCE
   {
      contextId         ContextID,
      errorDescriptor   ErrorDescriptor OPTIONAL,
      contextReply      ContextRequest OPTIONAL,
      commandReply      SEQUENCE OF CommandReply
   }

   ContextRequest ::= SEQUENCE
   {
      priority       INTEGER(0..15) OPTIONAL,
      emergency      BOOLEAN OPTIONAL,
      topologyReq    SEQUENCE OF TopologyRequest OPTIONAL,
      ...
   }

   ContextAttrAuditRequest ::= SEQUENCE
   {
      topology    NULL OPTIONAL,
      emergency   NULL OPTIONAL,
      priority    NULL OPTIONAL,
      ...
   }

   CommandRequest ::= SEQUENCE
   {
      command           Command,
ToP   noToC   RFC3525 - Page 97
      optional          NULL OPTIONAL,
      wildcardReturn    NULL OPTIONAL,
      ...
   }

   Command ::= CHOICE
   {
      addReq               AmmRequest,
      moveReq              AmmRequest,
      modReq               AmmRequest,
      -- Add, Move, Modify requests have the same parameters
      subtractReq          SubtractRequest,
      auditCapRequest      AuditRequest,
      auditValueRequest    AuditRequest,
      notifyReq            NotifyRequest,
      serviceChangeReq     ServiceChangeRequest,
      ...
   }

   CommandReply ::= CHOICE
   {
      addReply                AmmsReply,
      moveReply               AmmsReply,
      modReply                AmmsReply,
      subtractReply           AmmsReply,
      -- Add, Move, Modify, Subtract replies have the same parameters
      auditCapReply           AuditReply,
      auditValueReply         AuditReply,
      notifyReply             NotifyReply,
      serviceChangeReply      ServiceChangeReply,
      ...
   }

   TopologyRequest ::= SEQUENCE
   {
      terminationFrom         TerminationID,
      terminationTo           TerminationID,
      topologyDirection       ENUMERATED
      {
         bothway(0),
         isolate(1),
         oneway(2)
      },
      ...
   }

   AmmRequest ::= SEQUENCE
   {
ToP   noToC   RFC3525 - Page 98
      terminationID        TerminationIDList,
      descriptors          SEQUENCE OF AmmDescriptor,
      -- At most one descriptor of each type (see AmmDescriptor)
      -- allowed in the sequence.
      ...
   }

   AmmDescriptor ::= CHOICE
   {
      mediaDescriptor         MediaDescriptor,
      modemDescriptor         ModemDescriptor,
      muxDescriptor           MuxDescriptor,
      eventsDescriptor        EventsDescriptor,
      eventBufferDescriptor   EventBufferDescriptor,
      signalsDescriptor       SignalsDescriptor,
      digitMapDescriptor      DigitMapDescriptor,
      auditDescriptor         AuditDescriptor,
      ...
   }

   AmmsReply ::= SEQUENCE
   {
      terminationID        TerminationIDList,
      terminationAudit     TerminationAudit OPTIONAL,
      ...
   }

   SubtractRequest ::= SEQUENCE
   {
      terminationID        TerminationIDList,
      auditDescriptor      AuditDescriptor OPTIONAL,
      ...
   }

   AuditRequest ::= SEQUENCE
   {
      terminationID        TerminationID,
      auditDescriptor      AuditDescriptor,
      ...
   }

   AuditReply ::= CHOICE
   {
      contextAuditResult   TerminationIDList,
      error                ErrorDescriptor,
      auditResult          AuditResult,
      ...
   }
ToP   noToC   RFC3525 - Page 99
   AuditResult ::= SEQUENCE
   {

      terminationID           TerminationID,
      terminationAuditResult  TerminationAudit
   }

   TerminationAudit ::= SEQUENCE OF AuditReturnParameter

   AuditReturnParameter ::= CHOICE
   {
      errorDescriptor         ErrorDescriptor,
      mediaDescriptor         MediaDescriptor,
      modemDescriptor         ModemDescriptor,
      muxDescriptor           MuxDescriptor,
      eventsDescriptor        EventsDescriptor,
      eventBufferDescriptor   EventBufferDescriptor,
      signalsDescriptor       SignalsDescriptor,
      digitMapDescriptor      DigitMapDescriptor,
      observedEventsDescriptor   ObservedEventsDescriptor,
      statisticsDescriptor    StatisticsDescriptor,
      packagesDescriptor      PackagesDescriptor,
      emptyDescriptors        AuditDescriptor,
      ...
   }

   AuditDescriptor ::= SEQUENCE
   {
      auditToken  BIT STRING
         {
            muxToken(0), modemToken(1), mediaToken(2),
            eventsToken(3), signalsToken(4),
            digitMapToken(5), statsToken(6),
            observedEventsToken(7),
            packagesToken(8), eventBufferToken(9)
         } OPTIONAL,
      ...
   }

   NotifyRequest ::= SEQUENCE
   {
      terminationID              TerminationIDList,
      observedEventsDescriptor   ObservedEventsDescriptor,
      errorDescriptor            ErrorDescriptor OPTIONAL,
      ...
   }
ToP   noToC   RFC3525 - Page 100
   NotifyReply ::= SEQUENCE
   {
      terminationID           TerminationIDList,
      errorDescriptor         ErrorDescriptor OPTIONAL,
      ...
   }

   ObservedEventsDescriptor ::= SEQUENCE
   {
      requestId               RequestID,
      observedEventLst        SEQUENCE OF ObservedEvent
   }

   ObservedEvent ::= SEQUENCE
   {
      eventName            EventName,
      streamID             StreamID OPTIONAL,
      eventParList         SEQUENCE OF EventParameter,
      timeNotation         TimeNotation OPTIONAL,
      ...
   }

   EventName ::= PkgdName

   EventParameter ::= SEQUENCE
   {
      eventParameterName      Name,
      value                   Value,
   -- For use of extraInfo see the comment related to PropertyParm
      extraInfo CHOICE
      {
         relation Relation,
         range    BOOLEAN,
         sublist  BOOLEAN
      } OPTIONAL,
      ...
   }

   ServiceChangeRequest ::= SEQUENCE
   {
      terminationID           TerminationIDList,
      serviceChangeParms      ServiceChangeParm,
      ...
   }

   ServiceChangeReply ::= SEQUENCE
   {
      terminationID           TerminationIDList,
ToP   noToC   RFC3525 - Page 101
      serviceChangeResult     ServiceChangeResult,
      ...
   }

   -- For ServiceChangeResult, no parameters are mandatory.  Hence the
   -- distinction between ServiceChangeParm and ServiceChangeResParm.

   ServiceChangeResult ::= CHOICE
   {
      errorDescriptor            ErrorDescriptor,
      serviceChangeResParms      ServiceChangeResParm
   }

   WildcardField ::= OCTET STRING(SIZE(1))

   TerminationID ::= SEQUENCE
   {
      wildcard SEQUENCE OF WildcardField,
      id    OCTET STRING(SIZE(1..8)),
      ...
   }
   -- See A.1 for explanation of wildcarding mechanism.
   -- Termination ID 0xFFFFFFFFFFFFFFFF indicates the ROOT Termination.

   TerminationIDList ::= SEQUENCE OF TerminationID

   MediaDescriptor ::= SEQUENCE
   {

      termStateDescr TerminationStateDescriptor OPTIONAL,
      streams     CHOICE
      {
         oneStream      StreamParms,
         multiStream    SEQUENCE OF StreamDescriptor
      } OPTIONAL,
      ...
   }

   StreamDescriptor ::= SEQUENCE
   {
      streamID          StreamID,
      streamParms       StreamParms
   }

   StreamParms ::= SEQUENCE
   {
      localControlDescriptor     LocalControlDescriptor OPTIONAL,
      localDescriptor            LocalRemoteDescriptor OPTIONAL,
ToP   noToC   RFC3525 - Page 102
      remoteDescriptor           LocalRemoteDescriptor OPTIONAL,
      ...
   }

   LocalControlDescriptor ::= SEQUENCE
   {

      streamMode        StreamMode OPTIONAL,
      reserveValue      BOOLEAN OPTIONAL,
      reserveGroup      BOOLEAN OPTIONAL,
      propertyParms     SEQUENCE OF PropertyParm,
      ...
   }

   StreamMode ::= ENUMERATED
   {
      sendOnly(0),
      recvOnly(1),
      sendRecv(2),
      inactive(3),
      loopBack(4),
         ...
   }

   -- In PropertyParm, value is a SEQUENCE OF octet string.  When sent
   -- by an MGC the interpretation is as follows:
   -- empty sequence means CHOOSE
   -- one element sequence specifies value
   -- If the sublist field is not selected, a longer sequence means
   -- "choose one of the values" (i.e., value1 OR value2 OR ...)
   -- If the sublist field is selected,
   -- a sequence with more than one element encodes the value of a
   -- list-valued property (i.e., value1 AND value2 AND ...).
   -- The relation field may only be selected if the value sequence
   -- has length 1.  It indicates that the MG has to choose a value
   -- for the property.  E.g., x > 3 (using the greaterThan
   -- value for relation) instructs the MG to choose any value larger
   -- than 3 for property x.
   -- The range field may only be selected if the value sequence
   -- has length 2.  It indicates that the MG has to choose a value
   -- in the range between the first octet in the value sequence and
   -- the trailing octet in the value sequence, including the
   -- boundary values.
   -- When sent by the MG, only responses to an AuditCapability request
   -- may contain multiple values, a range, or a relation field.

   PropertyParm ::= SEQUENCE
   {
ToP   noToC   RFC3525 - Page 103
      name        PkgdName,
      value       SEQUENCE OF OCTET STRING,
      extraInfo   CHOICE
      {
         relation    Relation,
         range       BOOLEAN,
         sublist     BOOLEAN
      } OPTIONAL,
      ...
   }

   Name ::= OCTET STRING(SIZE(2))

   PkgdName ::= OCTET STRING(SIZE(4))
   -- represents Package Name (2 octets) plus Property, Event,
   -- Signal Names or Statistics ID. (2 octets)
   -- To wildcard a package use 0xFFFF for first two octets, choose
   -- is not allowed.  To reference native property tag specified in
   -- Annex C, use 0x0000 as first two octets.
   -- To wildcard a Property, Event, Signal, or Statistics ID, use
   -- 0xFFFF for last two octets, choose is not allowed.
   -- Wildcarding of Package Name is permitted only if Property,
   -- Event, Signal, or Statistics ID are
   -- also wildcarded.

   Relation ::= ENUMERATED
   {
      greaterThan(0),
      smallerThan(1),
      unequalTo(2),
      ...
   }

   LocalRemoteDescriptor ::= SEQUENCE
   {
      propGrps SEQUENCE OF PropertyGroup,
      ...
   }

   PropertyGroup ::= SEQUENCE OF PropertyParm

   TerminationStateDescriptor ::= SEQUENCE
   {
      propertyParms        SEQUENCE OF PropertyParm,
      eventBufferControl   EventBufferControl OPTIONAL,
      serviceState         ServiceState OPTIONAL,
      ...
   }
ToP   noToC   RFC3525 - Page 104
   EventBufferControl ::= ENUMERATED
   {
      off(0),
      lockStep(1),
      ...
   }

   ServiceState ::= ENUMERATED

   {
      test(0),
      outOfSvc(1),
      inSvc(2),
         ...
   }

   MuxDescriptor   ::= SEQUENCE
   {
      muxType           MuxType,
      termList          SEQUENCE OF TerminationID,
      nonStandardData   NonStandardData OPTIONAL,
      ...
   }

   MuxType ::= ENUMERATED
   {
      h221(0),
      h223(1),
      h226(2),
      v76(3),
      ...
   }

   StreamID ::= INTEGER(0..65535)   -- 16-bit unsigned integer

   EventsDescriptor ::= SEQUENCE
   {
      requestID      RequestID OPTIONAL,
                  -- RequestID must be present if eventList
                  -- is non empty
      eventList      SEQUENCE OF RequestedEvent,
      ...
   }

   RequestedEvent ::= SEQUENCE
   {
      pkgdName       PkgdName,
ToP   noToC   RFC3525 - Page 105
      streamID       StreamID OPTIONAL,
      eventAction    RequestedActions OPTIONAL,
      evParList      SEQUENCE OF EventParameter,
      ...
   }

   RequestedActions ::= SEQUENCE
   {
      keepActive        BOOLEAN OPTIONAL,
      eventDM           EventDM OPTIONAL,
      secondEvent          SecondEventsDescriptor OPTIONAL,
      signalsDescriptor    SignalsDescriptor OPTIONAL,
      ...
   }

   EventDM ::= CHOICE
   {  digitMapName   DigitMapName,
      digitMapValue  DigitMapValue
   }

   SecondEventsDescriptor ::= SEQUENCE
   {
      requestID         RequestID OPTIONAL,
      eventList         SEQUENCE OF SecondRequestedEvent,
      ...
   }

   SecondRequestedEvent ::= SEQUENCE
   {
      pkgdName          PkgdName,
      streamID          StreamID OPTIONAL,
      eventAction       SecondRequestedActions OPTIONAL,
      evParList         SEQUENCE OF EventParameter,
      ...
   }

   SecondRequestedActions ::= SEQUENCE
   {
      keepActive           BOOLEAN OPTIONAL,
      eventDM              EventDM OPTIONAL,
      signalsDescriptor    SignalsDescriptor OPTIONAL,
      ...
   }

   EventBufferDescriptor ::= SEQUENCE OF EventSpec

   EventSpec ::= SEQUENCE
   {
ToP   noToC   RFC3525 - Page 106
      eventName      EventName,
      streamID       StreamID OPTIONAL,
      eventParList   SEQUENCE OF EventParameter,
      ...
   }

   SignalsDescriptor ::= SEQUENCE OF SignalRequest

   SignalRequest ::=CHOICE
   {
      signal         Signal,
      seqSigList     SeqSigList,
      ...
   }

   SeqSigList ::= SEQUENCE
   {
      id                INTEGER(0..65535),
      signalList        SEQUENCE OF Signal
   }

   Signal ::= SEQUENCE
   {
      signalName        SignalName,
      streamID          StreamID OPTIONAL,
      sigType           SignalType OPTIONAL,
      duration          INTEGER (0..65535) OPTIONAL,
      notifyCompletion  NotifyCompletion OPTIONAL,
      keepActive        BOOLEAN OPTIONAL,
      sigParList        SEQUENCE OF SigParameter,
      ...
   }

   SignalType ::= ENUMERATED
   {
      brief(0),
      onOff(1),
      timeOut(2),
      ...
   }

   SignalName ::= PkgdName

   NotifyCompletion ::= BIT STRING
   {
      onTimeOut(0), onInterruptByEvent(1),
      onInterruptByNewSignalDescr(2), otherReason(3)
   }
ToP   noToC   RFC3525 - Page 107
   SigParameter ::= SEQUENCE
   {
      sigParameterName     Name,
      value                Value,
      -- For use of extraInfo see the comment related to PropertyParm
      extraInfo CHOICE
      {
         relation Relation,
         range    BOOLEAN,
         sublist  BOOLEAN

      } OPTIONAL,
      ...
   }

   -- For an AuditCapReply with all events, the RequestID SHALL be ALL.
   -- ALL is represented by 0xffffffff.

   RequestID ::= INTEGER(0..4294967295)   -- 32-bit unsigned integer

   ModemDescriptor ::= SEQUENCE
   {
      mtl               SEQUENCE OF ModemType,
      mpl               SEQUENCE OF PropertyParm,
      nonStandardData   NonStandardData OPTIONAL
   }

   ModemType ::= ENUMERATED
   {
      v18(0),
      v22(1),
      v22bis(2),
      v32(3),
      v32bis(4),
      v34(5),
      v90(6),
      v91(7),
      synchISDN(8),
      ...
   }

   DigitMapDescriptor ::= SEQUENCE
   {
      digitMapName   DigitMapName   OPTIONAL,
      digitMapValue  DigitMapValue  OPTIONAL
   }
ToP   noToC   RFC3525 - Page 108
   DigitMapName ::= Name

   DigitMapValue ::= SEQUENCE
   {
      startTimer     INTEGER(0..99) OPTIONAL,
      shortTimer     INTEGER(0..99) OPTIONAL,
      longTimer      INTEGER(0..99) OPTIONAL,
      digitMapBody      IA5String,
   -- Units are seconds for start, short and long timers, and
   -- hundreds of milliseconds for duration timer.  Thus start,
   -- short, and long range from 1 to 99 seconds and duration
   -- from 100 ms to 9.9 s
      -- See A.3 for explanation of digit map syntax
      ...
   }

   ServiceChangeParm ::= SEQUENCE
   {
      serviceChangeMethod     ServiceChangeMethod,
      serviceChangeAddress    ServiceChangeAddress OPTIONAL,
      serviceChangeVersion    INTEGER(0..99) OPTIONAL,
      serviceChangeProfile    ServiceChangeProfile OPTIONAL,
      serviceChangeReason     Value,
   -- A serviceChangeReason consists of a numeric reason code
   -- and an optional text description.
   -- The serviceChangeReason SHALL be a string consisting of
   -- a decimal reason code, optionally followed by a single
   -- space character and a textual description string.
   -- 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, "double wrapping" the
   -- value as was done for package elements.
      serviceChangeDelay      INTEGER(0..4294967295) OPTIONAL,
                                        -- 32-bit unsigned integer
      serviceChangeMgcId      MId OPTIONAL,
      timeStamp               TimeNotation OPTIONAL,
      nonStandardData         NonStandardData OPTIONAL,
      ...
   }

   ServiceChangeAddress ::= CHOICE
   {
      portNumber        INTEGER(0..65535),    -- TCP/UDP port number
      ip4Address        IP4Address,
      ip6Address        IP6Address,
      domainName        DomainName,
      deviceName        PathName,
      mtpAddress        OCTET STRING(SIZE(2..4)),
ToP   noToC   RFC3525 - Page 109
      ...
   }

   ServiceChangeResParm ::= SEQUENCE
   {
      serviceChangeMgcId      MId OPTIONAL,
      serviceChangeAddress    ServiceChangeAddress OPTIONAL,
      serviceChangeVersion    INTEGER(0..99) OPTIONAL,
      serviceChangeProfile    ServiceChangeProfile OPTIONAL,
      timestamp               TimeNotation OPTIONAL,
      ...
   }

   ServiceChangeMethod ::= ENUMERATED

   {
      failover(0),
      forced(1),
      graceful(2),
      restart(3),
      disconnected(4),
      handOff(5),
      ...
   }

   ServiceChangeProfile ::= SEQUENCE
   {
      profileName    IA5String(SIZE (1..67))
      -- 64 characters for name, 1 for "/", 2 for version to match ABNF
   }

   PackagesDescriptor ::= SEQUENCE OF PackagesItem

   PackagesItem ::= SEQUENCE
   {
      packageName       Name,
      packageVersion    INTEGER(0..99),
      ...
   }

   StatisticsDescriptor ::= SEQUENCE OF StatisticsParameter

   StatisticsParameter ::= SEQUENCE
   {
      statName       PkgdName,
      statValue      Value OPTIONAL
   }
ToP   noToC   RFC3525 - Page 110
   NonStandardData ::= SEQUENCE
   {
      nonStandardIdentifier   NonStandardIdentifier,
      data                    OCTET STRING
   }

   NonStandardIdentifier ::= CHOICE
   {
      object            OBJECT IDENTIFIER,
      h221NonStandard   H221NonStandard,
      experimental      IA5String(SIZE(8)),
          -- first two characters should be "X-" or "X+"
      ...
   }

   H221NonStandard ::= SEQUENCE
   {  t35CountryCode1   INTEGER(0..255),
      t35CountryCode2   INTEGER(0..255),      -- country, as per T.35
      t35Extension      INTEGER(0..255),      -- assigned nationally
      manufacturerCode     INTEGER(0..65535), -- assigned nationally
      ...
   }

   TimeNotation ::= SEQUENCE
   {
      date     IA5String(SIZE(8)),  -- yyyymmdd format
      time     IA5String(SIZE(8))   -- hhmmssss format
      -- per ISO 8601:1988
   }

   Value ::= SEQUENCE OF OCTET STRING

   END
ToP   noToC   RFC3525 - Page 111

A.3 Digit maps and path names

From a syntactic viewpoint, digit maps are strings with syntactic restrictions imposed upon them. The syntax of valid digit maps is specified in ABNF [RFC 2234]. The syntax for digit maps presented in this subclause is for illustrative purposes only. The definition of digitMap in Annex B takes precedence in the case of differences between the two. digitMap = (digitString / LWSP "(" LWSP digitStringList LWSP ")" LWSP) digitStringList = digitString *( LWSP "|" LWSP digitString ) digitString = 1*(digitStringElement) digitStringElement = digitPosition [DOT] digitPosition = digitMapLetter / digitMapRange digitMapRange = ("x" / (LWSP "[" LWSP digitLetter LWSP "]" LWSP)) digitLetter = *((DIGIT "-" DIGIT) /digitMapLetter) digitMapLetter = DIGIT ;digits 0-9 / %x41-4B / %x61-6B ;a-k and A-K / "L"/ "S" ;Inter-event timers ;(long, short) / "Z" ;Long duration event DOT = %x2E ; "." LWSP = *(WSP / COMMENT / EOL) WSP = SP / HTAB COMMENT = ";" *(SafeChar / RestChar / WSP) EOL EOL = (CR [LF]) / LF SP = %x20 HTAB = %x09 CR = %x0D LF = %x0A SafeChar = DIGIT / ALPHA / "+" / "-" / "&" / "!" / "_" / "/" / "'" / "?" / "@" / "^" / "`" / "~" / "*" / "$" / "\" / "(" / ")" / "%" / "." RestChar = ";" / "[" / "]" / "{" / "}" / ":" / "," / "#" / "<" / ">" / "=" / %x22 DIGIT = %x30-39 ; digits 0 through 9 ALPHA = %x41-5A / %x61-7A; A-Z, a-z A path name is also a string with syntactic restrictions imposed upon it. The ABNF production defining it is copied from Annex B. ; Total length of pathNAME must not exceed 64 chars. pathNAME = ["*"] NAME *("/" / "*"/ ALPHA / DIGIT /"_" / "$" ) ["@" pathDomainName ]
ToP   noToC   RFC3525 - Page 112
     ; ABNF allows two or more consecutive "." although it is
     ; meaningless in a path domain name.
     pathDomainName       = (ALPHA / DIGIT / "*" )
                            *63(ALPHA / DIGIT / "-"
     NAME = ALPHA *63(ALPHA / DIGIT / "_" )
ToP   noToC   RFC3525 - Page 113

ANNEX B - Text encoding of the protocol

B.1 Coding of wildcards

In a text encoding of the protocol, while TerminationIDs are arbitrary, by judicious choice of names, the wildcard character, "*" may be made more useful. When the wildcard character is encountered, it will "match" all TerminationIDs having the same previous and following characters (if appropriate). For example, if there were TerminationIDs of R13/3/1, R13/3/2 and R13/3/3, the TerminationID R13/3/* would match all of them. There are some circumstances where ALL Terminations must be referred to. The TerminationID "*" suffices, and is referred to as ALL. The CHOOSE TerminationID "$" may be used to signal to the MG that it has to create an ephemeral Termination or select an idle physical Termination.

B.2 ABNF specification

The protocol syntax is presented in ABNF according to RFC 2234. Note 1 - This syntax specification does not enforce all restrictions on element inclusions and values. Some additional restrictions are stated in comments and other restrictions appear in the text of this RFC. These additional restrictions are part of the protocol even though not enforced by this specification. Note 2 - The syntax is context-dependent. For example, "Add" can be the AddToken or a NAME depending on the context in which it occurs. Everything in the ABNF and text encoding is case insensitive. This includes TerminationIDs, digitmap Ids etc. SDP is case sensitive as per RFC 2327. ; NOTE -- The ABNF in this section uses the VALUE construct (or lists ; of VALUE constructs) to encode various package element values ; (properties, signal parameters, etc.). The types of these values ; vary and are specified the relevant package definition. Several ; such types are described in section 12.2. ; ; The ABNF specification for VALUE allows a quotedString form or a ; collection of SafeChars. The encoding of package element values ; into ABNF VALUES is specified below. If a type's encoding allows ; characters other than SafeChars, the quotedString form MUST be used ; for all values of that type, even for specific values that consist ; only of SafeChars. ;
ToP   noToC   RFC3525 - Page 114
   ; String:  A string MUST use the quotedString form of VALUE and can
   ; contain anything allowable in the quotedString form.
   ;
   ; Integer, Double, and Unsigned Integer:  Decimal values can be
   ; encoded using characters 0-9.  Hexadecimal values must be prefixed
   ; with '0x' and can use characters 0-9,a-f,A-F.  An octal format is
   ; not supported.  Negative integers start with '-' and MUST be
   ; Decimal.  The SafeChar form of VALUE MUST be used.
   ;
   ; Character:  A UTF-8 encoding of a single letter surrounded by
   ; double quotes.
   ;
   ; Enumeration:  An enumeration MUST use the SafeChar form of VALUE
   ; and can contain anything allowable in the SafeChar form.
   ;
   ; Boolean:  Boolean values are encoded as "on" and "off" and are
   ; case insensitive.  The SafeChar form of VALUE MUST be used.
   ;
   ; Future types:  Any defined types MUST fit within
   ; the ABNF specification of VALUE.  Specifically, if a type's
   ; encoding allows characters other than SafeChars, the quotedString
   ; form MUST be used for all values of that type, even for specific
   ; values that consist only of SafeChars.
   ;
   ; Note that there is no way to use the double quote character within
   ; a value.
   ;
   ; Note that SDP disallows whitespace at the beginning of a line,
   ; Megaco ABNF allows whitespace before the beginning of the SDP in
   ; the Local/Remote descriptor.  Parsers should accept whitespace
   ; between the LBRKT following the Local/Remote token and the
   ; beginning of the SDP.

   megacoMessage        = LWSP [authenticationHeader SEP ] message

   authenticationHeader = AuthToken EQUAL SecurityParmIndex COLON
                          SequenceNum COLON AuthData

   SecurityParmIndex    = "0x" 8(HEXDIG)
   SequenceNum          = "0x" 8(HEXDIG)
   AuthData             = "0x" 24*64(HEXDIG)

   message            = MegacopToken SLASH Version SEP mId SEP
   messageBody
   ; The version of the protocol defined here is equal to 1.

   messageBody          = ( errorDescriptor / transactionList )
ToP   noToC   RFC3525 - Page 115
   transactionList      = 1*( transactionRequest / transactionReply /
                          transactionPending / transactionResponseAck )
   ;Use of response acks is dependent on underlying transport


   transactionPending   = PendingToken EQUAL TransactionID LBRKT
   RBRKT

   transactionResponseAck = ResponseAckToken LBRKT transactionAck
                  *(COMMA transactionAck) RBRKT
   transactionAck = transactionID / (transactionID "-" transactionID)

   transactionRequest   = TransToken EQUAL TransactionID LBRKT
                          actionRequest *(COMMA actionRequest) RBRKT

   actionRequest        = CtxToken EQUAL ContextID LBRKT ((
                          contextRequest [COMMA  commandRequestList])
                          / commandRequestList) RBRKT

   contextRequest    = ((contextProperties [COMMA contextAudit])
               / contextAudit)

   contextProperties    = contextProperty *(COMMA contextProperty)

   ; at-most-once
   contextProperty    = (topologyDescriptor / priority / EmergencyToken)

   contextAudit   = ContextAuditToken LBRKT contextAuditProperties
                         *(COMMA contextAuditProperties) RBRKT

   ; at-most-once
   contextAuditProperties = ( TopologyToken / EmergencyToken /
                              PriorityToken )

   ; "O-" indicates an optional command
   ; "W-" indicates a wildcarded response to a command
   commandRequestList = ["O-"] ["W-"] commandRequest
                        *(COMMA ["O-"] ["W-"]commandRequest)

   commandRequest      = ( ammRequest / subtractRequest / auditRequest /
                           notifyRequest / serviceChangeRequest)

   transactionReply     = ReplyToken EQUAL TransactionID LBRKT
                     [ ImmAckRequiredToken COMMA]
                   ( errorDescriptor / actionReplyList ) RBRKT

   actionReplyList      = actionReply *(COMMA actionReply )
ToP   noToC   RFC3525 - Page 116
   actionReply          = CtxToken EQUAL ContextID LBRKT
                     ( errorDescriptor / commandReply ) /
            (commandReply COMMA errorDescriptor) ) RBRKT

   commandReply      = (( contextProperties [COMMA commandReplyList] ) /
                           commandReplyList )


   commandReplyList     = commandReplys *(COMMA commandReplys )

   commandReplys        = (serviceChangeReply / auditReply / ammsReply /
                           notifyReply )

   ;Add Move and Modify have the same request parameters
   ammRequest           = (AddToken / MoveToken / ModifyToken ) EQUAL
                          TerminationID [LBRKT ammParameter *(COMMA
                          ammParameter) RBRKT]

   ;at-most-once
   ammParameter         = (mediaDescriptor / modemDescriptor /
                           muxDescriptor / eventsDescriptor /
                           signalsDescriptor / digitMapDescriptor /
                           eventBufferDescriptor / auditDescriptor)

   ammsReply            = (AddToken / MoveToken / ModifyToken /
                           SubtractToken ) EQUAL TerminationID [ LBRKT
                           terminationAudit RBRKT ]

   subtractRequest      =  SubtractToken EQUAL TerminationID
                           [ LBRKT auditDescriptor RBRKT]

   auditRequest         =  (AuditValueToken / AuditCapToken ) EQUAL
                           TerminationID LBRKT auditDescriptor RBRKT

   auditReply           = (AuditValueToken / AuditCapToken )
                          ( contextTerminationAudit  / auditOther)

   auditOther           = EQUAL TerminationID [LBRKT
                          terminationAudit RBRKT]

   terminationAudit = auditReturnParameter *(COMMA auditReturnParameter)

   contextTerminationAudit = EQUAL CtxToken ( terminationIDList /
                          LBRKT errorDescriptor RBRKT )

   auditReturnParameter = (mediaDescriptor / modemDescriptor /
                           muxDescriptor / eventsDescriptor /
                           signalsDescriptor / digitMapDescriptor /
ToP   noToC   RFC3525 - Page 117
                      observedEventsDescriptor / eventBufferDescriptor /
                           statisticsDescriptor / packagesDescriptor /
                            errorDescriptor / auditItem)

   auditDescriptor      = AuditToken LBRKT [ auditItem
                          *(COMMA auditItem) ] RBRKT

   notifyRequest        = NotifyToken EQUAL TerminationID
                          LBRKT ( observedEventsDescriptor
                                [ COMMA errorDescriptor ] ) RBRKT

   notifyReply          = NotifyToken EQUAL TerminationID
                          [ LBRKT errorDescriptor RBRKT ]

   serviceChangeRequest = ServiceChangeToken EQUAL TerminationID
                          LBRKT serviceChangeDescriptor RBRKT

   serviceChangeReply   = ServiceChangeToken EQUAL TerminationID
                          [LBRKT (errorDescriptor /
                          serviceChangeReplyDescriptor) RBRKT]

   errorDescriptor   = ErrorToken EQUAL ErrorCode
                       LBRKT [quotedString] RBRKT

   ErrorCode            = 1*4(DIGIT) ; could be extended

   TransactionID        = UINT32

   mId                  = (( domainAddress / domainName )
                          [":" portNumber]) / mtpAddress / deviceName

   ; ABNF allows two or more consecutive "." although it is meaningless
   ; in a domain name.
   domainName           = "<" (ALPHA / DIGIT) *63(ALPHA / DIGIT / "-" /
                          ".") ">"
   deviceName           = pathNAME

   ;The values 0x0, 0xFFFFFFFE and 0xFFFFFFFF are reserved.
   ContextID            = (UINT32 / "*" / "-" / "$")

   domainAddress        = "[" (IPv4address / IPv6address) "]"
   ;RFC2373 contains the definition of IP6Addresses.
   IPv6address          = hexpart [ ":" IPv4address ]
   IPv4address          = V4hex DOT V4hex DOT V4hex DOT V4hex
   V4hex                = 1*3(DIGIT) ; "0".."255"
   ; this production, while occurring in RFC2373, is not referenced
   ; IPv6prefix           = hexpart SLASH 1*2DIGIT
   hexpart           = hexseq "::" [ hexseq ] / "::" [ hexseq ] / hexseq
ToP   noToC   RFC3525 - Page 118
   hexseq               = hex4 *( ":" hex4)
   hex4                 = 1*4HEXDIG

   portNumber           = UINT16

   ; Addressing structure of mtpAddress:
   ; 25 - 15            0
   ;    |  PC        | NI |
   ;    24 - 14 bits    2 bits
   ; Note: 14 bits are defined for international use.
   ; Two national options exist where the point code is 16 or 24 bits.
   ; To octet align the mtpAddress the MSBs shall be encoded as 0s.
   ; An octet shall be represented by 2 hex digits.
   mtpAddress           = MTPToken LBRKT 4*8 (HEXDIG) RBRKT

   terminationIDList  = LBRKT TerminationID *(COMMA TerminationID) RBRKT

   ; Total length of pathNAME must not exceed 64 chars.
   pathNAME      = ["*"] NAME *("/" / "*"/ ALPHA / DIGIT /"_" / "$" )
                          ["@" pathDomainName ]

   ; ABNF allows two or more consecutive "." although it is meaningless
   ; in a path domain name.
   pathDomainName       = (ALPHA / DIGIT / "*" )
                          *63(ALPHA / DIGIT / "-" / "*" / ".")

   TerminationID        = "ROOT" / pathNAME / "$" / "*"

   mediaDescriptor = MediaToken LBRKT mediaParm *(COMMA mediaParm) RBRKT

   ; at-most one terminationStateDescriptor
   ; and either streamParm(s) or streamDescriptor(s) but not both
   mediaParm            = (streamParm / streamDescriptor /
                           terminationStateDescriptor)

   ; at-most-once per item
   streamParm           = ( localDescriptor / remoteDescriptor /
                           localControlDescriptor )

   streamDescriptor     = StreamToken EQUAL StreamID LBRKT streamParm
                          *(COMMA streamParm) RBRKT

   localControlDescriptor = LocalControlToken LBRKT localParm
                            *(COMMA localParm) RBRKT

   ; at-most-once per item except for propertyParm
   localParm = ( streamMode / propertyParm / reservedValueMode
                  / reservedGroupMode )
ToP   noToC   RFC3525 - Page 119
   reservedValueMode    = ReservedValueToken EQUAL ( "ON" / "OFF" )
   reservedGroupMode    = ReservedGroupToken EQUAL ( "ON" / "OFF" )

   streamMode           = ModeToken EQUAL streamModes

   streamModes     = (SendonlyToken / RecvonlyToken / SendrecvToken /
                          InactiveToken / LoopbackToken )

   propertyParm         = pkgdName parmValue
   parmValue            = (EQUAL alternativeValue/ INEQUAL VALUE)
   alternativeValue     = ( VALUE
                  / LSBRKT VALUE *(COMMA VALUE) RSBRKT
                   ; sublist (i.e., A AND B AND ...)
                  / LBRKT VALUE *(COMMA VALUE) RBRKT
                   ; alternatives (i.e., A OR B OR ...)
                  /  LSBRKT VALUE COLON VALUE RSBRKT )
                   ; range

   INEQUAL              = LWSP (">" / "<" / "#" ) LWSP
   LSBRKT               = LWSP "[" LWSP
   RSBRKT               = LWSP "]" LWSP

   ; Note - The octet zero is not among the permitted characters in
   ; octet string.  As the current definition is limited to SDP, and a
   ; zero octet would not be a legal character in SDP, this is not a
   ; concern.

   localDescriptor      = LocalToken LBRKT octetString RBRKT

   remoteDescriptor     = RemoteToken LBRKT octetString RBRKT

   eventBufferDescriptor= EventBufferToken [ LBRKT eventSpec
                          *( COMMA eventSpec) RBRKT ]

   eventSpec      = pkgdName [ LBRKT eventSpecParameter
                *(COMMA eventSpecParameter) RBRKT ]
   eventSpecParameter   = (eventStream / eventOther)

   eventBufferControl     = BufferToken EQUAL ( "OFF" / LockStepToken )

   terminationStateDescriptor = TerminationStateToken LBRKT
              terminationStateParm *( COMMA terminationStateParm ) RBRKT

   ; at-most-once per item except for propertyParm
   terminationStateParm = (propertyParm / serviceStates /
                           eventBufferControl )
ToP   noToC   RFC3525 - Page 120
   serviceStates        = ServiceStatesToken EQUAL ( TestToken /
                          OutOfSvcToken / InSvcToken )

   muxDescriptor        = MuxToken EQUAL MuxType  terminationIDList

   MuxType              = ( H221Token / H223Token / H226Token / V76Token
                           / extensionParameter )

   StreamID             = UINT16
   pkgdName     = (PackageName SLASH ItemID) ;specific item
                / (PackageName SLASH "*") ;all items in package
                / ("*" SLASH "*") ; all items supported by the MG
   PackageName          = NAME
   ItemID               = NAME

   eventsDescriptor     = EventsToken [ EQUAL RequestID LBRKT
                        requestedEvent *( COMMA requestedEvent ) RBRKT ]

   requestedEvent       = pkgdName [ LBRKT eventParameter
                          *( COMMA eventParameter ) RBRKT ]

   ; at-most-once each of KeepActiveToken , eventDM and eventStream
   ;at most one of either embedWithSig or embedNoSig but not both
   ;KeepActiveToken and embedWithSig must not both be present
   eventParameter       = ( embedWithSig / embedNoSig / KeepActiveToken
                            /eventDM / eventStream / eventOther )

   embedWithSig         = EmbedToken LBRKT signalsDescriptor
                            [COMMA embedFirst ] RBRKT
   embedNoSig        = EmbedToken LBRKT embedFirst RBRKT

   ; at-most-once of each
   embedFirst      = EventsToken [ EQUAL RequestID LBRKT
              secondRequestedEvent *(COMMA secondRequestedEvent) RBRKT ]

   secondRequestedEvent = pkgdName [ LBRKT secondEventParameter
                          *( COMMA secondEventParameter ) RBRKT ]

   ; at-most-once each of embedSig , KeepActiveToken, eventDM or
   ; eventStream
   ; KeepActiveToken and embedSig must not both be present
   secondEventParameter = ( embedSig / KeepActiveToken / eventDM /
                            eventStream / eventOther )

   embedSig  = EmbedToken LBRKT signalsDescriptor RBRKT

   eventStream          = StreamToken EQUAL StreamID
ToP   noToC   RFC3525 - Page 121
   eventOther           = eventParameterName parmValue

   eventParameterName   = NAME

   eventDM              = DigitMapToken EQUAL(( digitMapName ) /
                          (LBRKT digitMapValue RBRKT ))

   signalsDescriptor    = SignalsToken LBRKT [ signalParm
                          *(COMMA signalParm)] RBRKT

   signalParm           = signalList / signalRequest

   signalRequest        = signalName [ LBRKT sigParameter
                          *(COMMA sigParameter) RBRKT ]

   signalList           = SignalListToken EQUAL signalListId LBRKT
                          signalListParm *(COMMA signalListParm) RBRKT

   signalListId         = UINT16

   ;exactly once signalType, at most once duration and every signal
   ;parameter
   signalListParm       = signalRequest

   signalName           = pkgdName
   ;at-most-once sigStream, at-most-once sigSignalType,
   ;at-most-once sigDuration, every signalParameterName at most once
   sigParameter = sigStream / sigSignalType / sigDuration / sigOther
               / notifyCompletion / KeepActiveToken
   sigStream            = StreamToken EQUAL StreamID
   sigOther             = sigParameterName parmValue
   sigParameterName     = NAME
   sigSignalType        = SignalTypeToken EQUAL signalType
   signalType           = (OnOffToken / TimeOutToken / BriefToken)
   sigDuration          = DurationToken EQUAL UINT16
   notifyCompletion     = NotifyCompletionToken EQUAL (LBRKT
            notificationReason *(COMMA notificationReason) RBRKT)

   notificationReason   = ( TimeOutToken / InterruptByEventToken
                        / InterruptByNewSignalsDescrToken
                        / OtherReasonToken )
   observedEventsDescriptor = ObservedEventsToken EQUAL RequestID
                      LBRKT observedEvent *(COMMA observedEvent) RBRKT

   ;time per event, because it might be buffered
   observedEvent        = [ TimeStamp LWSP COLON] LWSP
                          pkgdName [ LBRKT observedEventParameter
                          *(COMMA observedEventParameter) RBRKT ]
ToP   noToC   RFC3525 - Page 122
   ;at-most-once eventStream, every eventParameterName at most once
   observedEventParameter = eventStream / eventOther

   ; For an AuditCapReply with all events, the RequestID should be ALL.
   RequestID            = ( UINT32 / "*" )

   modemDescriptor      = ModemToken (( EQUAL modemType) /
                      (LSBRKT modemType *(COMMA modemType) RSBRKT))
                     [ LBRKT propertyParm *(COMMA propertyParm) RBRKT ]


   ; at-most-once except for extensionParameter
   modemType            = (V32bisToken / V22bisToken / V18Token /
                           V22Token / V32Token / V34Token / V90Token /
                         V91Token / SynchISDNToken / extensionParameter)

   digitMapDescriptor  = DigitMapToken EQUAL
                        ( ( LBRKT digitMapValue RBRKT ) /
                        (digitMapName [ LBRKT digitMapValue RBRKT ]) )
   digitMapName        = NAME
   digitMapValue       = ["T" COLON Timer COMMA] ["S" COLON Timer COMMA]
                         ["L" COLON Timer COMMA] digitMap
   Timer               = 1*2DIGIT
   ; Units are seconds for T, S, and L timers, and hundreds of
   ; milliseconds for Z timer.  Thus T, S, and L range from 1 to 99
   ; seconds and Z from 100 ms to 9.9 s
   digitMap = (digitString /
               LWSP "(" LWSP digitStringList LWSP ")" LWSP)
   digitStringList   = digitString *( LWSP "|" LWSP digitString )
   digitString       = 1*(digitStringElement)
   digitStringElement = digitPosition [DOT]
   digitPosition     = digitMapLetter / digitMapRange
   digitMapRange     = ("x" / (LWSP "[" LWSP digitLetter LWSP "]" LWSP))
   digitLetter       = *((DIGIT "-" DIGIT ) / digitMapLetter)
   digitMapLetter    = DIGIT   ;Basic event symbols
               / %x41-4B / %x61-6B ; a-k, A-K
               / "L" / "S"   ;Inter-event timers (long, short)
               / "Z"         ;Long duration modifier

   ;at-most-once, and DigitMapToken and PackagesToken are not allowed
   ;in AuditCapabilities command
   auditItem            = ( MuxToken / ModemToken / MediaToken /
                           SignalsToken / EventBufferToken /
                           DigitMapToken / StatsToken / EventsToken /
                           ObservedEventsToken / PackagesToken )
ToP   noToC   RFC3525 - Page 123
   serviceChangeDescriptor = ServicesToken LBRKT serviceChangeParm
                            *(COMMA serviceChangeParm) RBRKT

   ; each parameter at-most-once
   ; at most one of either serviceChangeAddress or serviceChangeMgcId
   ; but not both
   ; serviceChangeMethod and serviceChangeReason are REQUIRED
   serviceChangeParm    = (serviceChangeMethod / serviceChangeReason /
                          serviceChangeDelay / serviceChangeAddress /
                          serviceChangeProfile / extension / TimeStamp /
                          serviceChangeMgcId / serviceChangeVersion )

   serviceChangeReplyDescriptor = ServicesToken LBRKT
                        servChgReplyParm *(COMMA servChgReplyParm) RBRKT

   ; at-most-once.  Version is REQUIRED on first ServiceChange response
   ; at most one of either serviceChangeAddress or serviceChangeMgcId
   ; but not both
   servChgReplyParm     = (serviceChangeAddress / serviceChangeMgcId /
                          serviceChangeProfile / serviceChangeVersion /
                          TimeStamp)
   serviceChangeMethod  = MethodToken EQUAL (FailoverToken /
                          ForcedToken / GracefulToken / RestartToken /
                          DisconnectedToken / HandOffToken /
                          extensionParameter)
   ; 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
   serviceChangeDelay   = DelayToken   EQUAL UINT32
   serviceChangeAddress = ServiceChangeAddressToken EQUAL ( mId /
                          portNumber )
   serviceChangeMgcId   = MgcIdToken   EQUAL mId
   serviceChangeProfile = ProfileToken EQUAL NAME SLASH Version
   serviceChangeVersion = VersionToken EQUAL Version
   extension            = extensionParameter parmValue

   packagesDescriptor   = PackagesToken LBRKT packagesItem
                          *(COMMA packagesItem) RBRKT

   Version              = 1*2(DIGIT)
   packagesItem         = NAME "-" UINT16
ToP   noToC   RFC3525 - Page 124
   TimeStamp            = Date "T" Time ; per ISO 8601:1988
   ; Date = yyyymmdd
   Date                 = 8(DIGIT)
   ; Time = hhmmssss
   Time                 = 8(DIGIT)
   statisticsDescriptor = StatsToken LBRKT statisticsParameter
                         *(COMMA statisticsParameter ) RBRKT

   ;at-most-once per item
   statisticsParameter  = pkgdName [EQUAL VALUE]

   topologyDescriptor   = TopologyToken LBRKT topologyTriple
                          *(COMMA topologyTriple) RBRKT
   topologyTriple       = terminationA COMMA
                          terminationB COMMA topologyDirection
   terminationA         = TerminationID
   terminationB         = TerminationID
   topologyDirection    = BothwayToken / IsolateToken / OnewayToken

   priority             = PriorityToken EQUAL UINT16

   extensionParameter   = "X"  ("-" / "+") 1*6(ALPHA / DIGIT)

   ; octetString is used to describe SDP defined in RFC2327.
   ; Caution should be taken if CRLF in RFC2327 is used.
   ; To be safe, use EOL in this ABNF.
   ; Whenever "}" appears in SDP, it is escaped by "\", e.g., "\}"
   octetString          = *(nonEscapeChar)
   nonEscapeChar        = ( "\}" / %x01-7C / %x7E-FF )
   ; Note - The double-quote character is not allowed in quotedString.
   quotedString         = DQUOTE *(SafeChar / RestChar/ WSP) DQUOTE

   UINT16               = 1*5(DIGIT)  ; %x0-FFFF
   UINT32               = 1*10(DIGIT) ; %x0-FFFFFFFF

   NAME                 = ALPHA *63(ALPHA / DIGIT / "_" )
   VALUE                = quotedString / 1*(SafeChar)
   SafeChar             = DIGIT / ALPHA / "+" / "-" / "&" /
                          "!" / "_" / "/" / "\'" / "?" / "@" /
                          "^" / "`" / "~" / "*" / "$" / "\" /
                          "(" / ")" / "%" / "|" / "."

   EQUAL                = LWSP %x3D LWSP ; "="
   COLON                = %x3A           ; ":"
   LBRKT                = LWSP %x7B LWSP ; "{"
   RBRKT                = LWSP %x7D LWSP ; "}"
   COMMA                = LWSP %x2C LWSP ; ","
ToP   noToC   RFC3525 - Page 125
   DOT                  = %x2E           ; "."
   SLASH                = %x2F           ; "/"
   ALPHA                = %x41-5A / %x61-7A ; A-Z / a-z
   DIGIT                = %x30-39         ; 0-9
   DQUOTE               = %x22            ; " (Double Quote)
   HEXDIG               = ( DIGIT / "A" / "B" / "C" / "D" / "E" / "F" )
   SP                   = %x20        ; space
   HTAB                 = %x09        ; horizontal tab
   CR                   = %x0D        ; Carriage return
   LF                   = %x0A        ; linefeed
   LWSP                 = *( WSP / COMMENT / EOL )
   EOL                  = (CR [LF] / LF )
   WSP                  = SP / HTAB ; white space
   SEP                  = ( WSP / EOL / COMMENT) LWSP
   COMMENT              = ";" *(SafeChar/ RestChar / WSP / %x22) EOL
   RestChar            = ";" / "[" / "]" / "{" / "}" / ":" / "," / "#" /
                          "<" / ">" / "="

   ; New Tokens added to sigParameter must take the format of SPA*
   ; * may be of any form i.e., SPAM
   ; New Tokens added to eventParameter must take the form of EPA*
   ; * may be of any form i.e., EPAD

   AddToken                   = ("Add"                   / "A")
   AuditToken                 = ("Audit"                 / "AT")
   AuditCapToken              = ("AuditCapability"       / "AC")
   AuditValueToken            = ("AuditValue"            / "AV")
   AuthToken                  = ("Authentication"        / "AU")
   BothwayToken               = ("Bothway"               / "BW")
   BriefToken                 = ("Brief"                 / "BR")
   BufferToken                = ("Buffer"                / "BF")
   CtxToken                   = ("Context"               / "C")
   ContextAuditToken       = ("ContextAudit"    / "CA")
   DigitMapToken              = ("DigitMap"              / "DM")
   DisconnectedToken          = ("Disconnected"          / "DC")
   DelayToken                 = ("Delay"                 / "DL")
   DurationToken              = ("Duration"              / "DR")
   EmbedToken                 = ("Embed"                 / "EM")
   EmergencyToken             = ("Emergency"             / "EG")
   ErrorToken                 = ("Error"                 / "ER")
   EventBufferToken           = ("EventBuffer"           / "EB")
   EventsToken                = ("Events"                / "E")
   FailoverToken              = ("Failover"              / "FL")
   ForcedToken                = ("Forced"                / "FO")
   GracefulToken              = ("Graceful"              / "GR")
   H221Token                  = ("H221" )
   H223Token                  = ("H223" )
   H226Token                  = ("H226" )
ToP   noToC   RFC3525 - Page 126
   HandOffToken               = ("HandOff"               / "HO")
   ImmAckRequiredToken        = ("ImmAckRequired"        / "IA")
   InactiveToken              = ("Inactive"              / "IN")
   IsolateToken               = ("Isolate"               / "IS")
   InSvcToken                 = ("InService"             / "IV")
   InterruptByEventToken      = ("IntByEvent"            / "IBE")
   InterruptByNewSignalsDescrToken
                              = ("IntBySigDescr"         / "IBS")
   KeepActiveToken            = ("KeepActive"            / "KA")
   LocalToken                 = ("Local"                 / "L")
   LocalControlToken          = ("LocalControl"          / "O")
   LockStepToken              = ("LockStep"              / "SP")
   LoopbackToken              = ("Loopback"              / "LB")
   MediaToken                 = ("Media"                 / "M")
   MegacopToken               = ("MEGACO"                / "!")
   MethodToken                = ("Method"                / "MT")
   MgcIdToken                 = ("MgcIdToTry"            / "MG")
   ModeToken                  = ("Mode"                  / "MO")
   ModifyToken                = ("Modify"                / "MF")
   ModemToken                 = ("Modem"                 / "MD")
   MoveToken                  = ("Move"                  / "MV")
   MTPToken                   = ("MTP")
   MuxToken                   = ("Mux"                   / "MX")
   NotifyToken                = ("Notify"                / "N")
   NotifyCompletionToken      = ("NotifyCompletion"      / "NC")
   ObservedEventsToken        = ("ObservedEvents"        / "OE")
   OnewayToken                = ("Oneway"                / "OW")
   OnOffToken                 = ("OnOff"                 / "OO")
   OtherReasonToken           = ("OtherReason"           / "OR")
   OutOfSvcToken              = ("OutOfService"          / "OS")
   PackagesToken              = ("Packages"              / "PG")
   PendingToken               = ("Pending"               / "PN")
   PriorityToken              = ("Priority"              / "PR")
   ProfileToken               = ("Profile"               / "PF")
   ReasonToken                = ("Reason"                / "RE")
   RecvonlyToken              = ("ReceiveOnly"           / "RC")
   ReplyToken                 = ("Reply"                 / "P")
   RestartToken               = ("Restart"               / "RS")
   RemoteToken                = ("Remote"                / "R")
   ReservedGroupToken         = ("ReservedGroup"         / "RG")
   ReservedValueToken         = ("ReservedValue"         / "RV")
   SendonlyToken              = ("SendOnly"              / "SO")
   SendrecvToken              = ("SendReceive"           / "SR")
   ServicesToken              = ("Services"              / "SV")
   ServiceStatesToken         = ("ServiceStates"         / "SI")
   ServiceChangeToken         = ("ServiceChange"         / "SC")
   ServiceChangeAddressToken  = ("ServiceChangeAddress"  / "AD")
   SignalListToken            = ("SignalList"            / "SL")
ToP   noToC   RFC3525 - Page 127
   SignalsToken               = ("Signals"               / "SG")
   SignalTypeToken            = ("SignalType"            / "SY")
   StatsToken                 = ("Statistics"            / "SA")
   StreamToken                = ("Stream"                / "ST")
   SubtractToken              = ("Subtract"              / "S")
   SynchISDNToken             = ("SynchISDN"             / "SN")
   TerminationStateToken      = ("TerminationState"      / "TS")
   TestToken                  = ("Test"                  / "TE")
   TimeOutToken               = ("TimeOut"               / "TO")
   TopologyToken              = ("Topology"              / "TP")
   TransToken                 = ("Transaction"           / "T")
   ResponseAckToken           = ("TransactionResponseAck" / "K")
   V18Token                   = ("V18")
   V22Token                   = ("V22")
   V22bisToken                = ("V22b")
   V32Token                   = ("V32")
   V32bisToken                = ("V32b")
   V34Token                   = ("V34")
   V76Token                   = ("V76")
   V90Token                   = ("V90")
   V91Token                   = ("V91")
   VersionToken               = ("Version"               / "V")

B.3 Hexadecimal octet coding

Hexadecimal octet coding is a means for representing a string of octets as a string of hexadecimal digits, with two digits representing each octet. This octet encoding should be used when encoding octet strings in the text version of the protocol. For each octet, the 8-bit sequence is encoded as two hexadecimal digits. Bit 0 is the first transmitted; bit 7 is the last. Bits 7-4 are encoded as the first hexadecimal digit, with Bit 7 as MSB and Bit 4 as LSB. Bits 3-0 are encoded as the second hexadecimal digit, with Bit 3 as MSB and Bit 0 as LSB. Examples: Octet bit pattern Hexadecimal coding 00011011 D8 11100100 27 10000011 10100010 11001000 00001001 C1451390

B.4 Hexadecimal octet sequence

A hexadecimal octet sequence is an even number of hexadecimal digits, terminated by a <CR> character.