Skip to content

CallDelegate

Adnan Arnautović edited this page Jan 26, 2023 · 1 revision

onRinging(_ callRingingEvent)

Description

Delegate function executed when an outgoing call starts ringing on the called device.

Arguments

Returns

  • none

Example

func onRinging(_ callRingingEvent: CallRingingEvent) {
    os_log("Ringing...")
}

onEarlyMedia(_ callEarlyMediaEvent)

Description

Delegate function executed when there is a ringback tone from the other side. It is triggered only when the callPhoneNumber method is used.

Arguments

Returns

  • none

Example

func onEarlyMedia(_ callEarlyMediaEvent: CallEarlyMediaEvent) {
    os_log("Ringback tone received.")
}

onEstablished(_ callEstablishedEvent)

Description

Delegate function executed when call is established and media is ready to be exchanged.

Arguments

Returns

  • none

Example

func onEstablished(_ callEstablishedEvent: CallEstablishedEvent) {
    os_log("Call established.")
}

onUpdated(_ callUpdatedEvent)

Description

Delegate function executed when some changes occurred during the call (e.g. user toggled video or screen share).

Arguments

Returns

  • none

Example

func onUpdated(_ callUpdatedEvent: CallUpdatedEvent) {
    os_log("Call updated.")
}

onHangup(_ callHangupEvent)

Description

Delegate function executed when call is hung up.

Arguments

Returns

  • none

Example

func onHangup(_ callHangupEvent: CallHangupEvent) {
    os_log("Call finished. Status: %s", callHangupEvent.errorCode.name)
}

onError(_ callErrorEvent)

Description

Delegate function executed when call is ended due to error.

Arguments

Returns

  • none

Example

func onError(_ callErrorEvent: CallErrorEvent) {
    os_log("Call ended, reason: %s", callErrorEvent.reason.description)
}
Clone this wiki locally