Skip to main content
Version: v4

Recording

This section will guide you to implement call recording feature for the voice and video calls.

Implementation

Once you have decided to implement Default Calling or Direct Calling calling and followed the steps to implement them. Just few additional listeners and methods will help you quickly implement call recording in your app.

You need to make changes in the CometChat.startCall method and add the required listeners for recording. Please make sure your callSettings is configured accordingly for Default Calling or Direct Calling.

A basic example of how to make changes to implement recording for a direct/default call:

let sessionID = "12345" //you can set anything
let callView = UIView()// a UIView you want to show the calling view in
let callToken = ""

let callSettings = CallSettings.CallSettingsBuilder(callView: callView, sessionId:sessionID).setAudioOnlyCall(audioOnly: true).enableDefaultLayout(defaultLayout: true).build()

CometChatCalls.startSession(callToken: callToken, callSetting: callSettings, view: callView) { success in
print("CometChatCalls startSession success: \(success)")
} onError: { error in
print("CometChatCalls startSession error: \(String(describing: error?.errorDescription))")
}

Settings for call recording

The CallSettingsclass allows you to customise the overall calling experience. The properties for the call/conference can be set using the CallSettingsBuilder class. This will eventually give you and object of the CallSettings class which you can pass to the startCall() method to start the call.

The options available for recording of calls are:

SettingDescription
showCallRecordButton(boolean showCallRecordButton)If set to true it displays the Recording button in the button Layout.
if set to false it hides the Recording button in the button Layout.
Default value = false
startRecordingOnCallStart(boolean startRecordingOnCallStart)If set to true call recording will start as soon as the call is started.
if set to false call recording will not start as soon as the call is started.
Default value = false

Start Recording

You can use the startRecording() method to start call recording.

CallManager.startRecording()

Stop Recording

You can use the stopRecording() method to stop call recording.

CallManager.stopRecording()