Interface Channel.Interface.Hold

Interface Index (Compact) | Summary | Description | Methods | Signals | Types

Methods

GetHoldState () u: HoldState, u: Reason
RequestHold (b: Hold) nothing

Signals

HoldStateChanged (u: HoldState, u: Reason)

Types

Local_Hold_State Enum u
Local_Hold_State_Reason Enum u
Changed in 0.17.4. first API-stable version
Objects implementing this interface must also implement:

Description

Interface for channels where you may put the channel on hold. This only makes sense for channels where you are streaming media to or from the members. (To see whether the other participant has put you on hold, see CallState.)

If you place a channel on hold, this indicates that you do not wish to be sent media streams by any of its members and will be ignoring any media streams you continue to receive. It also requests that the connection manager free up any resources that are only needed for an actively used channel (e.g. in a GSM or PBX call, it will be necessary to place an active call on hold before you can start another call).

Methods

(Permalink)

GetHoldState () → u: HoldState, u: Reason

Returns

Return whether the local user has placed the channel on hold.
(Permalink)

RequestHold (b: Hold) → nothing

Parameters

  • Hold — b
  • A boolean indicating whether or not the channel should be on hold

Request that the channel be put on hold (be instructed not to send any media streams to you) or be taken off hold.

If the connection manager can immediately tell that the requested state change could not possibly succeed, this method SHOULD return the NotAvailable error. If the requested state is the same as the current state, this method SHOULD return successfully without doing anything.

Otherwise, this method SHOULD immediately set the hold state to Local_Hold_State_Pending_Hold or Local_Hold_State_Pending_Unhold (as appropriate), emitting HoldStateChanged if this is a change, and return successfully.

The eventual success or failure of the request is indicated by a subsequent HoldStateChanged signal, changing the hold state to Local_Hold_State_Held or Local_Hold_State_Unheld.

If the channel has multiple streams, and the connection manager succeeds in changing the hold state of one stream but fails to change the hold state of another, it SHOULD attempt to revert all streams to their previous hold states.

The following state transitions SHOULD be used, where appropriate:

  • Successful hold: (Unheld, any reason) → (Pending_Hold, Requested) → (Held, Requested)
  • Successful unhold: (Held, any reason) → (Pending_Unhold, Requested) → (Unheld, Requested)
  • Attempting to unhold fails at the first attempt to acquire a resource: (Held, any reason) → (Pending_Unhold, Requested) → (Held, Resource_Not_Available)
  • Attempting to unhold acquires one resource, but fails to acquire a second, and takes time to release the first: (Held, any reason) → (Pending_Unhold, Requested) → (Pending_Hold, Resource_Not_Available) → (Held, Resource_Not_Available)

Possible Errors

  • Disconnected
  • The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None.
    The second usage corresponds to None in the Connection_Status_Reason enum; if a better reason is available, the corresponding error should be used instead.
  • Network Error
  • Raised when there is an error reading from or writing to the network.
  • Not Available
  • The requested hold state cannot be achieved; for example, if only a limited number of channels can be in the "not on hold" state, attempts to exceed this number will raise NotAvailable.

Signals

(Permalink)

HoldStateChanged (u: HoldState, u: Reason)

Parameters

Emitted to indicate that the hold state has changed for this channel. This may occur as a consequence of you requesting a change with RequestHold, or the state changing as a result of a request from another process.

Types

Enum (Permalink)

Local_Hold_State — u

The hold state of a channel.
  • Unheld (0)
  • All streams are unheld (the call is active). New channels SHOULD have this hold state.
  • Held (1)
  • All streams are held (the call is on hold)
  • Pending_Hold (2)
  • The connection manager is attempting to move to state Held, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold.
  • Pending_Unhold (3)
  • The connection manager is attempting to move to state Held, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold.
Enum (Permalink)

Local_Hold_State_Reason — u

The reason for a change to the Local_Hold_State. Clients MUST treat unknown values as equivalent to Local_Hold_State_Reason_None.
  • None (0)
  • The reason cannot be described by any of the predefined values (connection managers SHOULD avoid this reason, but clients MUST handle it gracefully)
  • Requested (1)
  • The change is in response to a user request
  • Resource_Not_Available (2)
  • The change is because some resource was not available