Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Accept call

Accept an incoming call invitation and retrieve room credentials.

Copy

Pass the original, complete invitation object received in incoming events or recovered during cold starts. Do not construct a partial invitation payload with only roomID.

Code example

import sdk, { Platform, SignalingAcceptReq, SignalingAcceptResp } from '@openimsdk/imsdk';

const request: SignalingAcceptReq = {
  invitation: invitation,
  offlinePush: offlinePush,
  participant: participant,
  opUserPlatformID: Platform.HarmonyOS,
  userID: invitation.inviterUserID,
};
const response: SignalingAcceptResp = await sdk.signalingAccept(request);
await mediaEngineJoin(response.roomID, response.token, response.liveURL);

Parameters

ParameterTypeRequiredDescription
invitationSignalingInvitationInfoYesComplete invitation object originally delivered by incoming call events.
offlinePushOfflinePushInfoYesPush notification configuration for offline participants.
participantSignalingParticipantMetaDataYesUser metadata of the accepting participant.
opUserPlatformIDPlatformYesPlatform identifier of the accepting device (Platform.HarmonyOS).
userIDstringYesUser ID of the inviter receiving the accept signal.

Return value

Returns a Promise that resolves to a SignalingAcceptResp object:

PropertyTypeDescription
roomIDstringThe active room identifier.
tokenstringAuthentication token for entering the RTC media room.
liveURLstringMedia stream server address.

State changes after the call

Resolving the Promise confirms that the acceptance signal was accepted by the server and returned room credentials. It does not establish media track connections; feed the credentials into your media engine to join the room. Track ongoing call and participant states using roomID and userID. For event handling across participants, see Handle call events.