Calling overview
Understand call signaling, room credentials, and event boundaries in the UniApp SDK.
The UniApp SDK provides signaling APIs to initiate, accept, reject, cancel, and hang up audio and video calls. It also enables querying active group rooms, retrieving room access credentials, and restoring pending call invitations.
The SDK manages signaling metadata and room authentication credentials; it does not capture camera frames, process microphone audio, or render call UI components. Pass the returned roomID, token, and liveURL to your chosen real-time audio/video (RTC) engine, and manage hardware permissions, media tracks, network adaptation, and UI rendering within your application layer.
Calling lifecycle
- Initiate a one-on-one call using Start a single call, or launch a conference call using Start a group call.
- When invited clients receive incoming signaling events, invoke Restore pending call invitations to reconstruct pending invitation state, then accept or reject.
- The callee joins by calling Accept a call and passing the returned room credentials to their RTC engine.
- Update UI displays based on signaling events; RTC media tracks are maintained directly by the media engine.
- The caller can abort an unanswered invitation using Cancel a call invitation, while any active participant can terminate their session using Hang up a call.
Core data structures
| Structure | Description |
|---|---|
OpenIMSignalingInvitationInfo | Metadata containing inviter, invitees, group ID, room ID, media type, timeout, and session type. |
OpenIMSignalingInviteResult | Contains invitation details, RTC credentials, and busy user IDs returned when initiating a call. |
OpenIMSignalingAcceptResult | Room connection credentials returned upon accepting an invitation. |
OpenIMSignalingGetRoomByGroupIDResult | Active group call room ID and associated invitation payload. |
Promise resolution, event delivery, and state re-queries represent three distinct phases:
- A resolved Promise confirms that the signaling request reached OpenIMServer.
- Real-time signaling events inform other devices of the transition.
- Re-query APIs allow the app to synchronize state after returning to the foreground or reconnecting.
Calling events deliver raw payload strings without exposed internal schemas. Use events as invalidation signals to re-query strongly typed call data through the retrieval APIs. Identify call sessions using roomID, and track individual participants by combining roomID with user IDs. For event handling, see Handle call events.
Quick reference
| Task | Guide |
|---|---|
| Initiate a call | Start a single call, Start a group call |
| Respond to an invitation | Accept a call, Reject a call |
| Terminate a session | Cancel a call invitation, Hang up a call |
| Restore call credentials | Restore pending call invitations, Get room by group ID, Get token by room ID |
| In-call signaling | Send a custom signal |
Was this page helpful?