Making a Call in a Chat#
1. Initiate the Call#
call state#
the call can be:
ringing: when the receiver is online;
missed: the receiver is not active, or they are, but chooses not to respond for sometime, before the caller then ends the call;
accepted: when the receiver accepts the call;
rejected: when the receiver rejects the call;
ended: when either participant hangs up;the receiver gets notified#
once the caller
makes the call, the receiver
, if alive on the socket, receives an event with the action type user-calling
;2. Receiver Responds to the Call#
the receiver responds to the call by sending any of the action types, accept-call
or reject-call
, to the caller;the caller gets notified of the receiver's response#
once the receiver accepts or rejects the call, the caller, if alive on the socket, receives a corresponding event type, call-accepted
or call-rejected
, based on the receiver's response;3. When Connected or Disconnected#
when a call has been accepted and connected, after some session exchange, a call-connected
action should be emitted to the socketsometimes, users are still on call, but due to network, the call gets disconnected, and there may be an attempt to reconnect the client users, a call-disconnected
should be emitted to the socket, if possible; once the connection is restored, call-connected
should be emitted to the socket again.this helps to estimate the duration of the call.4. Hanging Up#
any of the participants can hang up an ongoing-call with the action end-call
; then, both get a response event on the same action type;Modified at 2025-06-15 05:49:23