<?xml version="1.0" ?>
<node name="/Channel_Interface_Call_State" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
  <tp:copyright> Copyright (C) 2008 Collabora Limited </tp:copyright>
  <tp:copyright> Copyright (C) 2008 Nokia Corporation </tp:copyright>
  <tp:license xmlns="http://www.w3.org/1999/xhtml">
    <p>This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.</p>

<p>This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.</p>

<p>You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
  </tp:license>
  <interface name="org.freedesktop.Telepathy.Channel.Interface.CallState">
    <tp:requires interface="org.freedesktop.Telepathy.Channel.Type.StreamedMedia"/>

    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>An interface for streamed media channels that can indicate call
        progress or call states. The presence of this interface is no guarantee
        that call states will actually be signalled (for instance, SIP
        implementations are not guaranteed to generate status 180 Ringing, so a
        call can be accepted without the Ringing flag ever having been set;
        similarly, Jingle implementations are not guaranteed to send
        <code>&lt;ringing/&gt;</code>).</p>

      <p>To notify the other participant in the call that they are on hold,
        see <tp:dbus-ref
          namespace="org.freedesktop.Telepathy.Channel.Interface"
          >Hold</tp:dbus-ref>.</p>
    </tp:docstring>
    <tp:added version="0.17.2"/>

    <method name="GetCallStates" tp:name-for-bindings="Get_Call_States">
      <tp:docstring>
        Get the current call states for all contacts involved in this call.
      </tp:docstring>

      <arg tp:type="Channel_Call_State_Map" name="States" direction="out"
        type="a{uu}">
        <tp:docstring>
          The current call states. Participants where the call state flags
          would be 0 (all unset) may be omitted from this mapping.
        </tp:docstring>
      </arg>
    </method>

    <signal name="CallStateChanged" tp:name-for-bindings="Call_State_Changed">
      <tp:docstring>
        Emitted when the state of a member of the channel has changed.
      </tp:docstring>

      <arg name="Contact" type="u" tp:type="Contact_Handle">
        <tp:docstring>
          An integer handle for the contact.
        </tp:docstring>
      </arg>

      <arg name="State" type="u" tp:type="Channel_Call_State_Flags">
        <tp:docstring>
          The new state for this contact.
        </tp:docstring>
      </arg>
    </signal>

    <tp:mapping name="Channel_Call_State_Map">
      <tp:docstring>
        A map from contacts to call states.
      </tp:docstring>

      <tp:member name="Contact" type="u" tp:type="Contact_Handle">
        <tp:docstring>A contact involved in this call.</tp:docstring>
      </tp:member>

      <tp:member name="State" type="u" tp:type="Channel_Call_State_Flags">
        <tp:docstring>State flags for the given contact.</tp:docstring>
      </tp:member>
    </tp:mapping>

    <tp:flags name="Channel_Call_State_Flags" value-prefix="Channel_Call_State" type="u">
      <tp:docstring>
        A set of flags representing call states.
      </tp:docstring>

      <tp:flag suffix="Ringing" value="1">
        <tp:docstring>
          The contact has been alerted about the call but has not responded
          (e.g. 180 Ringing in SIP).
        </tp:docstring>
      </tp:flag>

      <tp:flag suffix="Queued" value="2">
        <tp:docstring>
          The contact is temporarily unavailable, and the call has been placed
          in a queue (e.g. 182 Queued in SIP, or call-waiting in telephony).
        </tp:docstring>
      </tp:flag>

      <tp:flag suffix="Held" value="4">
        <tp:docstring>
          The contact has placed the call on hold, and will not receive
          media from the local user or any other participants until they
          unhold the call again.
        </tp:docstring>
      </tp:flag>

      <tp:flag suffix="Forwarded" value="8">
        <tp:docstring>
          The initiator of the call originally called a contact other than the
          current recipient of the call, but the call was then forwarded or
          diverted.
        </tp:docstring>
      </tp:flag>

      <tp:flag suffix="In_Progress" value="16">
        <tp:docstring>
          Progress has been made in placing the outgoing call, but the
          destination contact may not have been made aware of the call yet
          (so the Ringing state is not appropriate). This corresponds to SIP's
          status code 183 Session Progress, and could be used when the
          outgoing call has reached a gateway, for instance.
        </tp:docstring>
      </tp:flag>

      <tp:flag suffix="Conference_Host" value="32">
        <tp:added version='0.19.11'/>
        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
          This contact has merged this call into a conference. Note that GSM
          provides a notification when the remote party merges a call into a
          conference, but not when it is split out again; thus, this flag can
          only indicate that the call has been part of a conference at some
          point. If a GSM connection manager receives a notification that a
          call has been merged into a conference a second time, it SHOULD
          represent this by clearing and immediately re-setting this flag on
          the remote contact.
        </tp:docstring>
      </tp:flag>
    </tp:flags>

  </interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->
