OpenWA icon indicating copy to clipboard operation
OpenWA copied to clipboard

[Feature]: Outgoing voice/video call initiation and live audio streaming

Open Princekumarofficial opened this issue 3 months ago • 1 comments

Pre-flight

  • [x] I searched existing issues and this isn't already requested

Problem / motivation

OpenWA currently has incoming-call-only support: the gateway can reject ringing calls and generate shareable call links (which WhatsApp users click to initiate calls), but it cannot:

  1. Initiate outgoing calls — Programmatically calling a WhatsApp user from the API
  2. Handle live audio/video — Accept incoming calls and stream audio back
  3. Conduct voice conversations — Participate in active calls with real-time audio I/O
  4. IVR automation — Build voice-based interactive systems (order placement, appointment confirmation, etc.)

Use Cases That Cannot Be Implemented Today

  • Voice IVR systems — "Press 1 for orders, 2 for support" via WhatsApp voice calls
  • Automated appointment confirmations — Call to confirm rather than send a text
  • Voice notifications — Deliver alerts via voice for time-critical issues
  • Voice-activated customer service — Hands-free order tracking or billing inquiries
  • Crisis alert systems — Voice-based emergency notifications requiring voice confirmation
  • Real-time call handling — Route incoming calls to third-party platforms with

Proposed solution

No response

Alternatives considered

  1. Use Twilio/Vonage for voice calls + OpenWA for messaging (RECOMMENDED)

    • Pros: Production-ready, full IVR control, works today
    • Cons: Per-minute costs, user must click link to join
    • Best for: Customer support, appointment confirmations, voice notifications
  2. Build a custom SIP/WebRTC bridge for your own deployment

    • Pros: Full control, no third-party dependency
    • Cons: Requires engineering expertise, maintenance burden, 2-3 month build
    • Best for: Large enterprises with dedicated telecom team
  3. Wait for WhatsApp Cloud API improvements

    • WhatsApp may eventually expose call APIs to third-party developers
    • Current status: No timeline announced
    • Monitor: https://developers.facebook.com/docs/whatsapp/
  4. Use OpenWA for messaging only + separate voice platform

    • Pros: Best separation of concerns, most reliable
    • Cons: Two systems to manage
    • Best for: Existing deployments with dedicated call infrastructure
  5. Contribute protocol reverse-engineering to Baileys (not recommended)

    • Pros: Would eventually benefit all Baileys users
    • Cons: High risk, constant maintenance, E2EE liability
    • Verdict: Baileys team does not actively pursue this

Scope

  • [x] I understand some features are limited by the underlying WhatsApp engine (e.g. interactive Buttons/List messages are not supported on whatsapp-web.js).

Princekumarofficial avatar Aug 21 '26 08:08 Princekumarofficial

Thanks for this, and for an unusually careful write-up. The problem statement is accurate: the gateway rejects ringing calls and creates call links, and that is the whole of it today. Your "Alternatives considered" section is the most useful part of the issue, and it reaches the same conclusion I have to.

I am closing it as out of reach rather than leaving it as a backlog item, because that distinction matters to anyone who finds this later and starts costing the work.

Why this is not a wiring job

Neither engine library exposes call initiation or call media, so there is nothing for an adapter to call.

Baileys 7.0.0-rc14 exposes exactly three call methods: rejectCall, createCallLink and updateCallPrivacy. Its WACallUpdateType is offer | ringing | preaccept | transport | relaylatency | timeout | reject | accept | terminate, an inbound state machine with no outbound entry point at all. whatsapp-web.js 1.34.7 has one, rejectCall.

So the task is not "add an adapter method". It is implementing WhatsApp's call signalling and media transport against a protocol neither library models and neither vendor documents, then maintaining it against changes that arrive without notice.

I do want to be careful not to overstate the technical barrier, because one version of this argument is wrong. The whatsapp-web.js engine runs a full Chromium, so a complete WebRTC stack is already present in the page, and our existing reject path is itself a hand-built stanza inside it. The blocker is not a missing media stack. It is the signalling protocol, the ongoing maintenance surface, and the end-to-end-encryption exposure your own item 5 names. That is not something this project can carry responsibly.

What exists today, and one limit worth knowing

Since you may be designing around this:

  • POST /api/sessions/{sessionId}/calls/link creates a shareable audio or video call link. The recipient still has to click it, which is exactly the constraint your alternative 1 names.
  • POST /api/sessions/{sessionId}/calls/{callId}/reject rejects a specific ringing call, and "config": { "autoRejectCalls": true } on a session rejects every incoming call automatically. The call.received event still fires first either way, so automations keep visibility.

One caveat before you build on that last part: the call OUTCOME (accepted, rejected, missed) is emitted on the Baileys engine only. whatsapp-web.js reports the ring and nothing after it, so call routing built on the default engine gets half the signal. If outcomes matter to your design, run Baileys.

The recommendation

Your alternative 1 is the right one and it is the advice I would give unprompted. Twilio or Vonage for the voice leg, this gateway for messaging, correlated on your side by phone number. That works today, carries no account risk, and every voice feature on your list is reachable that way.

If WhatsApp ever exposes call APIs to third-party clients, this becomes a different conversation and is worth reopening then. Until it does, there is no version of this I can honestly promise.

rmyndharis avatar Sep 03 '26 05:09 rmyndharis