Skip to main content
Retrieve call history for your application. Call logs provide detailed information about past calls including duration, participants, recordings, and status.

Fetch Call Logs

Use CallLogsRequest to fetch call logs with pagination support. The builder pattern allows you to filter results by various criteria.
let callLogRequest = CallLogsRequest.CallLogsRequestBuilder()
    .setLimit(30)
    .build()

callLogRequest.fetchNext(onSuccess: { callLogs in
    for callLog in callLogs {
        print("Session: \(callLog.sessionID ?? "")")
        print("Duration: \(callLog.totalDuration ?? "")")
        print("Status: \(callLog.status ?? "")")
    }
}, onError: { error in
    print("Error: \(error?.errorDescription ?? "")")
})

CallLogsRequestBuilder

Configure the request using the builder methods:
MethodTypeDescription
setLimit(Int)IntNumber of call logs to fetch per request (default: 30, max: 100)
setSessionType(String)StringFilter by call type: video or audio
setCallStatus(String)StringFilter by call status
setHasRecording(Bool)BoolFilter calls that have recordings
setCallCategory(String)StringFilter by category: call or meet
setCallDirection(String)StringFilter by direction: incoming or outgoing
setUid(String)StringFilter calls with a specific user
setGuid(String)StringFilter calls with a specific group

Filter Examples

// Fetch only video calls
let videoCallsRequest = CallLogsRequest.CallLogsRequestBuilder()
    .setSessionType("video")
    .setLimit(20)
    .build()

// Fetch calls with recordings
let recordedCallsRequest = CallLogsRequest.CallLogsRequestBuilder()
    .setHasRecording(true)
    .build()

// Fetch missed incoming calls
let missedCallsRequest = CallLogsRequest.CallLogsRequestBuilder()
    .setCallStatus("missed")
    .setCallDirection("incoming")
    .build()

// Fetch calls with a specific user
let userCallsRequest = CallLogsRequest.CallLogsRequestBuilder()
    .setUid("user_id")
    .build()

Pagination

Use fetchNext() and fetchPrevious() for pagination:
// Fetch next page
callLogRequest.fetchNext(onSuccess: { callLogs in
    // Handle next page
}, onError: { error in
    print("Error: \(error?.errorDescription ?? "")")
})

// Fetch previous page
callLogRequest.fetchPrevious(onSuccess: { callLogs in
    // Handle previous page
}, onError: { error in
    print("Error: \(error?.errorDescription ?? "")")
})

CallLog Object

Each CallLog object contains detailed information about a call:
PropertyTypeDescription
sessionIDStringUnique identifier for the call session
initiatorCallEntityUser who initiated the call
receiverCallEntityUser or group that received the call
receiverTypeStringuser or group
typeStringCall type: video or audio
statusStringFinal status of the call
callCategoryStringCategory: call or meet
initiatedAtIntTimestamp when call was initiated
endedAtIntTimestamp when call ended
totalDurationStringHuman-readable duration (e.g., “5:30”)
totalDurationInMinutesDoubleDuration in minutes
totalAudioMinutesDoubleAudio duration in minutes
totalVideoMinutesDoubleVideo duration in minutes
totalParticipantsIntNumber of participants
hasRecordingBoolWhether the call was recorded
recordings[Recording]List of recording objects

Access Recordings

If a call has recordings, access them through the recordings property:
callLogRequest.fetchNext(onSuccess: { callLogs in
    for callLog in callLogs {
        if callLog.hasRecording {
            for recording in callLog.recordings ?? [] {
                print("Recording ID: \(recording.rid ?? "")")
                print("Recording URL: \(recording.recordingURL ?? "")")
                print("Duration: \(recording.duration) seconds")
            }
        }
    }
}, onError: { error in
    print("Error: \(error?.errorDescription ?? "")")
})
StatusDescription
ongoingCall is currently in progress
busyReceiver was busy
rejectedCall was rejected
cancelledCall was cancelled by initiator
endedCall ended normally
missedCall was missed
initiatedCall was initiated but not answered
unansweredCall was not answered
CategoryDescription
callDirect call between users
meetMeeting/conference call
DirectionDescription
incomingCall received by the user
outgoingCall initiated by the user