Skip to content

feat(whatsapp): add in-app voice calling - #1187

Draft
viethung0o0 wants to merge 3 commits into
mainfrom
feat/whatsapp-calling
Draft

viethung0o0 wants to merge 3 commits into
mainfrom
feat/whatsapp-calling

Conversation

@viethung0o0

@viethung0o0 viethung0o0 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Answer inbound WhatsApp calls in the inbox — every available agent rings, the first to answer takes the call.
  • Place outbound calls from a conversation, requesting call permission from the customer when required.
  • Calls are recorded and transcribed by Meta, with an on-demand AI summary, all shown on the call card in the conversation.
  • Per-number calling settings: enable calling, recording, retention, and transcription.

Test plan

  • pnpm lint
  • pnpm turbo run check-types
  • pnpm test
  • Run db:migrate on deploy

Self-hosted WhatsApp Business Calling on FreeSWITCH + coturn, replacing
the LiveKit transport end to end:

- Database: WhatsappCall, AgentSipPresence, UserSoftphoneCredential,
  WorkspaceSipNode schema, repositories, relations and migrations.
- Business: SIP provisioning, softphone credentials, agent presence and
  ring targeting, node allocation, call recording/transcription, and the
  FreeSWITCH ESL/xml_curl service layer.
- Worker: FreeSWITCH ESL consumer with leader election, event batcher,
  reconciliation, recording sweep, and call finalize/transcribe handlers.
- Builder: calling settings, softphone dock, SIP provisioning and start/
  hangup actions, mod_xml_curl responder, and the call-on-whatsapp flow
  step; i18n across all locales.
- Infra: docker/freeswitch + coturn stack, compose services, SIP preflight
  and Meta ACL scripts, and docs/whatsapp-calling.md.
…-safe

- freeswitch: install freeswitch-conf-vanilla (vanilla config the meta
  package omits), self-sign wss.pem for local TLS/WSS profiles, drop the
  stock internal/external profiles, move the meta_sip_ranges ACL fragment
  out of autoload_configs, un-embed an X-PRE-PROCESS tag from a comment,
  and fix the healthcheck to pass the ESL password.
- webhook: verify the X-Hub-Signature-256 HMAC with Web Crypto
  (@chatbotx.io/utils/crypto) instead of node:crypto so the WhatsApp
  integration stays edge-bundle-safe when the oRPC router graph is pulled
  into the Next.js edge runtime; drop the now-unused utils/node-crypto.
Replaces the self-hosted media-server transport with direct browser-to-Meta
calling, adds outbound calls, Meta-native recording and transcription, and
AI call summaries.
@github-actions github-actions Bot added the feature New feature or request label Sep 15, 2026
@viethung0o0 viethung0o0 changed the title feat(whatsapp): in-app calling over browser WebRTC feat(whatsapp): add in-app voice calling Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants