diff --git a/src/components/call-desk/active-call-card.tsx b/src/components/call-desk/active-call-card.tsx index 145c7fb..b0f0a31 100644 --- a/src/components/call-desk/active-call-card.tsx +++ b/src/components/call-desk/active-call-card.tsx @@ -105,7 +105,11 @@ export const ActiveCallCard = ({ lead, callerPhone, missedCallId, onCallComplete const agentConfig = localStorage.getItem('helix_agent_config'); const agentIdForState = agentConfig ? (() => { try { return JSON.parse(agentConfig).ozonetelAgentId; } catch { return null; } })() : null; - const { supervisorPresence } = useAgentState(agentIdForState); + const { state: ozonetelState, supervisorPresence } = useAgentState(agentIdForState); + // For outbound calls, SIP goes 'active' when the agent's bridge connects + // (before customer answers). Ozonetel state stays 'calling' until customer + // picks up, then transitions to 'in-call'. Use this to gate action buttons. + const customerAnswered = callState === 'active' && ozonetelState !== 'calling'; const callDirectionRef = useRef(callState === 'ringing-out' ? 'OUTBOUND' : 'INBOUND'); const wasAnsweredRef = useRef(callState === 'active'); @@ -275,7 +279,7 @@ export const ActiveCallCard = ({ lead, callerPhone, missedCallId, onCallComplete // Active call if (callState === 'active' || dispositionOpen) { - wasAnsweredRef.current = true; + if (customerAnswered) wasAnsweredRef.current = true; return ( <>
@@ -357,17 +361,17 @@ export const ActiveCallCard = ({ lead, callerPhone, missedCallId, onCallComplete