SDKsHarmonyOSEnterprise
Cancel call
Cancel an unanswered call invitation by the calling initiator.
Use signalingCancel() to cancel an outgoing call invitation before the callee answers:
Code example
import sdk, { SignalingCancelReq } from '@openimsdk/imsdk';
const request: SignalingCancelReq = {
invitation: invitation,
offlinePush: offlinePush,
participant: participant,
userID: peerUserID,
};
await sdk.signalingCancel(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
invitation | SignalingInvitationInfo | Yes | The complete invitation object originally sent by the caller. |
offlinePush | OfflinePushInfo | Yes | Push notification payload delivered to offline devices. |
participant | SignalingParticipantMetaData | Yes | User metadata of the caller. |
userID | string | Yes | User ID of the invitee receiving the cancellation signal. |
Return value
Returns a Promise that resolves to void upon cancellation delivery.
State changes after the call
Once the Promise resolves, terminate the outgoing ringing view identified by roomID and release calling media resources. The callee receives an invitation cancelled event and dismisses their incoming call screen. For active calls that are already connected, use Hang up call instead. To handle remote cancellation notifications, see Handle call events.
Was this page helpful?