SDKsHarmonyOSEnterprise
Hang up call
Terminate an active audio or video call session.
End an active call session by sending a hangup signal to the remote participant:
Code example
import sdk, { SignalingHungUpReq } from '@openimsdk/imsdk';
const request: SignalingHungUpReq = {
invitation: invitation,
offlinePush: offlinePush,
userID: peerUserID,
};
await sdk.signalingHungUp(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
invitation | SignalingInvitationInfo | Yes | Complete call invitation object representing the current active room. |
offlinePush | OfflinePushInfo | Yes | Push notification configuration for offline participants. |
userID | string | Yes | User ID of the participant receiving the hangup signal. |
Return value
Returns a Promise that resolves to void when the hangup signal is sent.
State changes after the call
The roomID inside invitation must match the active media session. Once the Promise resolves, terminate the local call session identified by roomID, stop camera/microphone capture, depart the RTC room, and release media hardware. Remote peers receive a hangup event and exit their media channels. We recommend implementing an idempotent cleanup helper shared across cancel, reject, timeout, and hangup flows. For peer event listeners, see Handle call events.
Was this page helpful?