-
Notifications
You must be signed in to change notification settings - Fork 3
Call
status: CallStatus
networkQualityEventListener: NetworkQualityEventListener?
audioDeviceManager: AudioDeviceManager
id() -> String
duration() -> Int
startTime() -> Date?
establishTime() -> Date?
endTime() -> Date?
source() -> Endpoint
destination() -> Endpoint
counterpart() -> Endpoint
mute(_ shouldMute: Bool)
muted() -> Bool
speakerphone(_ speakerphone: Bool, _ completionHandler: @escaping (Error?) -> Void)
speakerphone() -> Bool
sendDTMF(_ dtmf: String) throws -> Void
audioQualityMode(_ mode: AudioQualityMode) -> Void
audioQualityMode() -> AudioQualityMode
hangup()
Read-only property representing the status of the call.
// Retrieve the active call and get the status
let call = getInfobipRTCInstance().getActiveCall()
let status = call?.status
Writable 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?.networkQualityEventListener
Read-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?.audioDeviceManager
Returns 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 (CallEstablishedEvent
was 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 (CallHangupEvent
was 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()
Controls whether the user's audio in the call should be muted after this action. Disabled by default.
-
shouldMute
:Bool
-true
if the audio should be muted, otherwisefalse
.
none
// Mute the active call
let call = getInfobipRTCInstance().getActiveCall()
call?.mute(true)
Returns information whether the user's audio in the call is muted.
none
-
Bool
-true
if 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
-true
if 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
-true
if the speakerphone is enabled, otherwisefalse
.
// Retrieve the active call and check if speakerphone is enabled
let call = getInfobipRTCInstance().getActiveCall()
let speakerphoneEnabled = call?.speakerphone()
Simulates key-press by sending DTMF (Dual-Tone Multi-Frequency) entry.
-
dtmf
:String
- One of the allowed DTMF characters:- digits:
0
to9
- letters:
A
toD
- symbols:
*
and#
- digits:
none
-
DTMFError
- Error explaining why sending DTMF failed.
// Send DTMF tone "9" through the active call
let call = getInfobipRTCInstance().getActiveCall()
call?.sendDTMF("9")
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()
if let audioQualityMode = call?.audioQualityMode() {
print("Audio quality mode: \(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()