Call helpers aligned with Baileys call handling in messages-recv.ts and
chats.ts.
Summary
Functions
Create a call link for audio or video.
Parse and emit an inbound call node, cache offer metadata, and send the call
ack when opts[:send_node_fun] is available.
Reject an inbound call.
Types
@type call_event() :: %{ :chat_id => String.t() | nil, :from => String.t() | nil, optional(:caller_pn) => String.t() | nil, :id => String.t(), :date => DateTime.t(), :offline => boolean(), :status => call_status(), optional(:is_video) => boolean(), optional(:is_group) => boolean(), optional(:group_jid) => String.t() | nil, optional(:latency_ms) => integer() }
@type call_status() :: :offer | :ringing | :timeout | :reject | :accept | :terminate
Functions
@spec create_call_link(term(), :audio | :video, keyword()) :: {:ok, String.t() | nil} | {:error, term()}
Create a call link for audio or video.
@spec handle_node( BaileysEx.BinaryNode.t(), keyword() ) :: {:ok, call_event()} | {:error, term()}
Parse and emit an inbound call node, cache offer metadata, and send the call
ack when opts[:send_node_fun] is available.
@spec reject_call(term(), String.t(), String.t(), keyword()) :: {:ok, BaileysEx.BinaryNode.t()} | {:error, term()}
Reject an inbound call.