feat(whatsapp-call): add call recording, transcription, beforeunload termination and documentation

This commit is contained in:
Tanmay Deep Sharma
2026-03-24 13:13:49 +05:30
parent d6eb945d25
commit 504a32214e
19 changed files with 1943 additions and 193 deletions
@@ -20,6 +20,7 @@ import {
useWhatsappCallsStore,
setOutboundCallProperty,
} from 'dashboard/stores/whatsappCalls';
import { startCallRecording } from 'dashboard/composables/useWhatsappCallSession';
const props = defineProps({
chat: {
@@ -128,6 +129,7 @@ const initiateWhatsappCall = async () => {
isInitiatingCall.value = true;
let pc = null;
let localStream = null;
let waCallId = null;
try {
localStream = await navigator.mediaDevices.getUserMedia({ audio: true });
pc = new RTCPeerConnection({
@@ -146,6 +148,8 @@ const initiateWhatsappCall = async () => {
setOutboundCallProperty('audio', audio);
// Remote audio arrived — callee picked up, transition from ringing to connected
whatsappCallsStore.markActiveCallConnected();
// Start recording both local + remote audio
if (waCallId) startCallRecording(pc, localStream, waCallId);
};
pc.oniceconnectionstatechange = () => {
@@ -186,6 +190,7 @@ const initiateWhatsappCall = async () => {
});
const outboundCallId = response.data?.call_id;
waCallId = response.data?.id;
setOutboundCallProperty('pc', pc);
setOutboundCallProperty('stream', localStream);
setOutboundCallProperty('callId', outboundCallId);