Call

@available(iOS 12.0, *)
@objc(BDKCall)
public protocol Call : NSObjectProtocol

An object the representing Kaleyra Video VoIP call.

The object provides information about the current state of the call (e.g if it’s dialing, connecting, ended and so on), information about the kind of call it’s being performed (e.g. a group call, or a one to one call), the call direction, and the call type (Audio Only, Audio Upgradable or Audio / Video). It also provides information regarding call participants and their state within the call (e.g if a participant has answered, declined and so on).

Changes in the state of a call object will be notified to its observers. You can register as a call observer using the methods add(observer:) and add(observer:queue:) provided.

Properties

  • The local id of the call.

    Declaration

    Swift

    var uuid: UUID { get }
  • sid

    The remote id of the call.

    Declaration

    Swift

    var sid: String? { get }
  • The options of the call.

    This property can be updated during the call lifecycle. If you want to be notified when options change you can subscribe as a CallObserver

    Declaration

    Swift

    var options: CallOptions? { get }
  • The call end reason.

    Declaration

    Swift

    var endReason: CallEndReason { get }
  • If the call has been declined, this property will contain the decline reason.

    Declaration

    Swift

    var declineReason: CallDeclineReason { get }

Observers

  • Adds a CallObserver , notified about changes in the state of the call.

    Important

    The observer will be notified synchronously on a private background queue. The observer object will be held weakly.

    Declaration

    Swift

    @objc(addObserver:)
    func add(observer: CallObserver)

    Parameters

    observer

    The observer to be added.

  • Adds a CallObserver specifying on which dispatch queue it must be notified.

    When a nil queue is provided the observer will be notified synchronously on a private background queue. Otherwise the observer will be notified asynchronously on the queue provided.

    Important

    The observer will be held weakly.

    Declaration

    Swift

    @objc(addObserver:queue:)
    func add(observer: CallObserver, queue: DispatchQueue?)

    Parameters

    observer

    The observer to be added

    queue

    The dispatch queue onto which the observer will be notified when an event occurs.

  • Removes a CallObserver observer.

    Once removed the observer will not receive call state change notifications anymore unless it is added once again.

    Declaration

    Swift

    @objc(removeObserver:)
    func remove(observer: CallObserver)

    Parameters

    observer

    The observer to be removed.

  • Adds a CallRecordingObserver , notified about changes in the state of the call recording.

    Important

    The observer will be notified synchronously on a private background queue. The observer object will be held weakly.

    Declaration

    Swift

    @objc(addRecordingObserver:)
    func add(recordingObserver: CallRecordingObserver)

    Parameters

    recordingObserver

    The observer to be added.

  • Adds a CallRecordingObserver specifying on which dispatch queue it must be notified.

    When a nil queue is provided the observer will be notified synchronously on a private background queue. Otherwise the observer will be notified asynchronously on the queue provided.

    Important

    The observer will be held weakly.

    Declaration

    Swift

    @objc(addRecordingObserver:queue:)
    func add(recordingObserver: CallRecordingObserver, queue: DispatchQueue?)

    Parameters

    recordingObserver

    The observer to be added

    queue

    The dispatch queue onto which the observer will be notified when an event occurs.

  • Removes a CallRecordingObserver observer.

    Once removed the observer will not receive call recording state change notifications anymore unless it is added once again.

    Declaration

    Swift

    @objc(removeRecordingObserver:)
    func remove(recordingObserver: CallRecordingObserver)

    Parameters

    recordingObserver

    The observer to be removed.

Participants

  • The call participants.

    This property can be updated during the call lifecycle. If you want to be notified when the call participants change, you can subscribe as a CallObserver

    Declaration

    Swift

    var participants: CallParticipants { get }
  • A boolean flag indicating whether the call is a group call, or not.

    Declaration

    Swift

    var isGroupCall: Bool { get }

Direction

  • A boolean flag indicating whether the call is incoming or not.

    Declaration

    Swift

    var isIncoming: Bool { get }
  • A boolean flag indicating whether the call is outgoing or not.

    Declaration

    Swift

    var isOutgoing: Bool { get }

Type

  • A flag indicating the call type of the receiver.

    Once set, this flag doesn’t change even if the receiver has upgraded to a video call. If you want to know whether the call has upgraded to a video call in case it’s of type CallType.audioUpgradable you should check the didUpgradeToVideo flag.

    Declaration

    Swift

    var callType: CallType { get }
  • A flag indicating whether the call has video or not.

    If the call type is CallType.audioVideo this property will be true, if the call type is CallType.audioUpgradable this property will be true when the user has upgraded the call to video. In any other cases this flag will be false.

    Declaration

    Swift

    var hasVideo: Bool { get }
  • A boolean flag indicating whether the call is a CallType.audioVideo call, or not.

    Declaration

    Swift

    var isAudioVideo: Bool { get }
  • A boolean flag indicating whether the call is a CallType.audioUpgradable call, or not.

    Declaration

    Swift

    var isAudioUpgradable: Bool { get }
  • A boolean flag indicating whether the call is a CallType.audioOnly call, or not.

    Declaration

    Swift

    var isAudioOnly: Bool { get }
  • A boolean flag indicating whether the call can be upgraded to video, or not.

    Declaration

    Swift

    var canUpgradeToVideo: Bool { get }
  • A boolean flag indicating whether the call has upgraded to video, or not.

    When an CallType.audioUpgradable call is upgraded to a video call either by the current user or by another call participant, this flag will be updated to true.

    Declaration

    Swift

    var didUpgradeToVideo: Bool { get }

State

  • The call current state.

    Declaration

    Swift

    var state: CallState { get }
  • The current state of the call recording.

    Declaration

    Swift

    var recordingState: CallRecordingState { get }
  • The date the call has started connecting

    Declaration

    Swift

    var connectingDate: Date? { get }
  • The date the call has connected

    Declaration

    Swift

    var connectedDate: Date? { get }
  • The date the call has ended

    Declaration

    Swift

    var endDate: Date? { get }

Mute

  • A property indicating whether the local audio is muted or not

    Declaration

    Swift

    var isMuted: Bool { get }