SDKsHarmonyOSEnterprise
Query group call room
Retrieve the active calling room associated with a group ID.
Query whether a specific group has an ongoing audio or video call session:
Code example
import sdk, { SignalingGetRoomByGroupIDReq, SignalingGetRoomByGroupIDResp } from '@openimsdk/imsdk';
const request: SignalingGetRoomByGroupIDReq = { groupID: groupID };
const response: SignalingGetRoomByGroupIDResp = await sdk.signalingGetRoomByGroupID(request);
if (response.roomID.length > 0) {
restoreGroupCall(response.roomID, response.invitation, response.participants);
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
Return value
Returns a Promise that resolves to a SignalingGetRoomByGroupIDResp object:
| Property | Type | Description |
|---|---|---|
roomID | string | Room identifier. An empty string indicates no call is currently active in this group. |
invitation | SignalingInvitationInfo | Complete call invitation object for the active session. |
participants | SignalingParticipantMetaData[] | List of participants currently present in the room. |
State changes after the call
An empty roomID confirms that there is no active call in the specified group. When a non-empty roomID is returned, call Get call room credentials to obtain the credentials required to join the RTC channel. If the query rejects due to network failure, do not treat the error as an empty room state; retry when the network is restored.
Was this page helpful?