Skip to main content

The SDK uses the ICallSession call-session object to manage audio and video calls. For outgoing calls, obtain the call session from the return value of startSingleCall or startMultiCall. For incoming calls, obtain it through the onCallReceive callback. You can also retrieve the session for a specified callId with the following method.

ICallSession callSession = JIM.getInstance().getCallManager().getCallSession(callId);

After obtaining a call session, developers can access call properties and accept or hang up calls.

// accept the incoming call
void accept();
// hang up the call
void hangup();
// enable or disable the camera
void enableCamera(boolean isEnable);
// set the user's video view
void setVideoView(String userId, View view);
// start the preview
void startPreview(View view);
// mute or unmute the microphone
void muteMicrophone(boolean isMute);
// mute or unmute the speaker
void muteSpeaker(boolean isMute);
// enable or disable loudspeaker output
// true uses the loudspeaker; false uses the earpiece
void setSpeakerEnable(boolean isEnable);
// switch cameras; true uses the front camera by default
void useFrontCamera(boolean isEnable);
// invite users to join the call (not supported when isMultiCall is false)
void inviteUsers(List<String> userIdList);

// call ID
String getCallId();
// whether this is a group call; false indicates a one-to-one call
boolean isMultiCall();
// media type (audio/video)
CallConst.CallMediaType getMediaType();
// call status
CallConst.CallStatus getCallStatus();
// call start time (when the current user was invited in a group call; this may differ from the overall call start time)
long getStartTime();
// time when the current user joined the call
long getConnectTime();
// time when the current user left the call
long getFinishTime();
// call initiator's user ID
String getOwner();
// ID of the user who invited the current user to the call
String getInviter();
// call end reason
CallConst.CallFinishReason getFinishReason();
// call participants (excluding the current user)
List<CallMember> getMembers();
// current user
CallMember getCurrentCallMember();
// extra field
String getExtra();