WhatsApp Calling: call logs, call actions and call permissions.
Calls are negotiated with WebRTC SDP: you send an SDP offer to start an outbound call, and an SDP answer to accept an inbound one (received in the call webhook).
Summary
Functions
Accepts an inbound call with an SDP answer. Options as in connect/5.
Performs a raw call action. attrs needs at least :action
("connect", "pre_accept", "accept", "reject" or "terminate").
Starts an outbound call to to with an SDP offer.
Gets the call permission state with a user. Params: user_wa_id (phone
number) or recipient (business-scoped user ID).
Lists calls. Params: call_id, direction, status, since, until,
limit, before, after, fields.
Pre-accepts an inbound call with an SDP answer, to start media setup early.
Rejects an inbound call.
Ends an ongoing call.
Types
@type result() :: {:ok, map()} | {:error, KapsoEx.Error.t()}
Functions
Accepts an inbound call with an SDP answer. Options as in connect/5.
@spec action(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
Performs a raw call action. attrs needs at least :action
("connect", "pre_accept", "accept", "reject" or "terminate").
Starts an outbound call to to with an SDP offer.
Check get_permissions/3 first: the user must have granted permission.
Options
:biz_opaque_callback_data- echoed back in call webhooks.:recording- e.g.%{status: "ENABLED"}.:transcription- e.g.%{status: "ENABLED"}.
@spec get_permissions(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
Gets the call permission state with a user. Params: user_wa_id (phone
number) or recipient (business-scoped user ID).
Before dialing, check that actions has start_call with
can_perform_action: true.
@spec list(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
Lists calls. Params: call_id, direction, status, since, until,
limit, before, after, fields.
@spec pre_accept(KapsoEx.Client.t(), String.t(), String.t(), String.t()) :: result()
Pre-accepts an inbound call with an SDP answer, to start media setup early.
@spec reject(KapsoEx.Client.t(), String.t(), String.t()) :: result()
Rejects an inbound call.
@spec terminate(KapsoEx.Client.t(), String.t(), String.t()) :: result()
Ends an ongoing call.