## Summary Frontend for WhatsApp Cloud Calling: header / contact-panel call buttons, ringing widget, accept/reject/hangup, mute, in-bubble audio player + transcript, recording-on-hangup upload, mid-call reload warning. WebRTC is browser-direct to Meta — no media server bridge. ## Closes - https://linear.app/chatwoot/issue/PLA-150 ## How to test Requires backend support — the controller, services, model changes, and routes ship in **#14334** (`feature/pla-150`). Merge / deploy that first (or simultaneously); the FE alone won't function without those endpoints. Then on staging, for a WhatsApp Cloud + embedded-signup inbox with the new \`Configuration → Enable voice calling\` toggle ON and webhook registered: 1. **Outbound** — open a conversation, click the phone icon in the conversation header (or contact panel), grant mic, your phone rings, answer, audio both ways, hang up. Recording + transcript land in the bubble within ~10s. 2. **Inbound** — call the business number from your phone. The FloatingCallWidget appears bottom-right with caller name. Click accept, audio both ways, hang up. Recording + transcript appear. 3. **Mute** — during an active WhatsApp call, click the mic icon next to hangup. Speech stops reaching Meta until you click again. 4. **Mid-call reload guard** — try `Cmd-R` during an active call; browser shows a confirm prompt. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: iamsivin <iamsivin@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
31 lines
865 B
Vue
31 lines
865 B
Vue
<script setup>
|
|
import { computed, toRef } from 'vue';
|
|
import { isVoiceCallEnabled } from 'dashboard/helper/inbox';
|
|
import { useChannelIcon } from './provider';
|
|
import Icon from 'next/icon/Icon.vue';
|
|
|
|
const props = defineProps({
|
|
inbox: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
});
|
|
|
|
defineOptions({ inheritAttrs: false });
|
|
|
|
const channelIcon = useChannelIcon(toRef(props, 'inbox'));
|
|
const hasVoiceBadge = computed(() => isVoiceCallEnabled(props.inbox));
|
|
</script>
|
|
|
|
<template>
|
|
<span class="relative inline-flex" v-bind="$attrs">
|
|
<Icon :icon="channelIcon" class="size-full" />
|
|
<span
|
|
v-if="hasVoiceBadge"
|
|
class="absolute top-0 ltr:right-0 rtl:left-0 inline-flex items-center justify-center size-2 rounded-full bg-n-surface-1"
|
|
>
|
|
<Icon icon="i-lucide-audio-lines" class="size-1.5 text-n-slate-12" />
|
|
</span>
|
|
</span>
|
|
</template>
|