fix: inbound and outbound email

This commit is contained in:
Tanmay Deep Sharma
2026-03-16 16:18:59 +05:30
parent 98e4a1e6dc
commit c813505e7d
8 changed files with 263 additions and 65 deletions
@@ -38,6 +38,7 @@ class ActionCableConnector extends BaseActionCableConnector {
'whatsapp_call.incoming': this.onWhatsappCallIncoming,
'whatsapp_call.accepted': this.onWhatsappCallAccepted,
'whatsapp_call.ended': this.onWhatsappCallEnded,
'whatsapp_call.outbound_connected': this.onWhatsappCallOutboundConnected,
'whatsapp_call.permission_granted': this.onWhatsappCallPermissionGranted,
};
}
@@ -237,6 +238,20 @@ class ActionCableConnector extends BaseActionCableConnector {
whatsappCallsStore.handleCallEnded(data.call_id);
};
// eslint-disable-next-line class-methods-use-this
onWhatsappCallOutboundConnected = data => {
// When Meta sends the SDP answer for an outbound call, set it on the peer connection
const pc = window.__outboundCallPC;
if (pc && window.__outboundCallId === data.call_id && data.sdp_answer) {
pc.setRemoteDescription({ type: 'answer', sdp: data.sdp_answer }).catch(
err => {
// eslint-disable-next-line no-console
console.error('[WhatsApp Call] Failed to set remote SDP answer:', err);
}
);
}
};
// eslint-disable-next-line class-methods-use-this
onWhatsappCallPermissionGranted = data => {
emitter.emit(BUS_EVENTS.SHOW_ALERT, {