INTERNET DRAFT                                          Isaac K. Elliott
                                                  Level 3 Communications
Title: draft-elliott-ipdc-media-00.txt
Date: August 1998






                                  IPDC
                         Media Control Protocol
                   <draft-elliott-ipdc-media-00.txt>


Status of this Memo

   This document is  an  Internet-Draft.   Internet-Drafts  are  working
   documents  of  the Internet Engineering Task Force (IETF), its areas,
   and its working groups.  Note that other groups may  also  distribute
   working documents as Internet-Drafts.

   Internet-Drafts are draft documents valid for a maximum of six months
   and  may be updated, replaced, or obsoleted by other documents at any
   time.  It  is  inappropriate  to  use  Internet-Drafts  as  reference
   material or to cite them other than as ``work in progress.''

   To learn the current status of any Internet-Draft, please  check  the
   ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
   Directories  on  ftp.is.co.za   (Africa),   nic.nordu.net   (Europe),
   munnari.oz.au   (Pacific  Rim),  ftp.ietf.org  (US  East  Coast),  or
   ftp.isi.edu (US West Coast).

Abstract

   The protocol described in this document is a member of the IP  Device
   Control  (IPDC) family of protocols.  The IPDC protocols are proposed
   as a protocol suite, components of which can be used individually  or
   together  to perform connection control, media control, and signaling
   transport  for  environments  where  the  service  control  logic  is
   separated  from  the network access server. Please see the references
   section for other IPDC documents.

   The protocol specification presented here is intended for use between
   a  media  gateway  controller and a media gateway.  The media gateway
   may be capable of acting as a voice over IP gateway, voice  over  ATM
   gateway,  dialup  modem  media  gateway,  circuit  switch,  or cross-
   connect.  Using the IP Media Control  protocol  presented  here,  the



Elliott                  expires February 1999                  [Page 1]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   media  gateway  controller  can send messages to the media gateway to
   cause events such as tones to be generated or detected within a media
   stream.


Table of Contents

  1     INTRODUCTION
    1.1 BACKGROUND
  2     IP MEDIA CONTROL FRAMEWORK OVERVIEW
  3     PROTOCOL DEFINITION
    3.1 SPECIFICATION OF REQUIREMENTS
    3.2 MESSAGES
      3.2.1     RQST - Media Control Request
      3.2.2     NOTI - Media Event Notification
      3.2.3     Reset
      3.2.4     Script Query
      3.2.5     Script Query Response
    3.3 ATTRIBUTE VALUE PAIRS
      3.3.1     Event Script AVP
      3.3.2     Script Type AVP
      3.3.3     Symbol Set AVP
      3.3.4     Buffer Size AVP
      3.3.5     Event Buffer AVP
      3.3.6     Correlator ID AVP
      3.3.7     Source Endpoint AVP
      3.3.8     Correlator ID List AVP
    3.4 SCRIPTING LANGUAGE
    3.5 SYMBOL SET
    3.6 EXAMPLES
      3.6.1     Patterns
      3.6.2     Pattern and Action Pairs
  4     SECURITY CONSIDERATIONS
  5     RIGHTS AND PERMISSIONS
  6     REFERENCES
  7     ACKNOWLEDGMENTS
  8     AUTHOR'S ADDRESS


1 Introduction

   The protocol specification presented here is intended for use between
   a  media  gateway  controller and a media gateway.  The media gateway
   may be capable of acting as a voice over IP gateway, voice  over  ATM
   gateway,  dialup  modem  media  gateway,  circuit  switch,  or cross-
   connect.  Using the IP Media Control  protocol  presented  here,  the
   media  gateway  controller  can send messages to the media gateway to
   cause events to be generated or detected  within a media stream.



Elliott                  expires February 1999                  [Page 2]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


1.1 Background

   This protocol is part of the  IP  Device  Control  (IPDC)  family  of
   protocols.  The IPDC protocols have been proposed as a protocol suite
   which can be used individually  or  together  to  perform  connection
   control,  media  control,  and  signaling  transport for environments
   where the service control logic is separated from the  network  media
   gateway   .   Please  see  the  references  section  for  other  IPDC
   documents.

   In many public and private  telecommunications  environments  in-band
   media  events  and  other  events associated with bearer channels are
   used to signal actions of significance to the  service  logic  layer.
   Examples include:
     * Ringing
     * Busy Signals
     * Call Waiting Tones
     * Flash-hook
     * DTMF Tone Dialing
     * MF Tone Dialing
     * Circuit Seizure
     * On Hook
     * Off Hook
     * Fax Tones
     * Modem Tones

   If service logic is removed from the device which processes the media
   path  for  a  telephone,  fax, or modem call, then a protocol must be
   introduced for controlling the detection and generation of events  in
   the device.  IPMC proposes a protocol to fill this need.



2 IP Media Control Framework Overview

   The IPMC Framework consists of three parts:
      * Messages for sending and  receiving  media  control  information
      between the controller and the media gateway.

      * A scripting language for creating  instructions  for  the  media
      gateway  to  detect  or  generate events.  Scripts are sent to the
      media gateway from the controller within  an  IPMC  message.   The
      scripts instruct the media gateway to do anything from detecting a
      single event to executing an entire call model.  Also, scripts can
      instruct  the  media  gateway  to  find  a URL representing a Java
      applet to  execute,  which  allows  scripts  to  reach  an  almost
      infinite level of control and specificity.




Elliott                  expires February 1999                  [Page 3]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      * Symbols used in the scripting language and in event reporting to
      represent   media  events  detected  or  generated.   Although  an
      introductory  symbol  set  is  presented  in  this  document,  the
      protocol defined here allows for different symbol sets to be used.

   Because there  are  many  different  in-band  signaling  environments
   presently in use in telecommunications networks around the world, the
   IPMC framework also contains a concept  of  packages.   Packages  are
   groupings  of  all  of  the symbols required for a particular kind of
   line interface.  Packages can  also  be  adapted  to  represent  ISDN
   signaling  in  terms  of media events, if an interworking function is
   implemented in an media gateway to convert the ISDN messages to media
   event reports.


3 Protocol Definition

3.1 Specification of Requirements

   In this document, several words are used to signify the  requirements
   of the specification.  These words are often capitalized.


   MUST
      THIS WORD, OR THE ADJECTIVE "REQUIRED", MEANS THAT THE  DEFINITION
      IS AN ABSOLUTE REQUIREMENT OF THE SPECIFICATION.


   MUST NOT
      This phrase means that the definition is an  absolute  prohibition
      of the specification.


   SHOULD
      This word, or the adjective "recommended", means  there may  exist
      valid reasons in particular circumstances to ignore this item, but
      the full implications must be  understood  and  carefully  weighed
      before choosing a different course.


   MAY
      This word, or the adjective "optional", means that  this  item  is
      one  of  an  allowed set of alternatives.  An implementation which
      does not include this option MUST be prepared to interoperate with
      another implementation which does include the option.






Elliott                  expires February 1999                  [Page 4]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


3.2 Messages

   There are only five new messages in IP Media Control:

      * Request - sent from the  controller  to  the  media  gateway  to
      define  the  events  which  the  media  gateway  should detect and
      report, and also to instruct the media gateway to generate events.
      Events  to  generate  and  detect  are  defined  in  terms  of the
      scripting language

      * Notification - sent from the media gateway to the controller  to
      indicate a requested event has been detected.

      * Reset - sent from the media gateway controller to media  gateway
      to  halt  execution  for  all  scripts  on  an  endpoint or set of
      endpoints.

      * Script Query - sent from the media gateway controller  to  media
      gateway to ask for the list of scripts executing on an endpoint.

      * Script Query Response - sent from the media gateway to the media
      gateway  controller to provide the list of scripts executing on an
      endpoint.  Query and Query Response are useful in situations where
      the  primary  media  gateway controller has failed and a secondary
      media gateway controller is taking over control responsibility.

   IPMC messages are constructed in the same way as  any  IPDC  message,
   using  a  standard  header  followed  by Attribute-Value pairs.   The
   standard header and required AVP information may be found in the IPDC
   Base Protocol Document [3].

   Note that many of the IPMC messages  must  be  acknowledged  using  a
   standard  IPDC  acknowledgment.   The  Command Acknowledge message is
   described in more detail in the IPDC Base Protocol document [3].

3.2.1 RQST - Media Control Request

   Description

   This message is sent from the media gateway controller to  the  media
   gateway  to  indicate  that the media gateway should notify the media
   gateway controller of  the  events  indicated  by  the  Event  Script
   parameter.   The media gateway MUST stop an executing script when the
   media gateway  conroller  sends  a  Request  message  with  the  same
   correlator ID and an empty (zero length) Event Script AVP.  The media
   gateway MUST replace an executing script with a different script when
   the  media  gateway  controller sends a Request message with the same
   correlator ID and a new script.



Elliott                  expires February 1999                  [Page 5]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   The Request message initiates a transaction, and the  transaction  is
   completed when the media gateway sends an IPDC Command Ack or Message
   Reject with the same transaction ID to the media gateway  controller.
   If the media gateway can execute the script given in the Event Script
   AVP of a Request message, then the  media  gateway  MUST  respond  by
   sending  a  Command  Ack message to the media gateway controller.  If
   the media gateway cannot execute the script given in the Event Script
   AVP  of  a  Request  message,  then the media gateway MUST respond by
   sending a Message Reject message to the media gateway controller.

   Multiple Request messages may be sent for the same  endpoint  at  the
   same  time.   The  responses are indexed according to the correlation
   Ids of the Request message.  If  the  media  gateway  cannot  support
   multiple  simultaneous requests for the same endpoint, then the media
   gateway MUST send  a  Message  Reject  in  response  to  a  redundant
   Request.





      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Message Header                           |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                   Diameter Command AVP Code                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                 Media Control Request Command Code            |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |              Transaction Originator AVP                       |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Source Endpoint AVP                      |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                       Event Script AVP                        |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Correlator ID AVP                        |



Elliott                  expires February 1999                  [Page 6]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                       Script Type AVP                         |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                        Symbol Set AVP                         |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                   Maximum Buffer Size AVP                     |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                       Connection ID AVP                       |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

   AVP Code
      256     DIAMETER-Command

   AVP Length
      The length of this attribute MUST be at exactly 12.

   Reserved
      The Reserved field MUST be set to zero (0).

   AVP Flags
      As per IPDC defaults.

   Command Code
      1400    Media Control Request

   Transaction Originator AVP
      The identity of the initiator of  the  transaction.    This  is  a
      required parameter for all IPDC protocol messages.

   Source Endpoint AVP
      For the source endpoint(s) which this command will control.   This
      AVP  is  of  type  IPDC-Reference, in the format specified in [3].
      This is a required parameter.

   Event Script AVP
      The script is an ASCII text string of variable  length,  formatted
      according  to  the  scripting  language defined by the script type
      parameter.   This is a required parameter.




Elliott                  expires February 1999                  [Page 7]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   Correlator ID AVP
      The Correlator ID AVP is a unique number  assigned  by  the  Media
      Gateway  Controller  which  allows  the  matching of Requests with
      corresponding Notifications.   This is a required parameter.

   Script Type AVP
      This parameter specifies the script type used in the event script.
      The  script  type presented in this document is script type 1, and
      is the default if this parameter is not  specified.   This  is  an
      optional parameter.

   Symbol Set AVP
      The symbol set used in the script may be specified as  well.   The
      symbol  set  defined  in this document is symbol set 1, and is the
      default if this parameter is not specified.  This is  an  optional
      parameter.

   Maximum Buffer Size AVP
      The Buffer Size AVP is an optional parameter which  specifies  the
      maximum  size  of the event buffer to be sent to the media gateway
      controller.  If the media gateway  has  filled  the  event  buffer
      before  the  script  indicates that the buffer should be reported,
      then the expected media gateway behavior is  to  report  the  full
      buffer  to  the  soft  switch and then start a new event buffer to
      hold any new event indications. If  parameter  is  not  specified,
      default buffer size is 512 bytes.

   Connection ID AVP
      If a connection is active for the endpoint then the media  gateway
      controller  MAY  include  the  connection  ID  field  in the Media
      Control Request message.  Note that the  Connection  ID  field  is
      optional  in  the  RQST.   In many cases, a request is made when a
      connection has not been created, and in other cases more than  one
      Connection ID may be open  for the endpoint.  If the media gateway
      sends a Notification message in the context of a  connection,  the
      connection ID MAY be sent with the notification message.


3.2.2 NOTI - Media Event Notification

   Description

   This message is sent from the media  gateway  to  the  media  gateway
   controller to indicate the occurrence of requested events.

   The Notification message initiates a transaction, and the transaction
   is  completed when the media gateway controller sends an IPDC Command
   Ack or Message Reject with the  same  transaction  ID  to  the  media



Elliott                  expires February 1999                  [Page 8]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   gateway.  If the media gateway controller can accept the Notification
   message, then the media gateway controller MUST respond by sending  a
   Command  Ack  message  to  the  media  gateway.  If the media gateway
   controller cannot accept the Notification  message,  then  the  media
   gateway  controller  MUST respond by sending a Message Reject message
   to the media gateway.

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Message Header                           |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                   Diameter Command AVP Code                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |               Media Event Notification Command Code           |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |              Transaction Originator AVP                       |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Source Endpoint AVP                      |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                       Event Buffer AVP                        |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Correlator ID AVP                        |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                       Connection ID AVP                       |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

   AVP Code
      256     DIAMETER-Command

   AVP Length
      The length of this attribute MUST be at exactly 12.

   Reserved



Elliott                  expires February 1999                  [Page 9]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      The Reserved field MUST be set to zero (0).

   AVP Flags
      As per IPDC defaults.

   Command Code
      1401    Media Event Notification

   Transaction Originator AVP
      The identity of the initiator  of  the  transaction.   This  is  a
      required parameter for all IPDC protocol messages.

   Source Endpoint AVP
      The source endpoint for which this  event  notification  is  being
      sent.  This AVP is of type IPDC-Reference, in the format specified
      in [3].  This is a required parameter.

   Event Buffer AVP
      The event buffer is an  ASCII  text  string  of  variable  length,
      formatted according to reportable symbol set defined by the symbol
      set parameter from the Media Control Request message.    This is a
      required parameter

   Correlator ID AVP
      The Correlator ID AVP matches  the  Correlator  ID  given  in  the
      corresponding   Media   Control  Request  message,  so  that  each
      notification may be matched with the request.   This is a required
      parameter.

   Connection ID AVP
      If a connection is active for the endpoint then the media  gateway
      MAY   include   the   connection  ID  field  in  the  Media  Event
      Notification message.  The Connection ID field is optional in  the
      NOTI.  In many cases, a notification is sent when a connection has
      not been created, and in other cases more than one  Connection  ID
      may  be  open   for  the  endpoint.   If the media gateway sends a
      Notification  message  in  the  context  of  a   connection,   the
      connection ID MAY be sent with the notification message.


3.2.3 Reset

   Description

   This message is sent from the media gateway controller to  the  media
   gateway to cause all running scripts on the given endpoint(s) to stop
   executing.




Elliott                  expires February 1999                 [Page 10]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   The Reset message initiates a transaction,  and  the  transaction  is
   completed when the media gateway sends an IPDC Command Ack or Message
   Reject with the same transaction ID to the media gateway  controller.
   If  the  media  gateway  can accept the Reset message, then the media
   gateway  MUST respond by sending a Command Ack message to  the  media
   gateway  controller.   If  the  media gateway cannot accept the Reset
   message, then the media gateway MUST respond  by  sending  a  Message
   Reject message to the media gateway controller.

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Message Header                           |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                   Diameter Command AVP Code                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      Reset Command Code                       |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |              Transaction Originator Host-Name AVP             |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Source Endpoint AVP                      |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


   AVP Code
      256     DIAMETER-Command

   AVP Length
      The length of this attribute MUST be at exactly 12.

   Reserved
      The Reserved field MUST be set to zero (0).

   AVP Flags
      As per IPDC defaults.

   Command Code
      1402    Reset

   Transaction Originator Host Name AVP



Elliott                  expires February 1999                 [Page 11]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      The host name of the initiator of the transaction.     This  is  a
      required parameter for all IPDC protocol messages.

   Source Endpoint AVP
      The source endpoint for which executing scripts should be stopped.
      This  AVP  is  of  type IPDC-Reference, in the format specified in
      [3].  This is a required parameter.


3.2.4 Script Query

   Description

   This message is sent from the media gateway controller to  the  media
   gateway  to  query  running  script  correlator  IDs  for the scripts
   running on an endpoint.

   The Script Query message initiates a transaction, and the transaction
   is  completed  when  the  media  gateway  sends  an IPDC Script Query
   Response or Message Reject with the same transaction ID to the  media
   gateway  controller.   If  the  media  gateway  can  accept the Query
   message, then the media gateway  MUST respond  by  sending  a  Script
   Query Response message to the media gateway controller.  If the media
   gateway cannot accept  the  Script  Query  message,  then  the  media
   gateway MUST respond by sending a Message Reject message to the media
   gateway controller.

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Message Header                           |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                   Diameter Command AVP Code                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                   Script Query Command Code                   |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |              Transaction Originator Host-Name AVP             |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|                                                               |
      |                      Source Endpoint AVP                      |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+



Elliott                  expires February 1999                 [Page 12]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   AVP Code
      256     DIAMETER-Command

   AVP Length
      The length of this attribute MUST be at exactly 12.

   Reserved
      The Reserved field MUST be set to zero (0).

   AVP Flags
      As per IPDC defaults.

   Command Code
      1403    Script Query

   Transaction Originator Host Name AVP
      The host name of the initiator of the transaction.     This  is  a
      required parameter for all IPDC protocol messages.

   Source Endpoint AVP
      The  source  endpoint  for  which  executing  scripts  should   be
      reported.    This  AVP  is  of  type IPDC-Reference, in the format
      specified in [3].  The use of wild-carding  in  the  Script  Query
      message is for further study.  This is a required parameter.


3.2.5 Script Query Response

   Description

   This message is sent from the media  gateway  to  the  media  gateway
   controller  to  return  running script correlator IDs for the scripts
   running on an endpoint.

   The Script Query message initiates a transaction, and the transaction
   is  completed  when  the  media  gateway  sends  an IPDC Script Query
   Response or Message Reject with the same transaction ID to the  media
   gateway controller.  If the media gateway can accept the Script Query
   message, then the media gateway  MUST respond  by  sending  a  Script
   Query Response message to the media gateway controller.  If the media
   gateway cannot accept  the  Script  Query  message,  then  the  media
   gateway MUST respond by sending a Message Reject message to the media
   gateway controller.

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |



Elliott                  expires February 1999                 [Page 13]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      |                      Message Header                           |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                   Diameter Command AVP Code                   |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |               Script Query Response Command Code              |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |              Transaction Originator Host-Name AVP             |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                      Source Endpoint AVP                      |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                                                               |
      |                    Correlator ID List AVP                     |
      |                                                               |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

   AVP Code
      256     DIAMETER-Command

   AVP Length
      The length of this attribute MUST be at exactly 12.

   Reserved
      The Reserved field MUST be set to zero (0).

   AVP Flags
      As per IPDC defaults.

   Command Code
      1404    Script Query Response

   Transaction Originator Host Name AVP
      The host name of the initiator of the transaction.     This  is  a
      required parameter for all IPDC protocol messages.

   Source Endpoint AVP
      The  source  endpoint  for  which  executing  scripts  should   be
      reported.    This  AVP  is  of  type IPDC-Reference, in the format
      specified in [3].  This is a required parameter.

   Correlator ID List AVP
      This parameter contains one or more Correlator Ids for the scripts



Elliott                  expires February 1999                 [Page 14]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      running on the endpoint.  This is a required parameter.



3.3 Attribute Value Pairs

3.3.1 Event Script AVP

   Description

   The Event Script AVP contains a media control script for execution at
   one  or  more specified endpoints within the media gateway.  This AVP
   is passed to the media gateway along  with  AVPs  which  specify  the
   scripting language and symbol set used by the script.

   AVP Format

      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                          AVP Code                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |   Event Script ...
      +=+=+=+=+=+=+=+=+=+


   AVP Code
      1500      Event Script

   AVP Length
      The length  of  this  attribute  MUST  be  at  least  8  bytes  to
      accommodate 8 bytes of AVP header information.

   AVP Flags
      As per IPDC defaults.

   Event Script
      The Event Script field is of type String and contains an  endpoint
      media  control  script  which  uses a given scripting language and
      symbol set.


3.3.2 Script Type AVP

   Description

   The Script Type AVP indicates the scripting language used for a media
   control  script.   This AVP is passed to the media gateway along with



Elliott                  expires February 1999                 [Page 15]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   AVPs which specify the script itself and the symbol set used  by  the
   script.

   AVP Format

      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                          AVP Code                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Script Type                           |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

   AVP Code
      1501      Script Type

   AVP Length
      The length of this attribute MUST be 12 bytes.

   AVP Flags
      As per IPDC defaults.

   Script Type
      The Script Type field is of type Integer32, and indicates the type
      of an event script.  The only script type currently defined is:

      1        IPMC scripting language
         The IPMC script type defined in this document  in  the  section
         entitled "Scripting Language".


3.3.3 Symbol Set AVP


   Description

   The Symbol Set AVP indicates the scripting  symbol  set  used  for  a
   media  control script.  This AVP is passed to the media gateway along
   with AVPs which specify the script itself and the scripting  language
   used by the script.

   AVP Format

      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                          AVP Code                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+



Elliott                  expires February 1999                 [Page 16]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      |                         Symbol Set                            |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

   AVP Code
      1502      Symbol Set

   AVP Length
      The length of this attribute MUST be 12 bytes.

   AVP Flags
      As per IPDC defaults.

   Script Type
      The Symbol Set field is  of  type  Integer32,  and  indicates  the
      symbol set used in an event script.  The only symbol set currently
      defined is:

      1        IPMC symbol set
         The IPMC symbol set defined in this  document  in  the  section
         entitled "Symbol Set".


3.3.4 Buffer Size AVP

   Description

   The Buffer Size AVP is used to tell the  media  gateway  the  maximum
   size  of  the  event  buffer  to  be  returned  to  the media gateway
   controller in an Event Notification message.  It  is  passed  to  the
   media  gateway  along  with  the  script  which  will  generate those
   notifications.

   AVP Format

      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                          AVP Code                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Buffer Size                           |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

   AVP Code
      1503      Buffer Size

   AVP Length
      The length of this attribute MUST be 12 bytes.




Elliott                  expires February 1999                 [Page 17]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   AVP Flags
      As per IPDC defaults.

   Buffer Size
      The Buffer Size field is  of  type  Integer32,  and  contains  the
      maximum  size  of  the  event  buffer  to be returned to the media
      gateway controller in an Event Notification message.


3.3.5 Event Buffer AVP

   Description

   The Event Buffer is used  report  to  the  media  gateway  controller
   signals  detected in an media gateway in accordance with a previously
   downloaded script.  It is returned to the media gateway controller in
   an Event Notification message.

   AVP Format

      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                          AVP Code                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      | Event Buffer ...
      +=+=+=+=+=+=+=+=+=+

   AVP Code
      1504      Event Buffer

   AVP Length
      The length of this attribute MUST be at least 8 bytes.

   AVP Flags
      As per IPDC defaults.

   Event Buffer
      The Event Buffer is of type String and contains a record of events
      detected  at  a  specific  endpoint  within  a media gateway.  The
      symbol set used is that specified in  the  original  request.  The
      maximum  extent  of  the  contents  of  the Event Buffer were also
      passed in that request.


3.3.6 Correlator ID AVP

   Description



Elliott                  expires February 1999                 [Page 18]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   The  Correlator  ID  is  used  match   Requests   and   corresponding
   Notifications  in  the IPMC protocol.  Correlator IDs are expected to
   be unique within a session between a media gateway controller  and  a
   media gateway.

   AVP Format

      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                          AVP Code                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          AVP Length           |     Reserved      |P|T|V|E|H|M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                        Correlator ID                          |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

   AVP Code
      1505      Correlator ID

   AVP Length
      The length of this attribute MUST be 12 bytes.

   AVP Flags
      As per IPDC defaults.

   Correlator ID
      The Correlator ID field is of type Integer32, and contains a value
      which identifies a specific media control request.


3.3.7 Source Endpoint AVP

   Description

   The Source Endpoint AVP identifies one or  (through  wild-carding)  a
   set  of  endpoints  within  the media gateway, to which a given media
   control script.  It is also used in Event  Notification  messages  to
   identify the endpoint for which an event report is being returned.

   The Source Endpoint AVP is an instance of the IPDC Reference template
   documented in [3].

   AVP Format

   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                           AVP Code                            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+



Elliott                  expires February 1999                 [Page 19]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   |          AVP Length           |     Reserved      |P|T|V|E|H|M|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                        Entity Type Code                       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   Source Endpoint Name ...
   +-+-+-+-+-+-+-+-+-+-+-

   AVP Code
      1506      Source Endpoint

   AVP Length
      The length of this attribute MUST be at least 13 bytes.

   AVP Flags
      As per IPDC defaults.

   Entity Type Code
      See documentation of the IPDC Reference  in  [3].   The  permitted
      IPDC Entity Type Codes for the Source Endpoint AVP are:
         ACCESS_TERMINATION (5)
         TRUNK_TERMINATION  (6)
         DEVICE                   (8)
         MODEM              (9)
         CONFERENCE_PORT   (10)
         FAX_PORT                (11)
         STREAM_SOURCE           (12)
         STREAM_RECORDER   (13)
         RTP_PORT                (14)
         ATM_SPEC              (15)

   Source Endpoint Name
      The Source Endpoint Name identifies  the  endpoint  in  the  media
      gateway  which  is  being addressed with an IPMC command.  See [3]
      for IPDC Reference naming syntax.


3.3.8 Correlator ID List AVP

   Description

   The Correlator ID List is returned in a Script  Query  Response.   It
   identifies  the  scripts  running  at  the endpoint identified in the
   Script Query.

   AVP Format

   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1



Elliott                  expires February 1999                 [Page 20]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                           AVP Code                            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          AVP Length           |     Reserved      |P|T|V|E|H|M|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   +-+-+-+-+-+-+-+-+        Correlator             +-+-+-+-+-+-+-+-+
   |                           IDs                                 |
   +-+-+-+-+-+-+-+-+                               +-+-+-+-+-+-+-+-+
   |                           ...                                 |

   AVP Code
      1507      Correlator ID List

   AVP Length
      The length  of  this  attribute  MUST  be  at  least  8  bytes  to
      accommodate  8  bytes  of  header information.  The length of this
      attribute must be evenly divisible by 4.

   AVP Flags
      As per IPDC defaults.

   Correlator IDs
      The Correlator IDs field consists  of  a  list  of  zero  or  more
      Integer32  Correlator  Ids of scripts running on a given endpoint.
      The number of Correlator Ids in the list is (AVP Length - 8) /  4,
      assuming that the AVP Header is 8 bytes long.


3.4 Scripting Language

   The scripting  language  presented  here  is  a  text-based  language
   consisting  of  very few command constructs.  The language allows the
   specification of a pattern the media gateway is instructed to detect,
   followed by the list of actions the media gateway is to take once the
   pattern is detected.   Additional detection patterns  may  be  nested
   inside  of an action list.  Also, there is a loop construct, allowing
   entire call models to be delivered to an media gateway ,  so  that  a
   single  Request  for  Notification  message  can  download the entire
   "program"  which  will  run  for  an  endpoint  continuously,   until
   replaced.

   The basic operators are as follows:

      [ , ]           Square brackets enclose a pattern and action pair.
      Everything  prior  to  the  comma  is considered the pattern to be
      matched.  Everything following the comma is considered the  action
      to take once the pattern is matched.



Elliott                  expires February 1999                 [Page 21]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      { }             Anything appearing within the curved brackets will
      be repeated forever.

      _number{ }      Anything appearing within the curved brackets will
      be repeated "number" times.

      =>              Exit the current Loop.

      (   )                     Parenthesis  are   used   for   grouping
      sequences  of  patterns  and  actions which should be considered a
      unit.

      |                       The  OR  operator  allows  more  than  one
      pattern  to be tried at the same time.  [Possible side effects are
      for further study.]

      !       The NOT operator  allows  any  action  or  pattern  to  be
      inverted.  For example, !/M/ means to un-mute the channel.

      <               specifies  the  incoming  channel   (default   for
      pattern matching).

      >               specifies  the  outgoing  channel   (default   for
      actions).

      ^^              used within an  action  list  to  tell  the  media
      gateway to report the current event buffer to the soft switch.

      ^(event list)^  used within an  action  list  to  tell  the  media
      gateway  to  report  the  current event buffer but report only the
      items listed within the enclosed event list.

      ^!(event list)^         used within an action  list  to  tell  the
      media  gateway  to  report the current event buffer but filter out
      the items in the enclosed event list.

      $               clear the event buffer.

   The basic form of a script employs the pattern  and  action  operator
   only, as follows

      [ pattern list ,  action list ]

   The entire pattern and action pair may be  repeated  in  an  infinite
   loop by adding the curved brackets as follows

      { [ pattern list , action list ] }




Elliott                  expires February 1999                 [Page 22]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   More than one pattern may be tried simultaneously as follows

      {
         [ pattern list , action list ]   |
         [ pattern list , action list ]
      }

   Whitespace characters (space, carriage return, line  feed,  and  tab)
   are ignored in the language.  They may be used to enhance readability
   wherever desired.


3.5 Symbol Set

   The IPMC protocol allows the  media  gateway  controller  to  specify
   which  symbol  set  is being used in the script that is being sent to
   the media gateway .  If the media gateway controller sends a  Request
   for  Notification which specifies a symbol set that the media gateway
   does not support, then the Media gateway must respond with a standard
   IPDC Message Reject message.

   At present, one symbol set is defined.  The symbols represent  events
   that can be detected or events that can be generated.

   Symbol Packages

   The symbols used in the pattern grammar  are  described  below.   The
   symbols are divided into packages so that media gateway suppliers can
   easily state the subset of the symbol  set  supported  by  the  media
   gateway.   Quotation  marks  delimit  each  symbol  for  purposes  of
   documentation.  The symbols in this symbol set are case-sensitive.

   The usage column in the table indicates where the symbol can be used.
   The three options are:
      * Pattern: the symbol may be used in pattern section of a  script,
      between the [ and the first comma.

      * Action: the symbol may be used in  the  action  section  of  the
      script, between the comma and the ].

      * Report: the symbol may be used in a reported event buffer in  an
      Event Notification (NOTI) message.

   A media gateway MAY support any  of  the  packages  below,  and  MUST
   support at least one of the packages.

   Wildcard Package
   ================



Elliott                  expires February 1999                 [Page 23]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Event Symbol: "."

      Description
         Match anything at all

      Usage: Pattern

   DTMF Package
   ============

      Event Symbol: "0" through "9"

      Description
         DTMF digits 0 through 9 respectively.

      Usage: Pattern, Action, Report

      Event Symbol: "#"

      Description
         DTMF #

      Usage: Pattern, Action, Report

      Event Symbol: "*"

      Description
         DTMF *

      Usage: Pattern, Action, Report

      Event Symbol: "X"

      Description
         Wildcard for any numeric DTMF digit 0 through 9.

      Usage: Pattern

      Event Symbol: "A" through "D"

      Description
         DTMF digits A through D.

      Usage: Pattern, Action, Report

   MF Package
   ==========




Elliott                  expires February 1999                 [Page 24]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Event Symbol: "+0+ through "+9"

      Description
         MF digits 0 through 9.

      Usage: Pattern, Action, Report

      Event Symbol: "+K0" through "+K2"

      Description
         MF K0/KP, K1, or K2 respectively.

      Usage: Pattern, Action, Report

      Event Symbol: "+S0" through "+S3"

      Description
         MF S0/ST, S1, S2, or S3 respectively.

      Usage: Pattern, Action, Report

      Event Symbol: "+X"

      Description
         Wildcard for any numeric MF digit, 0 through 9.

      Usage: Pattern

   Trunk Package
   =============

      Event Symbol: "&w"

      Description
         Wink (a transition from unseized to seized  to  unseized  trunk
         states  within  a  specified period.  Typical seizure period is
         100-350 msec.)

      Usage: Pattern, Action, Report

      Event Symbol: "&o"

      Description
         Wink off.

      Usage: Pattern, Action, Report

      Event Symbol: "&s"



Elliott                  expires February 1999                 [Page 25]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Description
         Incoming seizure (incoming indication of call attempt).

      Usage: Pattern, Action, Report

      Event Symbol: "&r"

      Description
         Return seizure (seizure in response to outgoing seizure).

      Usage: Pattern, Action, Report

      Event Symbol: "&c"

      Description
         Continuity Test using new tone.

      Usage: Pattern, Action, Report

      Event Symbol: "&l"

      Description
         Continuity Test using Loopback.

      Usage: Pattern, Action, Report

      Event Symbol: "&m"

      Description
         Old Milliwatt Tone (1000 Hz)

      Usage: Pattern, Action, Report

      Event Symbol: "&n"

      Description
         New Milliwatt Tone (1004 Hz)

      Usage: Pattern, Action, Report

      Event Symbol: "&t"

      Description
         105 Test Line test progress tone (2225 Hz + or - 25 Hz  at  -10
         dBm0 + or - 0.5dB)

      Usage: Pattern, Action, Report




Elliott                  expires February 1999                 [Page 26]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Event Symbol: "&z"

      Description
         No circuit (that annoying tri-tone, low to high).

      Usage: Pattern, Action, Report

      Event Symbol: "&a"

      Description
         Answer Supervision

      Usage: Pattern, Action, Report

      Event Symbol: "&k###"

      Description
         Announcement number ###

      Usage: Action

      Event Symbol: "&r"

      Description
         Reorder Tone (120 Impulses per minute tone)

      Usage: Pattern, Action, Report

   Line Package
   ============

      Event Symbol: "o"

      Description
         Off hook

      Usage: Pattern, Action, Report

      Event Symbol: "h"

      Description
         On hook

      Usage: Pattern, Action, Report

      Event Symbol: "f"

      Description



Elliott                  expires February 1999                 [Page 27]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


         Flash hook

      Usage: Pattern, Action, Report

      Event Symbol: "a"

      Description
         Answer

      Usage: Pattern, Action, Report

      Event Symbol: "b"

      Description
         Busy

      Usage: Pattern, Action, Report

      Event Symbol: "c"

      Description
         Call Waiting tone

      Usage: Pattern, Action, Report

      Event Symbol: "d"

      Description
         Dial tone (350 + 440 Hz)

      Usage: Pattern, Action, Report

      Event Symbol: "n"

      Description
         Network busy (fast cycle busy)

      Usage: Pattern, Action, Report

      Event Symbol: "r"

      Description
         Ringing

      Usage: Pattern, Action, Report

      Event Symbol: "w"




Elliott                  expires February 1999                 [Page 28]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Description
         Ringback

      Usage: Pattern, Action, Report

      Event Symbol: "p"

      Description
         Prompt tone

      Usage: Pattern, Action, Report

      Event Symbol: "e"

      Description
         Error tone

      Usage: Pattern, Action, Report

      Event Symbol: "u"

      Description
         Stutter dialtone

      Usage: Pattern, Action, Report

      Event Symbol: "v"

      Description
         Alerting Tone (440 Hz Tone of 2 second duration followed by 1/2
         second of tone every 10 seconds)

      Usage: Pattern, Action, Report

      Event Symbol: "y"

      Description
         Recorder Warning Tone (1400 Hz of Tone of 0.5  second  duration
         every 15 seconds)

      Usage: Pattern, Action, Report

      Event Symbol: "t"

      Description
         SIT tone, used for indicating a line is out of service

      Usage: Pattern, Action, Report



Elliott                  expires February 1999                 [Page 29]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Event Symbol: "z"

      Description
         Calling Card Service Tone (60 ms of 941 + 1477 Hz and 940 ms of
         350  +  440  Hz (dial tone), decaying exponentially with a time
         constant of 200 ms.

      Usage: Pattern, Action, Report

      Event Symbol: "s###"

      Description
         Distinctive tone pattern where ### is any  number  between  000
         and  999,  inclusive.   Can  be  used  for distinctive ringing,
         customized dial tone, etc.

      Usage: Pattern, Action, Report

   Generic Media Package
   =====================

      Event Symbol: "/modem/"

      Description
         Modem detected

      Usage: Pattern, Report

      Event Symbol: "/fax/"

      Description
         Fax tone detected

      Usage: Pattern, Report

      Event Symbol: "/###/"

      Description
         Pattern ### detected (can be used for specific algorithms  such
         as answering machine detection, tone detection, and the like)

      Usage: Pattern, Action, Report

   RTP Package
   ===========

      Event Symbol: "/C##/"




Elliott                  expires February 1999                 [Page 30]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Description
         Codec changed to  codec  hexadecimal  ##.   Codec  Numbers  are
         specified  in  ietf-avt-profile-new-02.txt,  dated November 20,
         1997.  For reference, the values are reproduced here:
           01    1016
           02    DVI4
           03    G722
           04    G723
           05    G726-16
           06    G726-24
           07    G726-32
           08    G726-40
           09    G727-16
           0A    G727-24
           0B    G727-32
           0C    G727-40
           0D    G728
           0E    G729
           0F    GSM
           10    L8
           11    L16
           12    LPC
           13    MPA
           14    PCMA (G.711 A-law)
           15    PCMU (G.711 mu-law)
           16    RED
           17 SX7300P
           18 00P
           19 VDVI

      Usage: Action, Report

      Event Symbol: "/C/"

      Description
         Detect changes in codec used

      Usage: Pattern

      Event Symbol: "/D/"

      Description
         Dynamically negotiate payload type

      Usage: Action

      Event Symbol: "/S###/"




Elliott                  expires February 1999                 [Page 31]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Description
         Sampling rate changed to ### samples per second

      Usage: Action, Report

      Event Symbol: "/S/"

      Description
         Detect sampling rate changes

      Usage: Pattern

      Event Symbol: "/J###/"

      Description
         Jitter buffer size changed to ### milliseconds

      Usage: Action, Report

      Event Symbol: "/J/"

      Description
         Detect jitter buffer size changes

      Usage: Pattern

      Event Symbol: "/L####/"

      Description
         Packet loss exceeded #### packets per 100,000

      Usage: Report

      Event Symbol: "/L####&/"

      Description
         Detect packet loss threshold of #### per 100,000 exceeded

      Usage: Pattern, Action

   Audio Package
   =============

      Event Symbol: "/P/" or "/P###.###?####/

      Description
         Turn on silence suppression (note that the inverse  of  any  of
         these actions can be achieved using the ! operator).  ###.### value
         indicates the dB threshold beneath which the signal is considered
           silence.  ?#### value indicates the length of time in milliseconds
         before silence suppression kicks in.

Elliott                  expires February 1999                 [Page 32]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Usage: Action, Report

      Event Symbol: "/N/"

      Description
         Turn on comfort noise generation

      Usage: Action

      Usage: Action

      Event Symbol: "/E/"

      Description
         Turn on echo cancellation

      Usage: Action

      Event Symbol: "/M/"

      Description
         Mute channel

      Usage: Pattern, Action, Report

   RADIUS Package
   ==============

      Event Symbol: "/R/"

      Description
         Detect or  report  RADIUS  Authentication.   When  used  as  an
         action,  the  media  gateway controller is requesting the media
         gateway to initiate RADIUS authentication processes

      Usage: Pattern, Action, Report

      Event Symbol: "/R-/"

      Description
         Detect or report RADIUS Rejection

      Usage: Pattern, Report

      Event Symbol: "/RC##########/"

      Description
         Detect or report  RADIUS  request  for  Callback  and  Callback



Elliott                  expires February 1999                 [Page 33]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


         number ##########.  The callback number may be any length.

      Usage: Pattern, Report

   Timer Package
   =============

      Event Symbol: "/T##?######/"

      Description
         Timer number ## set to expire  in  ######  milliseconds.   This
         pattern  is used in conjunction with the OR operator to allow a
         pattern to be detected with a certain time period or the  timer
         will expire.

      Usage: Pattern, Report

      Event Symbol: "/P#####/"

      Description
         Pause for exactly ##### milliseconds

      Usage: Action

   IP Connection Control Package
   =============================

      Event Symbol: "/ACR/"

      Description
         Detects "release channel completed"  message  sent  from  media
         gateway  to  media  gateway controller.  This provides a branch
         point for a release action on connection.

      Usage: Pattern, Report

      Event Symbol: "/ACON/"

      Description
         Detects "accept connection" message sent from media gateway  to
         media  gateway  controller.  This provides a branch point for a
         connection acceptance action on a connection.

      Usage: Pattern, Report

      Event Symbol: "/AMCN/"

      Description



Elliott                  expires February 1999                 [Page 34]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


         Detects "accept modify  connection"  message  sent  from  media
         gateway  to  media  gateway controller.  This provides a branch
         point  for  a  modify  connection  acceptance   action   on   a
         connection.

      Usage: Pattern, Report

   ISDN Package
   ============

      For further study.

   Java Package
   ============

      Event Symbol: "@http://urlspec@"

      Description
         Tells the media gateway to retrieve  a  Java  applet  from  the
         specified  location and execute it on the specified endpoint or
         endpoints.

      Usage: Action

   Comment Package
   ===============

      Event Symbol: quotation marks (") enclosing text.

      Description
         Any text may appear between the quotes.   The  quotes  and  the
         comment  are written into the event buffer wherever the comment
         appears within a script. The comment is included in  the  event
         buffer  and reported to the media gateway controller along with
         the rest of the detected events.

      Usage: Action, Report

   Escape Character
   ================

      Event Symbol: "

      Description
         Backslash used to tell the script execution engine in the media
         gateway  to interpret the following character literally instead
         of as a command delimiter.




Elliott                  expires February 1999                 [Page 35]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      Usage: Pattern, Action, Report

   Execution Control Package
   =========================

      Event Symbol: "'LABEL'"

      Description
         Labels an entry point for a subroutine

      Usage: Pattern, Action

      Event Symbol: "~"

      Description
         Starts a script over from the beginning.

      Usage: Action

      Event Symbol: "@script-type://scriptname/optional-label@"

      Description
         Tells the media  gateway  to  execute  another  script  of  the
         specified  name.    The  optional  label  allows the calling of
         subroutines  within  the  named  script.   Entry   points   for
         subroutines are indicated with the 'LABEL' construct.

         Definition of script-type is for further study.

      Usage: Action


3.6 Examples

3.6.1 Patterns

   Examples of legal patterns are:
      * 1234  The sequence of DTMF  digits  1,  2,  3,  and  4  must  be
      detected

      * 555XXXX       Three occurrences of DTMF digit 5, followed by any
      four DTMF digits, must be detected.

   A repeat count may be  specified  for  a  signal  by  the  expression
   _num{pattern},  where  num  is  a  positive  integer representing the
   number of repetitions.  For example,
      _3{5} _4{X}
   describes the same pattern as the second bullet  list  pattern  given



Elliott                  expires February 1999                 [Page 36]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   above.

   A  set   of   alternatives   is   represented   by   the   expression
   alt1|alt2|alt3, where alt1, alt2, alt3 are signals or signal strings.
   For example,
           _7{(0|1|2|3|4|5|6|7|8|9)}
   represents 7 occurrences of any of the DTMF digits between 0  and  9,
   in any order.  Another way to represent the same pattern is:
         _7{X}


3.6.2 Pattern and Action Pairs

   Example 1: The pattern and action pair given below  rings  an  analog
   line.

      [  , r ]

   Notice that no pattern is given prior  to  the  comma,  and  only  an
   action is given after the comma.  If this pattern is sent to an media
   gateway in a Request command, then the  media  gateway  simply  plays
   ringing down the requested line or lines.


   Example 2: The pattern and action pair given below detects an  analog
   line  going  off  hook and reports it to the requesting media gateway
   controller.

      [ o ,  ^^ ]

   The pattern part (prior to  the  comma  lists  the  off  hook  event,
   followed by the report operator in the action part of the script.


   Example 3: The media gateway  controller  requests  call  origination
   from  an analog station connected to an media gateway which acts like
   a PBX, where dialing 9 selects an "outside  line",  and  dialing  any
   other  initial  digit  assumes an internal 4-digit extension is being
   dialed.

      [ o , d
      [  9  , !d [ (1XXXXXXXXXX) | (XXXXXXX) , ^^ ] ]
      |
      [ 0|1|2|3|4|5|6|7|8  , !d [XXX, ^^ ]  ]
      ]

   This script nests multiple pattern and action pairs within  a  single
   script.   New  pattern/action  pairs  are  nested  within  the action



Elliott                  expires February 1999                 [Page 37]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   portions of the script.  The first pattern to be matched is the  off-
   hook pattern, o.  Once this pattern is detected, the requested action
   is to play dialtone, d.   Then the next action is to  detect  one  of
   two possible patterns:  if DTMF 9 is detected, the first pattern will
   be matched, but if any other  DTMF  Digit  is  detected,  the  second
   pattern will be matched.

   If DTMF 9 is detected, then dialtone is turned off with a !d.   then,
   either  a  long distance or local number is collected, and the entire
   event buffer is reported to the media gateway  controller.   In  this
   case,  the  event  buffer  will contain something like "o13035551212"
   where o represents off hook,  and  13035551212  represents  the  long
   distance phone number dialed.

   If a DTMF digit other than  9  is  detected,  then  three  additional
   digits  are collected, and the entire event buffer is reported to the
   media gateway controller.   In  this  case,  the  event  buffer  will
   contain something like "o2321" where o represents the off hook event,
   and 2321 is the extension dialed.

   If you want to prevent the off hook event from being  reported,  then
   you  can  filter  specific  events  from the event buffer using the !
   command.  To remove the off hook event, modify the script as follows:


      [ o , d
      [  9  , !d [ (1XXXXXXXXXX) | (XXXXXXX) , ^!(o)^ ] ]
      |
      [ 0|1|2|3|4|5|6|7|8  , !d [XXX, ^!(o)^ ]  ]
      ]


   Another way of expressing this pattern more compactly is to  use  the
   repetition operator as follows:

      [ o , d
      [  9  , !d [ (1_10{X}) | (_7{X}) , ^!(o)^ ] ]
      |
      [0|1|2|3|4|5|6|7|8 , !d [_3{X}, ^!(o)^ ]  ]
      ]




   Example 4: Call origination on a DTMF signaled digital  trunk,  where
   first  circuit  seizure  is  detected,  then  an 11-digit DTMF dialed
   number is collected with a * delimiter, then a 10 digit ANI.




Elliott                  expires February 1999                 [Page 38]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      [ &s_11{X}* ,  ^^ [_10{X}, ^^]  ]

   First, the circuit seizure pattern &s is shown, followed by the  DTMF
   digit  wildcard  X,  followed  by  the  repetition  operator  _11{X},
   followed by the DTMF *.   This pattern collects the  circuit  seizure
   followed by 11 DTMF digits and a *.

   The action section  reports  the  11  digits  to  the  media  gateway
   controller  using  the  ^^ operator, followed by a new pattern/action
   pair.  The second pattern/action pair collects 10 DTMF  digits  using
   _10{X}, then reports the 10 digits.


   Example 5: A call has already been placed between two telephone users
   through  an media gateway using SS7 signaling on the origination side
   of a carrier network, and using  analog station signaling  through  a
   PBX  gateway  on the other side of the carrier network.  Another call
   arrives at the carrier network bound for the analog station, and  the
   subscriber  using  the analog station has subscribed to call waiting.
   The example below shows  the pattern/action strings to first
      - play a call waiting tone,
      - detect of flash hook, and
      - report the action to the media gateway controller

   and next, the media gateway controller sends to the media gateway  an
   IPCC  request  for  connection  (RCON)  to connection the endpoint to
   another  endpoint,  with  piggy-backed  attribute-value  pairs  which
   request notification of another flash.

      [   , c [ f , ^^ ] ]

      [  f , ^^ ]


   Example 6: An entire analog station  call  model  for  the  PBX-style
   media gateway is presented.

      { [ o , d
      [  9  , !d
      [ (1_10{X} | (_7{X} , ^!(o)^
              [ /ACR/ , $ ]            |            [ h , ^^ ]
       ]
      ]
      |
      [0|1|2|3|4|5|6|7|8 , !d
      [ _3{X}, ^!(o)^            [ /ACR/ , $ ]            |            [
   h , ^^ ]
      ]



Elliott                  expires February 1999                 [Page 39]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


      ]
      |
      [  /T01?015000/ , !d e
      [ h , !e $ ]
      ]
      ] }

   This script is nearly identical to the one presented  in  Example  3,
   except  that  new event detection sections are added to detect hangup
   from the far end represented  by  /ACR/,  or  hangup  by  the  analog
   station,  represented  by  h.  /ACR/ is the detection of the "release
   channel completed" message sent from the media gateway to  the  media
   gateway  controller.   This  event  need not be reported to the media
   gateway controller since the media gateway controller  requested  the
   channel  release.  The $ operator clears the event buffer so that the
   script can repeat with an empty event buffer.

   Also, a timer has been added to the example, so that if  dialtone  is
   played  for  more than 15 seconds without a digit being dialed, error
   tone will be played until hangup is detected, and  the  event  buffer
   will be cleared.


   Example 7: Originating Signaling  Sequence  for  a  Feature  Group  D
   interface  from  an  Access Tandem Switch to an Interexchange Carrier
   Media gateway emulating a switch, using MF signaling.

      [ &s, &w [ +K0 _12{+X} S0  +K0 +0 _10{+X}S0 , &w ^^] ]


   In this case, the media gateway detects seizure, and returns  a  wink
   to  the  access  tandem.   After  that,  the  media  gateway collects
   information digits and ANI (the 12 digits collected  between  K0  and
   S0),  then  collects  the  dialed  number  (a  0 then 10 digits, also
   delimited by K0 and S0).  Last, the media gateway returns wink to the
   access  tandem.   If  the digits sent over the trunk are 121234567890
   and   00987654321,   then   the    event    buffer    will    contain
   "&s+K0+1+2+1+2+3+4+5+6+7+8+9+0+K0+0+0+9+8+7+6+5+4+3+2+1+S0".


   Example 8:  In this example, 7 DTMF  digits  are  collected  with  an
   inter-digit timer of 10 seconds.  If the inter-digit timer expires at
   any point the pattern is matched and any digits collected so far  are
   reported.

      _7{ [X ,  ]  | [/T01?10000/ ,^^ => ] }

   In this case, if the user enters "12345" then waits ten seconds,  the



Elliott                  expires February 1999                 [Page 40]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   event buffer will contain: "12345/T01?10000/".


   Example 9:  In this  example,  the  media  gateway  is  requested  to
   collect  10  MF  digits and send them to the media gateway controller
   one at a time.

      _10{ [+X, ^^] }


4 Security Considerations

   Security issues  are  not  discussed  in  this  memo.   The  security
   mechanisms recommended are those specified in [3].


5 Rights and Permissions

   The contributors to this document are listed in the author's  address
   and  acknowledgement  sections  of the document.  All contributors to
   this document and the organizations we represent grant  an  unlimited
   perpetual,  non-exclusive, royalty-free, world-wide right and license
   to any party under the copyrights in the contribution.  This  license
   includes  the  right to copy, publish and distribute the contribution
   in any way, and to prepare derivative works  that  are  based  on  or
   incorporate  all  or  part  of  the contribution, the license to such
   derivative works to be of the  same  scope  as  the  license  of  the
   original contribution. The contributors grant permission to reference
   the names and addresses of the contributors and of the  organizations
   we  represent.  We  agree  that no information in the contribution is
   confidential  and  that  the  any  party  may  freely  disclose   any
   information in the contribution.

   The contributors to this document believe that the  organizations  we
   represent have the authority to grant the rights stated herein.   The
   contributors to this document will grant any party a perpetual,  non-
   exclusive,  royalty-free,  world-wide  right  to  implement,  use and
   distribute the  technology  or  works  when  implementing,  using  or
   distributing technology based upon the specific specification.

   The contributors represent that we have disclosed  the  existence  of
   any  proprietary  or intellectual property rights in the contribution
   that are reasonably and personally known to  the  contributors.   The
   contributors  do  not  represent  that  we  personally  know  of  all
   potentially pertinent proprietary and  intellectual  property  rights
   owned  or claimed by the organization he represents (if any) or third
   parties.




Elliott                  expires February 1999                 [Page 41]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   The  contributors  represent  that  there  are  no  limits   to   the
   contributors'   ability  to  make  the  grants,  acknowledgments  and
   agreements above that are reasonably  and  personally  known  to  the
   contributors.


6 References

   [1]  Calhoun,  Rubens,  "DIAMETER  Base  Protocol",   Internet-Draft,
   draft-calhoun-diameter-04.txt, July 1998.

   [2] Calhoun, Zorn, Pan, "DIAMETER Framework", Internet-Draft,  draft-
   calhoun-diameter-framework-00.txt, May 1998.

   [3]  Taylor,  "IP  Device  Control  Base  Protocol",  Internet-Draft,
   draft-taylor-ipdc-00.txt, August 1998.

   [4] Dugan, "IP Connection Control Protocol",  Internet-Draft,  draft-
   dugan-ipdc-conn-00.txt, August 1998.

   [5] Skran, "IP  Device  Control  Framework",  Internet-Draft,  draft-
   skran-ipdc-frame-00.txt, August 1998.

   [6] Pickett, "IP Device Management Protocol", Internet-Draft,  draft-
   pickett-ipdc-mgmt-00.txt, August 1998.

   [7] Bell, "IP Signaling Protocol",  Internet-Draft,  draft-bell-ipdc-
   sig-00.txt, August 1998.


7 Acknowledgments

   The author wishes to acknowledge the following individuals for  their
   contribution to the IP Media Control  protocol:

   Ilya  Akramovich, Bob Bell,  Dan  Brendes,   Russ  Dehlinger,  Andrew
   Dugan,  Peter  Chung,  Cary  FitzGerald, Jan Gronski, Tom Hess, Geoff
   Jordan,  Tony  Lam,  Shawn  Lewis,  Dave  Mazik,  Alan  Mikhak,  Pete
   O'Connell,  Scott Pickett, Shyamal Prasad, Paul Richards, Dale Skran,
   Louise Spergel, Raj Srinivasan, Tom Taylor, Michael Thomas.


8 Author's Address

   Questions about this memo can be directed to:

   Isaac K. Elliott
   Level 3 Communications



Elliott                  expires February 1999                 [Page 42]


INTERNET DRAFT        IPDC Media Control Protocol            August 1998


   1450 Infinite Drive
   Louisville, CO 80027

   Phone:     1-303-926-3123
   Fax:       1-303-926-3406
   Email:    ike.elliott@L3.com













































Elliott                  expires February 1999                 [Page 43]