-
Notifications
You must be signed in to change notification settings - Fork 2
Call
status: CallStatusnetworkQualityEventListener: NetworkQualityEventListener?audioDeviceManager: AudioDeviceManagerid() -> Stringduration() -> IntstartTime() -> Date?establishTime() -> Date?endTime() -> Date?source() -> Endpointdestination() -> Endpointcounterpart() -> Endpointmute(_ shouldMute: Bool) throws -> Voidmuted() -> Boolspeakerphone(_ speakerphone: Bool, _ completionHandler: @escaping (Error?) -> Void)speakerphone() -> BoolsendDTMF(_ dtmf: String) throws -> VoidaudioQualityMode(_ mode: AudioQualityMode) -> VoidaudioQualityMode() -> AudioQualityModehangup()
Read-only property representing the status of the call.
// Retrieve the active call and get the status
let call = getInfobipRTCInstance().getActiveCall()
let status = call?.statusWritable property representing the event listener for local network quality events.
// Retrieve the active call
let call = getInfobipRTCInstance().getActiveCall()
// Set the network quality event listener to be handled by 'self'
call?.networkQualityEventListener = self
// Get the network quality event listener
let networkQualityEventListener = call?.networkQualityEventListenerRead-only property representing the audio device manager which is responsible for handling audio devices during the call.
// Retrieve the active call and get the audio device manager
let call = getInfobipRTCInstance().getActiveCall()
let audioDeviceManager = call?.audioDeviceManagerReturns a unique call identifier on Infobip RTC platform.
none
-
String- Call ID.
// Retrieve the active call and get the call ID
let call = getInfobipRTCInstance().getActiveCall()
let callId = call?.id()Returns call duration in seconds calculated from the time call was established. 0 if the call has not been established
yet.
none
-
Int- Call duration in seconds
// Retrieve the active call
let call = getInfobipRTCInstance().getActiveCall()
// Define a function to handle the hangup event
func onHangup(_ callHangupEvent: CallHangupEvent) {
// Get the duration of the active call
let duration = call?.duration()
}Returns time when the call started (but has not been established yet).
none
-
Date?- Time when the call has been initiated
// Retrieve the active call and get the start time
let call = getInfobipRTCInstance().getActiveCall()
let startTime = call?.startTime()Returns time when the call was established. nil if the call has not been established yet.
none
-
Date?- Time when the call has been established (CallEstablishedEventwas fired).
// Retrieve the active call
let call = getInfobipRTCInstance().getActiveCall()
// Define a function to handle the call established event
func onEstablished(_ callEstablishedEvent: CallEstablishedEvent) {
// Get the establish time of the active call
let establishTime = call?.establishTime()
}Returns time when the call finished. nil if the call has not finished yet.
none
-
Date?- Time when the call has finished (CallHangupEventwas fired)
// Retrieve the active call
let call = getInfobipRTCInstance().getActiveCall()
// Define a function to handle the hangup event
func onHangup(_ callHangupEvent: CallHangupEvent) {
// Get the end time of the active call
let endTime = call?.endTime()
}Returns the endpoint from which the call originated.
none
-
Endpoint- Endpoint which initiated the call.
// Retrieve the active call and get the source endpoint
let call = getInfobipRTCInstance().getActiveCall()
let source = call?.source()Returns the endpoint which received the call.
none
-
Endpoint- Endpoint which received the call.
// Retrieve the active call and get the destination endpoint
let call = getInfobipRTCInstance().getActiveCall()
let destination = call?.destination()Returns the remote endpoint which is participating in the call.
none
-
Endpoint- Remote endpoint which is participating in the call.
// Retrieve the active call and get the counterpart endpoint
let call = getInfobipRTCInstance().getActiveCall()
let counterpart = call?.counterpart()Mutes or unmutes the local participant’s microphone during an active call.
-
shouldMute:Bool- Indicates whether the local participant’s microphone should be muted (true) or unmuted (false).
N/A
-
ApplicationCallError- Provides details about why the mute operation failed.
if let call = getInfobipRTCInstance().getActiveCall() {
do {
// Mute the active call
try call.mute(true)
} catch {
print("Error: \(error)")
}
}Returns information whether the user's audio in the call is muted.
none
-
Bool-trueif the audio is muted, otherwisefalse.
// Retrieve the active call and check if it's muted
let call = getInfobipRTCInstance().getActiveCall()
let muted = call?.muted()Controls whether the audio should be played on the speakerphone. Disabled by default.
-
speakerphone:Bool-trueif the audio should be played on speakerphone, otherwisefalse. -
completionHandler:(Error?) -> Void- Completion handler receiving error if setting speakerphone fails
none
// Enable speakerphone for the active call
let call = getInfobipRTCInstance().getActiveCall()
call?.speakerphone(true) { error in
// Handle any errors that may occur
if let error = error {
print("An error has occurred: \(e.description)")
}
}Returns information whether speakerphone is enabled.
none
-
Bool-trueif the speakerphone is enabled, otherwisefalse.
// Retrieve the active call and check if speakerphone is enabled
let call = getInfobipRTCInstance().getActiveCall()
let speakerphoneEnabled = call?.speakerphone()Simulates a key press by sending a DTMF (Dual-Tone Multi-Frequency) signal to the remote participant.
-
dtmf:String- One of the allowed DTMF characters:- digits:
0to9 - letters:
AtoD - symbols:
*and#
- digits:
N/A
-
ApplicationCallError- Provides details about why the DTMF sending operation failed.
if let call = getInfobipRTCInstance().getActiveCall() {
do {
// Send DTMF tone "9" through the active call
try call.sendDTMF("9")
} catch {
print("Error: \(error)")
}
}Sets the audio quality mode to a given enum value.
-
mode:AudioQualityMode- Enum value that corresponds to the audio quality mode.
N/A
// Set the audio quality mode to low data for the active call
let call = getInfobipRTCInstance().getActiveCall()
call?.audioQualityMode(.lowData)Returns the audio quality mode that is used during the call.
none
-
AudioQualityMode- Enum value that corresponds to the audio quality mode.
// Retrieve the active call audio quality mode
let call = getInfobipRTCInstance().getActiveCall()
let audioQualityMode = call?.audioQualityMode()Hangs up the call, which ends up in both parties receiving the CallHangupEvent, after
the hangup is processed by Infobip WebRTC platform.
none
none
// Hang up the active call
let call = getInfobipRTCInstance().getActiveCall()
call?.hangup()