Skip to main content

Integrate with chat

The current Nexconn Call SDK returns call summaries and call logs through INCCallLog callbacks. The older SummaryMessageContent is no longer the primary entry point in this documentation. When you integrate with the Chat SDK or IMKit, the recommended approach is:

  1. Listen for INCCallLog callbacks after the call ends.
  2. Map INCCallLog to your own message model or conversation summary model.
  3. Insert or update the message through the Chat SDK or IMKit so the conversation view refreshes.

Callbacks for conversation UI

INCCallEventsListener currently exposes two call log related events:

CallbackDescription
onLocalCallLogReceived(INCCallLog callLog)Locally generated call summary. Most useful as a fallback for local NCCallType.SINGLE conversation display.
onServerCallLogReceived(INCCallLog callLog)Server-generated call log. Best for final conversation display and history sync.

Useful INCCallLog fields

INCCallLog currently exposes these commonly used fields for building conversation messages:

  • getCallId()
  • getCallType()
  • getMediaType()
  • getCallerUserId()
  • getParticipants()
  • getDuration()
  • getEndReason()
  • getCallDirection()
  • getStartTime()
  • getEndTime()
  • getSyncData()
Java
NCCallEngine.getInstance().setCallEventsListener(new INCCallEventsListener() {
@Override
public void onCallReceived(INCCallSession callSession, String extra) {
}

@Override
public void onCallConnected(INCCallSession callSession) {
}

@Override
public void onLocalCallLogReceived(INCCallLog callLog) {
insertCallSummaryMessage(callLog);
}

@Override
public void onServerCallLogReceived(INCCallLog callLog) {
upsertCallHistoryMessage(callLog);
}

// Implement other callbacks as needed
});

Map INCCallLog to a chat message

The following example converts a call log into a text summary for a conversation:

Java
private void insertCallSummaryMessage(INCCallLog callLog) {
String summary = buildSummary(callLog);

// Replace this with your Chat SDK or IMKit message write logic
// For example, create a custom message, a text message, or update the recent conversation summary
chatRepository.insertCallSummary(
callLog.getCallId(),
summary,
callLog.getEndTime()
);
}

private String buildSummary(INCCallLog callLog) {
String mediaText =
callLog.getMediaType() == NCCallMediaType.VIDEO ? "Video call" : "Audio call";

if (callLog.getDuration() > 0) {
return mediaText + " " + callLog.getDuration() + " seconds";
}

return mediaText + ", ended: " + callLog.getEndReason().name();
}

Recommendations

  • For immediate in-conversation display, prefer onLocalCallLogReceived(...).
  • For cross-device sync or final state correction, prefer onServerCallLogReceived(...).
  • If your conversation UI needs to distinguish incoming, outgoing, or group calls, combine getCallDirection() with getCallType().
  • If you need to persist extra business data in chat history, read the sync payload from getSyncData().