Display CometChat Calls SDK v5 call logs on Android with call history, participants, call type, duration, and status details.
Retrieve call history for your application. Call logs provide detailed information about past calls including duration, participants, recordings, and status.
Fetch Call Logs
Use CallLogRequest to fetch call logs with pagination support. The builder pattern allows you to filter results by various criteria.
Kotlin
Java
val callLogRequest = CallLogRequest.CallLogRequestBuilder() .setLimit(30) .build()callLogRequest.fetchNext(object : CometChatCalls.CallbackListener<List<CallLog>>() { override fun onSuccess(callLogs: List<CallLog>) { for (callLog in callLogs) { Log.d(TAG, "Session: ${callLog.sessionID}") Log.d(TAG, "Duration: ${callLog.totalDuration}") Log.d(TAG, "Status: ${callLog.status}") } } override fun onError(e: CometChatException) { Log.e(TAG, "Error: ${e.message}") }})
Number of call logs to fetch per request (default: 30, max: 100)
setSessionType(String)
String
Filter by call type: video or audio
setCallStatus(String)
String
Filter by call status
setHasRecording(boolean)
boolean
Filter calls that have recordings
setCallCategory(String)
String
Filter by category: call or meet
setCallDirection(String)
String
Filter by direction: incoming or outgoing
setUid(String)
String
Filter calls with a specific user
setGuid(String)
String
Filter calls with a specific group
Filter Examples
Kotlin
Java
// Fetch only video callsval videoCallsRequest = CallLogRequest.CallLogRequestBuilder() .setSessionType("video") .setLimit(20) .build()// Fetch calls with recordingsval recordedCallsRequest = CallLogRequest.CallLogRequestBuilder() .setHasRecording(true) .build()// Fetch missed incoming callsval missedCallsRequest = CallLogRequest.CallLogRequestBuilder() .setCallStatus("missed") .setCallDirection("incoming") .build()// Fetch calls with a specific userval userCallsRequest = CallLogRequest.CallLogRequestBuilder() .setUid("user_id") .build()
// Fetch only video callsCallLogRequest videoCallsRequest = new CallLogRequest.CallLogRequestBuilder() .setSessionType("video") .setLimit(20) .build();// Fetch calls with recordingsCallLogRequest recordedCallsRequest = new CallLogRequest.CallLogRequestBuilder() .setHasRecording(true) .build();// Fetch missed incoming callsCallLogRequest missedCallsRequest = new CallLogRequest.CallLogRequestBuilder() .setCallStatus("missed") .setCallDirection("incoming") .build();// Fetch calls with a specific userCallLogRequest userCallsRequest = new CallLogRequest.CallLogRequestBuilder() .setUid("user_id") .build();
Pagination
Use fetchNext() and fetchPrevious() for pagination:
Kotlin
Java
// Fetch next pagecallLogRequest.fetchNext(object : CometChatCalls.CallbackListener<List<CallLog>>() { override fun onSuccess(callLogs: List<CallLog>) { // Handle next page } override fun onError(e: CometChatException) { Log.e(TAG, "Error: ${e.message}") }})// Fetch previous pagecallLogRequest.fetchPrevious(object : CometChatCalls.CallbackListener<List<CallLog>>() { override fun onSuccess(callLogs: List<CallLog>) { // Handle previous page } override fun onError(e: CometChatException) { Log.e(TAG, "Error: ${e.message}") }})
// Fetch next pagecallLogRequest.fetchNext(new CometChatCalls.CallbackListener<List<CallLog>>() { @Override public void onSuccess(List<CallLog> callLogs) { // Handle next page } @Override public void onError(CometChatException e) { Log.e(TAG, "Error: " + e.getMessage()); }});// Fetch previous pagecallLogRequest.fetchPrevious(new CometChatCalls.CallbackListener<List<CallLog>>() { @Override public void onSuccess(List<CallLog> callLogs) { // Handle previous page } @Override public void onError(CometChatException e) { Log.e(TAG, "Error: " + e.getMessage()); }});
CallLog Object
Each CallLog object contains detailed information about a call:
Property
Type
Description
sessionID
String
Unique identifier for the call session
initiator
CallEntity
User who initiated the call
receiver
CallEntity
User or group that received the call
receiverType
String
user or group
type
String
Call type: video or audio
status
String
Final status of the call
callCategory
String
Category: call or meet
initiatedAt
long
Timestamp when call was initiated
endedAt
long
Timestamp when call ended
totalDuration
String
Human-readable duration (e.g., “5:30”)
totalDurationInMinutes
double
Duration in minutes
totalAudioMinutes
double
Audio duration in minutes
totalVideoMinutes
double
Video duration in minutes
totalParticipants
int
Number of participants
hasRecording
boolean
Whether the call was recorded
recordings
List<Recording>
List of recording objects
participantInfoList
List<ParticipantInfo>
List of participant details
Access Recordings
If a call has recordings, access them through the recordings property:
Kotlin
Java
callLogRequest.fetchNext(object : CometChatCalls.CallbackListener<List<CallLog>>() { override fun onSuccess(callLogs: List<CallLog>) { for (callLog in callLogs) { if (callLog.isHasRecording) { callLog.recordings?.forEach { recording -> Log.d(TAG, "Recording ID: ${recording.rid}") Log.d(TAG, "Recording URL: ${recording.recordingURL}") Log.d(TAG, "Duration: ${recording.duration} seconds") } } } } override fun onError(e: CometChatException) { Log.e(TAG, "Error: ${e.message}") }})