TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wppconnect-team/wa-js/llms.txt
Use this file to discover all available pages before exploring further.
WPP.call module exposes WhatsApp Web’s calling layer through five functions and one event. It lets you send outgoing call offers (voice or video), accept or reject incoming calls identified by their call ID, terminate active or ringing calls, and enable the calling UI on WhatsApp Web desktop. All signalling is performed over WhatsApp’s SMAX WebSocket protocol — the functions negotiate codecs and encryption keys, then dispatch the appropriate stanza to the peer.
Functions
offer
Send a call offer to a contact, initiating a voice or video call.
The JID of the contact to call. Must be a user JID (
[number]@c.us). Group call JIDs are not supported by this function.Promise<CallModel> — the internal CallModel instance for the outgoing call, with the initial state OUTGOING_CALLING. The model’s id can be used with end to cancel the call.
offer builds a call offer stanza with Opus audio codec (at 16 kHz and 8 kHz) and, when isVideo is true, VP8 video. A 256-bit encryption key is generated client-side and included in the offer via <dest> elements.accept
Accept an incoming call. If no callId is provided, the first call in INCOMING_RING state (or the first group call) is accepted.
The call ID to accept. Omit to accept the first available incoming call automatically.
Promise<boolean> — resolves true after the accept stanza is successfully sent to the peer.
The accept stanza negotiates the same Opus audio codecs as the original offer, plus VP8 video if the incoming call is a video call.
reject
Reject an incoming call. Sends a reject stanza to the caller. If no callId is given, the first ringing call (including group calls) is rejected.
reject is also exported as the alias rejectCall:
The call ID to reject. Omit to reject the first available incoming call.
Promise<boolean> — resolves true after the reject stanza is sent.
end
End an active or outgoing call. Works for calls in ACTIVE, OUTGOING_CALLING, OUTGOING_RING, or CallActive states. If callId is omitted, the store’s active call is used.
The call ID to terminate. Omit to end the currently active call.
Promise<boolean> — resolves true after the terminate stanza is sent to the peer.
enableCallInterface
Patch WhatsApp Web’s internal A/B feature flags to enable the calling UI on the web/desktop client. This is necessary because WhatsApp Web disables calling by default unless an internal flag (enable_web_calling) is set.
void — this function applies a wrapModuleFunction patch that intercepts getABPropConfigValue and overrides the following keys:
| Key | Overridden value |
|---|---|
enable_web_calling | true |
enable_web_group_calling | true |
web_voip_call_tab_new_call | true |
calling_lid_version | 1 |
heartbeat_interval_s | 5 |
Events
call.incoming_call
Emitted when WhatsApp Web processes an incoming call offer via CallStore.processIncomingCall.
Event payload fields
Event payload fields
| Field | Type | Description |
|---|---|---|
id | string | Unique call ID. Pass this to accept, reject, or end. |
isGroup | boolean | true if this is a group call. |
isVideo | boolean | true if the call includes a video track. |
offerTime | number | Unix timestamp when the offer was sent. |
sender | Wid | WhatsApp ID of the caller (without device suffix). |
peerJid | Wid | Full peer JID including device ID. |
processIncomingCall is invoked multiple times for the same call.
Common patterns
Enable calling and make a voice call
Enable calling and make a voice call
Auto-reject all incoming calls
Auto-reject all incoming calls
Accept the first incoming call then end after 10 seconds
Accept the first incoming call then end after 10 seconds
Log all incoming call metadata
Log all incoming call metadata