Skip to content

Calls ​

Who: listener on a registered device; system (ring timeouts, sweeps, reminders).

Entry points ​

KindEntry
RESTPOST /calls, GET /calls/:id, POST /calls/:id/accept, /decline, /end, /invite, /join, /token, GET /calls/:id/session, GET/POST /calls/:id/messages, POST /calls/:id/participants/:userId/remove, /mute, PUT …/role, POST /calls/:id/end-all
REST (history)GET /calls/history, GET /calls/history/missed-count, POST /calls/history/seen, DELETE /calls/history/:logId
REST (links)POST /call-links, GET /call-links/upcoming, GET /call-links/:code, POST /call-links/:code/join, POST /call-links/:code/rsvp, POST /call-links/:id/cancel, DELETE /call-links/:id
Socket /callcall:start, call:ringing, call:accept, call:decline, call:end, call:invite, call:join, call:join-link, call:state, call:upgrade-request, call:upgrade-respond, call:screen-share, call:renew-token, call:heartbeat, call:session, call:mute, call:camera, call:camera-switch, call:audio-route, call:hold, call:network, call:hand, call:hand-lower, call:share-start, call:share-stop, call:reaction, call:message, call:messages, call:participant-add, call:participant-remove, call:participant-mute, call:role, call:end-all, call:get
Deep linkcall (call/:code, call links)
Pushcall.incoming (VoIP: PushKit / FCM high), call.missed, call.scheduled, call.starting_soon

Flow ​

  1. Start: call:start { userIds | conversationId, media } → ringing, CallSession with Agora credentials and aes_256_gcm2 key; event calls.call.started. Callees blocked or refusing by who_can_call are skipped (group) or refused (1:1).
  2. Ring: call:incoming to every callee device + call.incoming VoIP push; callee device sends call:ringing. calls.ring-timeout (45 s) marks missed.
  3. Answer: call:accept → accepted; other devices of the callee get call:answered-elsewhere. call:decline → declined; another active call → CALL_BUSY / call:busy.
  4. In call: heartbeat every 30 s (90 s silence = left); toggles call:mute, call:camera, call:hold, call:hand, call:share-start (own screen uid), call:upgrade-request audio→video, call:reaction, call:message. Each broadcasts call:participant-updated. call:renew-token before expiry. Reconnect → call:session snapshot.
  5. Add people: call:participant-add { userIds } (rings them); joiners in progress use call:join. Moderators remove/mute; owner/admin set roles, call:end-all.
  6. End: call:end (last one out ends it) → ended, call:ended, event calls.call.ended, call-log rows and a chat timeline item. Time-limit warning 2 min before 4 h. calls.sweep (minutely) settles lost timers.
  7. Scheduled: POST /call-links { title, scheduledStartAt, invitees } → call.scheduled to invitees; rsvp; call.starting_soon 10 min before; join opens 15 min early (CALL_NOT_STARTED before, except for the creator); POST /call-links/:code/join or call:join-link.
  1. A call link (https://spread.plemuz.com/call/<code>, links.call) opens the guest-safe preview: title, host, start time, whether the call is live and how many people are in it.
  2. Joining requires sign-in. A guest gets UNAUTHENTICATED with a sign_in action that returns to the link.
    • A scheduled call opens 15 minutes before its start (CALL_NOT_STARTED before that, except for the creator).
    • On the link, the user either joins the call already running there or starts one.
  3. The link's creator can rotate it (new code, old one dead), reset it (fresh link with the same settings and invitees) or revoke it.
  4. Inside an ongoing group call, moderators and up can create a shareable link (POST /calls/:id/link or call:link-create); repeating the request returns the same link.

Exit states ​

StateCodeActionsClient next
Connected——Join Agora with rtc
BusyCALL_BUSYretry—
Blocked / not allowedCALL_BLOCKED, CALL_NOT_ALLOWED——
Device not boundCALL_DEVICE_REQUIREDsign_in—
Too manyCALL_PARTICIPANT_LIMIT——
EndedCALL_ALREADY_ENDED, CALL_INVALID_TRANSITION—Close the call screen
LinkCALL_LINK_INVALID, CALL_LINK_EXPIRED, CALL_NOT_STARTED (wait)as listed—
Screen takenCALL_SCREEN_SHARE_TAKEN——
Agora downCALL_PROVIDER_UNAVAILABLEretry—

Known gaps ​

  • call.incoming uses plemuz://call/<callId>, which the registry reads as a call-link code; call.missed uses plemuz://calls, which has no screen (I11).
  • Calls has an export section but no erasure consumer, so call logs and links survive account deletion (B3).

Plemuz API v2