<?xml version="1.0"?>
<?xml-stylesheet href="docbook.xsl" type="text/xsl" ?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0">
  <info>
    <title>Action Engine Service Specification</title>
    <titleabbrev>ActionEngine</titleabbrev>
    <releaseinfo>22.12</releaseinfo>
    <author>
      <orgname>ONVIF™</orgname>
      <uri>www.onvif.org</uri>
    </author>
    <pubdate>December, 2022 </pubdate>
    <mediaobject>
      <imageobject>
        <imagedata fileref="media/logo.png" contentwidth="60mm" />
      </imageobject>
    </mediaobject>
    <copyright>
      <year>2008-2022</year>
      <holder>ONVIF™ All rights reserved.</holder>
    </copyright>
    <legalnotice>
      <para>Recipients of this document may copy, distribute, publish, or display this document so long as this copyright notice, license and disclaimer are retained with all copies of the document. No license is granted to modify this document.</para>
      <para>THIS DOCUMENT IS PROVIDED "AS IS," AND THE CORPORATION AND ITS MEMBERS AND THEIR AFFILIATES, MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THIS DOCUMENT ARE SUITABLE FOR ANY PURPOSE; OR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</para>
      <para>IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THIS DOCUMENT, WHETHER OR NOT (1) THE CORPORATION, MEMBERS OR THEIR AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR (2) SUCH DAMAGES WERE REASONABLY FORESEEABLE, AND ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THIS DOCUMENT.  THE FOREGOING DISCLAIMER AND LIMITATION ON LIABILITY DO NOT APPLY TO, INVALIDATE, OR LIMIT REPRESENTATIONS AND WARRANTIES MADE BY THE MEMBERS AND THEIR RESPECTIVE AFFILIATES TO THE CORPORATION AND OTHER MEMBERS IN CERTAIN WRITTEN POLICIES OF THE CORPORATION.</para>
    </legalnotice>
    <revhistory>
      <revision>
        <revnumber>1.0</revnumber>
        <date>Feb-2012</date>
        <author>
          <personname>Hasan T. Ozdemir </personname>
        </author>
        <revremark>First release.</revremark>
      </revision>
      <revision>
        <revnumber>
        </revnumber>
        <date>
        </date>
        <revremark>Change Request 1843</revremark>
      </revision>
      <revision>
        <revnumber>22.12</revnumber>
        <date>Dec-2022</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Deprecate camera local recording action</revremark>
      </revision>
    </revhistory>
  </info>
  <chapter>
    <title>Scope</title>
    <para>This document defines the web service interface for configuration of the Actions and Action Trigger conditions based on events.</para>
  </chapter>
  <chapter>
    <title>Normative references</title>
    <para>ONVIF<superscript>TM</superscript> Core Specification, Version 2.2, May, 2012</para>
    <para role="reference"> &lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf"></link>&gt;</para>
    <para>ONVIF<superscript>TM</superscript> Recording Control Service Specification, Version 2.2, May, 2012.</para>
    <para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/specs/srv/rec/ONVIF-RecordingControl-Service-Spec.pdf"></link>&gt;</para>
  </chapter>
  <chapter>
    <title>Terms and Definitions</title>
    <section>
      <title>Definitions</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colname="c1" colwidth="24*" />
          <colspec colname="c2" colwidth="76*" />
          <tbody valign="top">
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Action Trigger</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Condition. Topic and message content filter based condition </para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Action </emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Executed when one of its conditions (Action Trigger) is satisfied</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section>
      <title>Abbreviations</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colname="c1" colwidth="24*" />
          <colspec colname="c2" colwidth="76*" />
          <tbody valign="top">
            <row>
              <entry valign="middle">
                <para>FTP</para>
              </entry>
              <entry valign="middle">
                <para>File Transfer Protocol </para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>E-Mail</para>
              </entry>
              <entry valign="middle">
                <para>Electronic Mail</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>SMTP</para>
              </entry>
              <entry valign="middle">
                <para>Simple Mail Transfer Protocol</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>POP</para>
              </entry>
              <entry valign="middle">
                <para>Post Office Protocol</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>SMS</para>
              </entry>
              <entry valign="middle">
                <para>Short Message Service</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section>
      <title>Namespaces</title>
      <para>Table 1 lists the prefix and namespaces used in this specification. Listed prefixes are not part of the standard and an implementation can use any prefix.</para>
      <table>
        <title>Namespaces used in this specification</title>
        <tgroup cols="3">
          <colspec colname="c1" colwidth="10*" />
          <colspec colname="c2" colwidth="50*" />
          <colspec colname="c3" colwidth="40*" />
          <thead>
            <row>
              <entry>
                <para>Prefix</para>
              </entry>
              <entry>
                <para>Namespace URI</para>
              </entry>
              <entry>
                <para>Description</para>
              </entry>
            </row>
          </thead>
          <tbody valign="top">
            <row>
              <entry>
                <para>tt</para>
              </entry>
              <entry>
                <para>
                  <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/ver10/schema">http://www.onvif.org/ver10/schema</link>
                </para>
              </entry>
              <entry>
                <para>XML schema descriptions in this specification.</para>
              </entry>
            </row>
            <row>
              <entry>
                <para>tae</para>
              </entry>
              <entry>
                <para>http://www.onvif.org/ver10/actionengine/wsdl</para>
              </entry>
              <entry>
                <para>The namespace for the WSDL action engine service.</para>
              </entry>
            </row>
            <row>
              <entry>
                <para>ter</para>
              </entry>
              <entry>
                <para>
                  <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/ver10/error">http://www.onvif.org/ver10/error</link>
                </para>
              </entry>
              <entry>
                <para>The namespace for ONVIF defined faults.</para>
              </entry>
            </row>
            <row>
              <entry>
                <para>tns1</para>
              </entry>
              <entry>
                <para>
                  <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/ver10/topics">http://www.onvif.org/ver10/topics</link>
                </para>
              </entry>
              <entry>
                <para>The namespace for the ONVIF topic namespace</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </table>
      <para>This specification references to the following namespaces (listed in Table 2) by specified prefix.</para>
      <table>
        <title>Referenced namespaces </title>
        <tgroup cols="3">
          <colspec colname="c1" colwidth="11*" />
          <colspec colname="c2" colwidth="50*" />
          <colspec colname="c3" colwidth="39*" />
          <thead>
            <row>
              <entry>
                <para>Prefix</para>
              </entry>
              <entry>
                <para>Namespace URI</para>
              </entry>
              <entry>
                <para>Description</para>
              </entry>
            </row>
          </thead>
          <tbody valign="top">
            <row>
              <entry>
                <para>soapenv </para>
              </entry>
              <entry>
                <para>http://www.w3.org/2003/05/soap-envelope </para>
              </entry>
              <entry>
                <para>Envelope namespace as defined by SOAP 1.2 [SOAP 1.2, Part 1]</para>
              </entry>
            </row>
            <row>
              <entry>
                <para>xs </para>
              </entry>
              <entry>
                <para>http://www.w3.org/2001/XMLSchema </para>
              </entry>
              <entry>
                <para>Instance namespace as defined by XS [XML-Schema, Part1] and [XML-Schema, Part 2]</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </table>
    </section>
  </chapter>
  <chapter>
    <title>Overview </title>
    <para>This document describes Action Engine web service depicted also in video analytics architecture (Figure 6) in [Video Analytics Service Specification]. The Action Engine service enables new extensible device capabilities by providing further integration opportunities with other networked devices through actions that are triggered by events.  </para>
    <figure>
      <title>Video Analytics Architecture</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="media/ActionEngine/image2.svg" contentwidth="77.74mm" />
        </imageobject>
      </mediaobject>
    </figure>
    <para>Action Engine service interface allows service requester to list available action types (defined in action description language), creates new actions, modify the action configurations, and delete actions.</para>
    <figure>
      <title>Action creation and configuration sequence</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="media/ActionEngine/image3.svg" contentwidth="73.24mm" />
        </imageobject>
      </mediaobject>
    </figure>
    <para>Action Engine interface also allows service requester to define the action triggers that are defined based on Topic expression (Section Topic Filter in [Core Specification]) and Message Content expression (Section Message Content Filter in [Core Specification]). Service requester can list, create, modify, and delete the action triggers. Action Engine service provider passes the triggering event information to triggered action instances.</para>
  </chapter>
  <chapter>
    <title>Service</title>
    <section>
      <title>Action representation</title>
      <para>The configuration of an action contains the action name and the other Action type specific parameter configurations. The Parameters element of the Action element contains the configurations of action parameters. Each Parameter is defined by either a SimpleItem or an ElementItem data type. The Name attribute of each parameter shall be unique within the parameter list. The Value attribute of SimpleItem contains the parameter configuration. The child element of an ElementItem contains the configured value of an ElementItem. It is RECOMMENDED to represent as many configuration parameters as possible by SimpleItems.</para>
    </section>
    <section xml:id="_Ref210635747">
      <title>Action description language</title>
      <para>The description of an Action contains the action type name (Name) and the type information of all parameters belonging to the defined Action type. The parameters of a certain Action Type are listed below the ParameterDescription element. All parameters are either Simple or ElementItems and can be described by either a SimpleItemDescription or an ElementItemDescription. Both ItemDescriptions contain a Name attribute to identify the parameter and a Type attribute to reference a specific XML schema type. The Type attribute of the SimpleItemDescription shall reference to XML schema simple type definition. The Type attribute of the ElementItemDescription shall reference a global element declaration of an XML schema.</para>
      <para>Section <xref linkend="_Ref210635797" /> demonstrates the usage of the Action Description Language. The following definitions are included for convenience:</para>
      <programlisting><![CDATA[<xs:element name="ActionDescription" type="tt:ActionConfigDescription"/>
<xs:complexType name="ActionConfigDescription">
  <xs:sequence>
    <xs:element name="ParameterDescription"
      type="tt:ItemListDescription"/>
  </xs:sequence>
  <xs:attribute name="Name" type="xs:QName" use="required"/>
  <xs:anyAttribute processContents="lax"/>
</xs:complexType>
]]></programlisting>
    </section>
    <section>
      <title>Operations on actions</title>
      <para>If the device supports an Action Engine service as defined by ONVIF, then it shall implement the following operations to manage actions. The Create/Delete/Modify operations are atomic, meaning that either all modifications can be processed or the complete operation shall fail.</para>
      <section>
        <title>GetSupportedActions</title>
        <para>The service provider returns the supported action types. The response returns a list of Action Descriptions according to the Action Description Language described in Section <xref linkend="_Ref210635747" />. The response also contains a list of URLs that provide the location of the schema files. These schema files describe the types and elements used in the Action Descriptions. If action descriptions reference types or elements of the ONVIF schema file, the ONVIF schema file shall be explicitly listed.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">SupportedActions [tt:SupportedActions]</para>
              <para role="text">The response contains the supported actions.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param" />
              <para role="text">There are no operation specific faults.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetActions</title>
        <para>The get actions operation retrieves currently installed Actions.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Action - optional, unbounded [tt:Action]</para>
              <para role="text">The response is a list of installed actions for the specified configuration.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param" />
              <para role="text">There are no operation specific faults.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>CreateActions</title>
        <para>The create action operation adds actions to configuration. The create action operation is atomic. If a service provider can not create all of requested actions, then, the service provider responds with a fault message.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Action - unbounded [tt:ActionConfiguration]</para>
              <para role="text">The request message specifies list of Actions to be added.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Action - optional, unbounded [tt:Action]</para>
              <para role="text">The response is a list of created actions.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidAction</para>
              <para role="text">The requested actions configuration is not valid.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:UknownAction</para>
              <para role="text">The requested action type is not known.</para>
              <para role="param">enc:Receiver - ter:Action - ter:TooManyActions</para>
              <para role="text">There is not enough space to add actions.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>ModifyActions</title>
        <para>The modify action operation modifies action configurations. The modify action operation is atomic. If a service provider can not modify all of requested action configurations, then, the service provider responds with a fault message.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Action - unbounded [tt:Action]</para>
              <para role="text">The request message specifies list of Actions to be modified.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidAction</para>
              <para role="text">The requested action configuration is not valid.</para>
              <para role="param">env:Sender - ter:InvalidArgs - ter:ActionNotExist</para>
              <para role="text">The actions do not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>All action parameters, except the action type, can be modified. The service provider shall return InvalidAction error if the request attempts to change the action type with modify action request.  </para>
      </section>
      <section>
        <title>DeleteActions</title>
        <para>The delete operation deletes actions. The delete action operation is atomic. If a service provider can not delete all of requested actions, then, the service provider responds with a fault message.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token - unbounded [xs:ReferenceToken]</para>
              <para role="text">The request message specifies list of Actions to be removed.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgs - ter:ActionNotExist</para>
              <para role="text">The actions do not exist.</para>
              <para role="param">env:Receiver - ter:Action - ter:ConfigurationConflict</para>
              <para role="text">The service cannot delete the actions without creating a conflicting configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetServiceCapabilities</title>
        <para>The get capabilities operation returns the Action Engine capabilities.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Capabilities [tt:ActionEngineCapabilities]</para>
              <para role="text">The capability response message contains Action Engine capabilities information. 
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param" />
              <para role="text">There are no operation specific faults. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">PRE_AUTH</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>The capabilities data structure indicates the maximum number of action and action trigger instances.</para>
      </section>
      <section>
        <title>GetActionTriggers </title>
        <para>Returns configured action triggers. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">ActionTrigger - optional, unbounded [tt:ActionTrigger]</para>
              <para role="text">The request message specifies list of action triggers.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param" />
              <para role="text">There are no operation specific faults. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>CreateActionTriggers </title>
        <para>Creates action triggers. The create action triggers operation is atomic. If a service provider can not create all of requested action triggers, then, the service provider responds with a fault message.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ActionTrigger - unbounded [tt:ActionTriggerConfiguration]</para>
              <para role="text">The request message specifies list of action triggers to be created.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">ActionTrigger - optional, unbounded [tt:ActionTrigger]</para>
              <para role="text">The request message specifies list of action triggers.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidActionTrigger</para>
              <para role="text">The requested action trigger configuration is not valid.</para>
              <para role="param">env:Receiver - ter:Action - ter:TooManyActionTriggers</para>
              <para role="text">There is not enough space to add action triggers.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>ModifyActionTriggers </title>
        <para>Modifies existing action triggers. The modify action triggers operation is atomic. If a service provider can not modify all of requested action trigger configurations, then, the service provider responds with a fault message.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ActionTrigger - unbounded [tt:ActionTrigger]</para>
              <para role="text">The request message specifies list of action triggers to be modified.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidActionTrigger</para>
              <para role="text">The requested action trigger configuration is not valid.</para>
              <para role="param">env:Sender - ter:InvalidArgs - ter:ActionTriggerNotExist</para>
              <para role="text">The action triggers do not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>DeleteActionTriggers </title>
        <para>Deletes action triggers. The delete action triggers operation is atomic. If a service provider can not delete all of requested action triggers, then, the service provider responds with a fault message.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token - unbounded [tt:ReferenceToken]</para>
              <para role="text">The request message specifies list of action triggers to be removed.
</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgs - ter:ActionTriggerNotExist</para>
              <para role="text">The action triggers do not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section xml:id="_Ref210635797">
      <title>Standard actions </title>
      <section>
        <title>CommandAction</title>
        <para>The command action executes one or more ONVIF commands on the device itself or on a remote device. This mechanism is applicable to a wide range of ONVIF commands.</para>
        <programlisting>
&lt;tt:ActionDescription Name="tt:CommandAction"&gt;
  &lt;tt:ParameterDescription&gt;
    &lt;tt:SimpleItemDescription Name="XAddr" Type="xs:anyURI"/&gt;  
    &lt;tt:SimpleItemDescription Name="Operation" Type="xs:QName"/&gt;
    &lt;tt:ElementItemDescription Name="Parameters" Type="tt:AnyHolder"/&gt;
  &lt;/tt:ParameterDescription&gt;
&lt;/tt:ActionDescription&gt;
</programlisting>
        <table>
          <title>Standard Action configuration parameters</title>
          <tgroup cols="2">
            <colspec colname="c1" colwidth="46*" />
            <colspec colname="c2" colwidth="54*" />
            <thead>
              <row>
                <entry>
                  <para> Parameters </para>
                </entry>
                <entry>
                  <para> Description </para>
                </entry>
              </row>
            </thead>
            <tbody valign="top">
              <row>
                <entry>
                  <para>Xaddr</para>
                </entry>
                <entry>
                  <para>Endpoint where the command shall be executed. Use localhost for local commands instead to avoid that device IP address changes break the commands.</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Operation</para>
                </entry>
                <entry>
                  <para>Operation name including namespace </para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Parameters</para>
                </entry>
                <entry>
                  <para>Input parameter of the operation as defined in the corresponding ONVIF WSDL file.</para>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>
      <section>
        <title>E-Mail Action</title>
        <para>E-mail action definition allows application to send an e-mail to the configured addresses. The e-mail content is provided during the execution. </para>
        <programlisting><![CDATA[<tt:ActionDescription Name="tt:EMailAction">
  <tt:ParameterDescription>
    <tt:ElementItemDescription Name="Destinations"
      Type="tae:EMailServerConfiguration"/>
    <tt:ElementItemDescription Name="Receivers" Type="tae:EMailReceiverConfiguration"/>
    <tt:SimpleItemDescription  Name="Sender"    Type="xs:string"/>
    <tt:SimpleItemDescription  Name="Subject"   Type="xs:string"/>
    <tt:ElementItemDescription Name="Body"      Type="tae:EMailBodyTextConfiguration"/>
    <tt:ElementItemDescription Name="Attachment" Type="tae:EMailAttachmentConfiguration” />
    <tt:ElementItemDescription Name="MediaReference" Type="tt:MediaSource”/>
  </tt:ParameterDescription>
</tt:ActionDescription>
]]></programlisting>
        <table>
          <title>E-Mail Action configuration parameters</title>
          <tgroup cols="3">
            <colspec colname="c1" colwidth="8*" />
            <colspec colname="c2" colwidth="34*" />
            <colspec colname="c3" colwidth="59*" />
            <thead>
              <row>
                <entry namest="c1" nameend="c2">
                  <para> Parameters </para>
                </entry>
                <entry>
                  <para> Description </para>
                </entry>
              </row>
            </thead>
            <tbody valign="top">
              <row>
                <entry namest="c1" nameend="c2">
                  <para>EMailServerConfiguration</para>
                </entry>
                <entry>
                  <para>Contains Email Server configuration </para>
                </entry>
              </row>
              <row>
                <entry morerows="2" />
                <entry>
                  <para>SMTP Configuration</para>
                </entry>
                <entry>
                  <para>SMTP Server IP address and port number </para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>POP Configuration</para>
                </entry>
                <entry>
                  <para>POP Server IP address and port number</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Authentication Configuration</para>
                </entry>
                <entry>
                  <para>Configure username and password </para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Receivers</para>
                </entry>
                <entry>
                  <para>Contains list of receivers (TO and CC fields)</para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Sender (From)</para>
                </entry>
                <entry>
                  <para>Sender information </para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Subject</para>
                </entry>
                <entry>
                  <para>E-Mail subject Line configuration </para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Body</para>
                </entry>
                <entry>
                  <para>E-Mail body text configuration </para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Attachment</para>
                </entry>
                <entry>
                  <para>E-Mail Attachment file name configuration</para>
                </entry>
              </row>
              <row>
                <entry morerows="1" />
                <entry>
                  <para>File Name</para>
                </entry>
                <entry>
                  <para>Attachment file name </para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>File Name Suffix</para>
                </entry>
                <entry>
                  <para>Attachment file name suffix configuration </para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Media Reference</para>
                </entry>
                <entry>
                  <para>Media Profile Token</para>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>
      <section>
        <title>HTTP POST Action</title>
        <para>HTTP POST action definition allows application to send data to the configured address via HTTP POST mechanism. The content is provided during the execution. </para>
        <programlisting><![CDATA[<tt:ActionDescription Name="tt:HttpPOSTAction">
  <tt:ParameterDescription>
    <tt:ElementItemDescription Name="Destinations" Type="tae:HttpHostConfigurations"/>
    <tt:ElementItemDescription Name="POSTContent" Type="tae:PostContentConfiguration"/>
  </tt:ParameterDescription>
</tt:ActionDescription>
]]></programlisting>
        <table>
          <title>POST Action configuration parameters</title>
          <tgroup cols="3">
            <colspec colname="c1" colwidth="8*" />
            <colspec colname="c2" colwidth="26*" />
            <colspec colname="c3" colwidth="67*" />
            <thead>
              <row>
                <entry namest="c1" nameend="c2">
                  <para> Parameters </para>
                </entry>
                <entry>
                  <para> Description </para>
                </entry>
              </row>
            </thead>
            <tbody valign="top">
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Destinations</para>
                </entry>
                <entry>
                  <para>Contains HTTP server configurations</para>
                </entry>
              </row>
              <row>
                <entry morerows="3" />
                <entry>
                  <para>Server Address</para>
                </entry>
                <entry>
                  <para>Server IP address and port number</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Authentication </para>
                </entry>
                <entry>
                  <para>Server Authentication configuration (username, password, authentication mechanism)</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>URI</para>
                </entry>
                <entry>
                  <para>Request-Uri</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Protocol</para>
                </entry>
                <entry>
                  <para>Select HTTP or HTTPS</para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>POST Content </para>
                </entry>
                <entry>
                  <para>POST content configuration for form data, triggering event data, and media</para>
                </entry>
              </row>
              <row>
                <entry />
                <entry>
                  <para>Media Reference</para>
                </entry>
                <entry>
                  <para>Media Profile Token</para>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>
      <section>
        <title>FTP Action</title>
        <para>FTP action definition allows application to send data to the configured address via FTP mechanism. The content is provided during the execution.</para>
        <programlisting><![CDATA[<tt:ActionDescription Name="tt:FtpAction">
  <tt:ParameterDescription>
    <tt:ElementItemDescription Name="Destinations" Type="tae:FtpHostConfigurations"/>
    <tt:ElementItemDescription Name="FtpContent" Type="tae:FtpContentConfiguration”/>
    <tt:ElementItemDescription Name="MediaReference" Type="tt:MediaSource”/>
  </tt:ParameterDescription>
</tt:ActionDescription>
]]></programlisting>
        <table>
          <title>FTP Action configuration parameters</title>
          <tgroup cols="3">
            <colspec colname="c1" colwidth="7*" />
            <colspec colname="c2" colwidth="43*" />
            <colspec colname="c3" colwidth="50*" />
            <thead>
              <row>
                <entry namest="c1" nameend="c2">
                  <para> Parameters </para>
                </entry>
                <entry>
                  <para> Description </para>
                </entry>
              </row>
            </thead>
            <tbody valign="top">
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Destinations</para>
                </entry>
                <entry />
              </row>
              <row>
                <entry morerows="2" />
                <entry>
                  <para>Server Address</para>
                </entry>
                <entry>
                  <para>Server IP and Port number configuration</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Upload Path </para>
                </entry>
                <entry>
                  <para>Upload path on FTP server</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Authentication</para>
                </entry>
                <entry>
                  <para>Authentication configuration </para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>FTP Content</para>
                </entry>
                <entry>
                  <para>FTP Content Configuration</para>
                  <para>Includes configurations for the upload of sequence of images and upload of a file from local storage</para>
                </entry>
              </row>
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Media Reference</para>
                </entry>
                <entry>
                  <para>Media Profile Token</para>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>
      <section>
        <title>SMS Action</title>
        <para>SMS action definition allows application to send data to the configured address via SMS Text Messaging mechanism. The content is provided during the execution. </para>
        <programlisting><![CDATA[<tt:ActionDescription Name="tt:SMSNotificationAction">
  <tt:ParameterDescription>
    <tt:ElementItemDescription Name="SMSProvider"
      Type="tae:SMSProviderConfiguration"/>
    <tt:ElementItemDescription Name="SMSSenderInfo"
      Type="tae:SMSSenderConfiguration"/>
    <tt:SimpleItemDescription  Name="Destination" Type="xs:string"/>
    <tt:SimpleItemDescription  Name="Message"  Type="tae:SMSMessage"/>
  </tt:ParameterDescription>
</tt:ActionDescription>
]]></programlisting>
        <table>
          <title>SMS Action configuration parameters</title>
          <tgroup cols="2">
            <colspec colname="c1" colwidth="50*" />
            <colspec colname="c2" colwidth="50*" />
            <thead>
              <row>
                <entry>
                  <para> Parameters </para>
                </entry>
                <entry>
                  <para> Description </para>
                </entry>
              </row>
            </thead>
            <tbody valign="top">
              <row>
                <entry>
                  <para>SMSProvider</para>
                </entry>
                <entry>
                  <para>SMS Provider Information</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>SMSSenderInfo</para>
                </entry>
                <entry>
                  <para>SMS Sender Information</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Destination</para>
                </entry>
                <entry>
                  <para>Destinations that will receive the message</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Message</para>
                </entry>
                <entry>
                  <para>Text Message</para>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>
      <section>
        <title>Camera Local Recording Action </title>
        <para>Note, that this interface has been deprecated since the same functionality can be configured directly via the recording control service.</para>
        <para>Camera Local Recording Action definition allows application to initiate recording of data to the camera local storage. The content is provided during the execution. </para>
        <programlisting><![CDATA[<tt:ActionDescription Name="tt:RecordingAction">
  <tt:ParameterDescription>
    <tt:ElementItemDescription Name="RecordingConfiguration"
      Type="tae:RecordingActionConfiguration"/>
  </tt:ParameterDescription>
</tt:ActionDescription>
]]></programlisting>
        <table>
          <title>Camera Action configuration parameters</title>
          <tgroup cols="3">
            <colspec colname="c1" colwidth="8*" />
            <colspec colname="c2" colwidth="42*" />
            <colspec colname="c3" colwidth="50*" />
            <thead>
              <row>
                <entry namest="c1" nameend="c2">
                  <para> Parameters </para>
                </entry>
                <entry>
                  <para> Description </para>
                </entry>
              </row>
            </thead>
            <tbody valign="top">
              <row>
                <entry namest="c1" nameend="c2">
                  <para>Recording configuration</para>
                </entry>
                <entry>
                  <para>Local recording configuration</para>
                </entry>
              </row>
              <row>
                <entry morerows="4" />
                <entry>
                  <para>Pre recording duration</para>
                </entry>
                <entry>
                  <para>Recording before the triggering event</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Post recording duration</para>
                </entry>
                <entry>
                  <para>Recording after alarm recording duration</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Record duration </para>
                </entry>
                <entry>
                  <para>Record duration</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Recording frame rate</para>
                </entry>
                <entry>
                  <para>Recording frame rate</para>
                </entry>
              </row>
              <row>
                <entry>
                  <para>Audio Recording on/off</para>
                </entry>
                <entry>
                  <para>Whether Audio recording on/off</para>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </section>
    </section>
    <section>
      <title>Capabilities</title>
      <para>The capabilities reflect optional functions and functionality of a service. The following capabilities are available:</para>
      <para>
        <emphasis role="bold">MaximumActions:	</emphasis>The maximum number of actions that the service provider can concurrently support.</para>
      <para>
        <emphasis role="bold">MaximumTriggers:</emphasis>	The maximum number of trigger configurations that the service provider can concurrently support.</para>
    </section>
    <section>
      <title>Events</title>
      <para>The action engine events allow controlling of action execution as well as building of action chains.</para>
      <para>The action service shall dispatch events through the event service.</para>
      <section>
        <title>Action completed</title>
        <para>The device shall be capable of generating the following event whenever an action has been completed. This event is triggered whenever an action completes without a fault message. When an event is generated due to execution of CommandAction, the Data element of event message can contain the typed information of the request and response message payloads of corresponding ONVIF message exchange. </para>
        <para>Topic: tns1:ActionEngine/Completed</para>
        <programlisting>
&lt;tt:MessageDescription IsProperty="false"&gt; 
  &lt;tt:Source&gt; 
    &lt;tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"/&gt; 
    &lt;tt:SimpleItemDescription Name="ActionName" Type="xs:string"/&gt; 
  &lt;/tt:Source&gt; 
  &lt;tt:Data&gt; 
    &lt;tt:ElementItemDescription Name="RequestResponse" Type="tt:ActionEngineEventPayload"/&gt;
  &lt;/tt:Data&gt; 
&lt;/tt:MessageDescription&gt;
        </programlisting>
      </section>
      <section>
        <title>Action failed</title>
        <para>The device shall be capable of generating the following event whenever an action has been completed with an error.</para>
        <para>This event is triggered whenever an action completes with a fault message or the action could not be executed because of the other error. The response contains the fault codes including any sub codes.</para>
        <para>Topic: tns1:ActionEngine/Failed</para>
        <programlisting>&lt;tt:MessageDescription IsProperty="false"&gt; 
  &lt;tt:Source&gt; 
    &lt;tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"/&gt; 
    &lt;tt:SimpleItemDescription Name="ActionName" Type="xs:string"/&gt; 
  &lt;/tt:Source&gt; 
  &lt;tt:Data&gt; 
    &lt;tt:ElementItemDescription Name="RequestResponse" Type="tt:ActionEngineEventPayload"/&gt;
  &lt;/tt:Data&gt; 
&lt;/tt:MessageDescription&gt;</programlisting>
      </section>
    </section>
  </chapter>
  <appendix>
    <title>Examples (informative)</title>
    <section>
      <title>Command Action configuration</title>
      <para>Starting and stopping of recording job on Recording Control Service by using CommandAction definition is illustrated in the following. </para>
      <para>Start a recording on the same device when a relay is switched on.</para>
      <programlisting>&lt;tae:Action Token=”453638”&gt;
 &lt;tae:Configuration Name=”StartRecording” Type=”tae:CommandAction”&gt;
     &lt;tt:Parameters&gt;
      &lt;tt:SimpleItem Name=”XAddr” Value=”http://127.0.0.1/onvif/device_service”/&gt;
      &lt;tt:SimpleItem Name=”Operation” Value=”tt:SetRecordingJobMode”/&gt;
      &lt;tt:ElementItem Name=”Parameters”&gt;
      	&lt;tt:JobToken&gt;123&lt;/tt:JobToken&gt;
      	&lt;tt:Mode&gt;Active&lt;/tt:Mode&gt;
      &lt;/tt:ElementItem&gt;
    &lt;/tt:Parameters&gt;
 &lt;/tae:Configuration&gt;
&lt;/tae:Action&gt;
</programlisting>
<para>Stop the recording one minute after the relay is switched off.</para>
<programlisting>      
&lt;tae:Action Token=”5674749”&gt;
 &lt;tae:Configuration Name=”StopRecording” Type=”tae:CommandAction”&gt;
     &lt;tt:Parameters&gt;
      &lt;tt:SimpleItem Name=”XAddr” Value=”http://127.0.0.1/onvif/device_service”/&gt;
      &lt;tt:SimpleItem Name=”Operation” Value=”tt:SetRecordingJobMode”/&gt;
      &lt;tt:ElementItem Name=”Parameters”&gt;
      	&lt;tt:JobToken&gt;123&lt;/tt:JobToken&gt;
      	&lt;tt:Mode&gt;Idle&lt;/tt:Mode&gt;
      &lt;/tt:ElementItem&gt;
    &lt;/tt:Parameters&gt;
 &lt;/tae:Configuration&gt;
&lt;/tae:Action&gt;</programlisting>
    </section>
    <section>
      <title>E-Mail Action configuration </title>
      <para>The following demonstrates the E-Mail action configuration information. </para>
      <programlisting><![CDATA[<tt:Action Token=”576858”>
  <tt:Configuration Name=”Notify_SGrp_1” Type=”tt:EMailAction”>
    <tt:Parameters>
      <!-- Server configurations -->
        <tt:ElementItem Name=”Destinations”>
          <tt:SMTPConfig>
            <tt:HostAddress formatType=”ipv4”>172.34.123.65</tt:HostAddress>
          </tt:SMTPConfig>
          <tt:POPConfig>
            <tt:HostAddress formatType=”ipv4”>162.34.123.56</tt:HostAddress>
          </tt:POPConfig>
          <tt:AuthenticationConfig mode=”none”/>
        </tt:ElementItem>
        <!-- Email receiver configurations -->
          <tt:ElementItem Name=”Receivers”>
            <tt:TO>sg1@hq.co</tt:TO>
            <tt:TO>sg2@hq.co</tt:TO>
            <tt:CC>sgm@hq.co</tt:CC>
          </tt:ElementItem>
          <tt:ElementItem Name=”Sender”>NVT@123.23.23.22</tt:ElementItem>
          <!-- Attached File Name configurations -->
            <tt:ElementItem Name=”Attachment”>
              <tt:FileName>EVT_</tt:FileName>
              <tt:doSuffix>dateTime</tt:doSuffix>
            </tt:ElementItem>
            <!-- Media Profile configuration -->
              <tt:ElementItem Name=”MediaReference”>
                <tt:ProfileToken>4757585</tt:ProfileToken>
              </tt:ElementItem>
            </tt:Parameters>
          </tt:Configuration>
        </tt:Action>
]]></programlisting>
    </section>
    <section>
      <title>HTTP POST Action configuration </title>
      <para>The following demonstrates the configuration for HTTP POST action.  The configuration utilizes the Media Profile Reference to indicate the media source.</para>
      <programlisting><![CDATA[<tt:Action Token=”343234”>
  <tt:Configuration Name=”POST2_VMS1” Type=”tt:HttpPOSTAction”>
    <tt:Parameters>
      <!-- HTTP Server Address configuration -->
        <tt:ElementItem Name=”Destinations”>
          <tt:HttpDestination uri=”/post_event”>
            <tt:HostAddress formatType=”ipv4”>192.134.123.214</tt:HostAddress>
          </tt:HttpDestination>
        </tt:ElementItem>
        <!-- HTTP POST Request Body configuration and Media Profile Token -->
          <tt:ElementItem Name=”POSTContent”>
            <tt:MediaReference>
              <tt:ProfileToken>6565746</tt:ProfileToken>
            </tt:MediaReference>
            <tt:PostBody includeMedia=”true” includeEvent=”true”/>
          </tt:ElementItem>
        </tt:Parameters>
      </tt:Configuration>
    </tt:Action>
]]></programlisting>
    </section>
    <section>
      <title>FTP Action configuration </title>
      <para>An example configuration for sending images (from Media Profile) into a directory (Destinations/UploadPath) in FTP server (Destinations) for 15 minutes (FtpContent/HowLong) with 10 seconds snapshots (FtpContent/SampleInterval) with the configured file names (FtpContent/FileName). </para>
      <programlisting><![CDATA[<tt:Action Token=”45345” >
  <tt:Configuration Name=”FTP_STORE_BRNCH1” Type=”tt:FtpAction”>
    <tt:Parameters>
      <tt:ElementItem Name=”Destinations”>
        <tt:FtpDestination>
          <tt:HostAddress formatType=”ipv4”>132.34.13.64</tt:HostAddress>
          <tt:UploadPath>/home/cam2</tt:UploadPath>
          <tt:FtpAuthentication>
            <tt:username> </tt:username>
            <tt:password> </tt:password>
          </tt:FtpAuthentication>
        </tt:FtpDestination>
      </tt:ElementItem>
      <tt:ElementItem Name=”FtpContent”>
        <tt:FtpContentConfig Type=”image_upload”>
          <tt:UploadImages>
            <tt:HowLong>P0Y0M0DT0H15M</tt:HowLong>
            <tt:SampleInterval>P0Y0M0DT0H0M10S</tt:SampleInterval>
            <tt:FileName file_name=”ALM_” suffix=”sequence”/>
          </tt:UploadImages>
        </tt:FtpContentConfig>
      </tt:ElementItem>
      <tt:ElementItem Name=”MediaReference”>
        <tt:ProfileToken>5657959</tt:ProfileToken>
      </tt:ElementItem>
    </tt:Parameters>
  </tt:Configuration>
</tt:Action>
]]></programlisting>
    </section>
    <section>
      <title>GetActions Response</title>
      <para>For example, GetActionsResponse message contains installed Action information as;</para>
      <para>..</para>
      <programlisting><![CDATA[<tt:Action Token=”191918”>
  <tt:Configuration Name=”HQMail” Type=”tt:EMailAction”>
    <tt:Parameters>
      <tt:ElementItem Name=”Destinations”>
        ….
      </tt:ElementItem>
    </tt:Parameters>
  </tt:Configuration>
</tt:Action>
<tt:Action Token=”1913338”>
  <tt:Configuration Name=”HQMail_2” Type=”tt:EMailAction”>
    <tt:Parameters>
      <tt:ElementItem Name=”Destinations”>
        ….
      </tt:ElementItem>
    </tt:Parameters>
  </tt:Configuration>
</tt:Action>
]]></programlisting>
      <para>..</para>
    </section>
  </appendix>
  <appendix role="revhistory">
    <title>Revision History</title>
    <para />
  </appendix>
</book>
