Documentation Index Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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.
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 } " )
}
})
CallLogRequest callLogRequest = new CallLogRequest. CallLogRequestBuilder ()
. setLimit ( 30 )
. build ();
callLogRequest . fetchNext ( new CometChatCalls . CallbackListener < List < CallLog >>() {
@ Override
public void onSuccess ( List < CallLog > callLogs ) {
for ( CallLog callLog : callLogs) {
Log . d (TAG, "Session: " + callLog . getSessionID ());
Log . d (TAG, "Duration: " + callLog . getTotalDuration ());
Log . d (TAG, "Status: " + callLog . getStatus ());
}
}
@ Override
public void onError ( CometChatException e ) {
Log . e (TAG, "Error: " + e . getMessage ());
}
});
CallLogRequestBuilder
Configure the request using the builder methods:
Method Type Description setLimit(int)int 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
// Fetch only video calls
val videoCallsRequest = CallLogRequest. CallLogRequestBuilder ()
. setSessionType ( "video" )
. setLimit ( 20 )
. build ()
// Fetch calls with recordings
val recordedCallsRequest = CallLogRequest. CallLogRequestBuilder ()
. setHasRecording ( true )
. build ()
// Fetch missed incoming calls
val missedCallsRequest = CallLogRequest. CallLogRequestBuilder ()
. setCallStatus ( "missed" )
. setCallDirection ( "incoming" )
. build ()
// Fetch calls with a specific user
val userCallsRequest = CallLogRequest. CallLogRequestBuilder ()
. setUid ( "user_id" )
. build ()
// Fetch only video calls
CallLogRequest videoCallsRequest = new CallLogRequest. CallLogRequestBuilder ()
. setSessionType ( "video" )
. setLimit ( 20 )
. build ();
// Fetch calls with recordings
CallLogRequest recordedCallsRequest = new CallLogRequest. CallLogRequestBuilder ()
. setHasRecording ( true )
. build ();
// Fetch missed incoming calls
CallLogRequest missedCallsRequest = new CallLogRequest. CallLogRequestBuilder ()
. setCallStatus ( "missed" )
. setCallDirection ( "incoming" )
. build ();
// Fetch calls with a specific user
CallLogRequest userCallsRequest = new CallLogRequest. CallLogRequestBuilder ()
. setUid ( "user_id" )
. build ();
Use fetchNext() and fetchPrevious() for pagination:
// Fetch next page
callLogRequest. 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 page
callLogRequest. 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 page
callLogRequest . 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 page
callLogRequest . 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 sessionIDString Unique identifier for the call session initiatorCallEntity User who initiated the call receiverCallEntity User or group that received the call receiverTypeString user or grouptypeString Call type: video or audio statusString Final status of the call callCategoryString Category: call or meet initiatedAtlong Timestamp when call was initiated endedAtlong Timestamp when call ended totalDurationString Human-readable duration (e.g., “5:30”) totalDurationInMinutesdouble Duration in minutes totalAudioMinutesdouble Audio duration in minutes totalVideoMinutesdouble Video duration in minutes totalParticipantsint Number of participants hasRecordingboolean Whether the call was recorded recordingsList<Recording> List of recording objects participantInfoListList<ParticipantInfo> List of participant details
Access Recordings
If a call has recordings, access them through the recordings property:
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 } " )
}
})
callLogRequest . fetchNext ( new CometChatCalls . CallbackListener < List < CallLog >>() {
@ Override
public void onSuccess ( List < CallLog > callLogs ) {
for ( CallLog callLog : callLogs) {
if ( callLog . isHasRecording ()) {
for ( Recording recording : callLog . getRecordings ()) {
Log . d (TAG, "Recording ID: " + recording . getRid ());
Log . d (TAG, "Recording URL: " + recording . getRecordingURL ());
Log . d (TAG, "Duration: " + recording . getDuration () + " seconds" );
}
}
}
}
@ Override
public void onError ( CometChatException e ) {
Log . e (TAG, "Error: " + e . getMessage ());
}
});
Status Description 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
Category Description callDirect call between users meetMeeting/conference call
Direction Description incomingCall received by the user outgoingCall initiated by the user