fix: outbound call — End Call label, force active state after auto-answer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 21:33:40 +05:30
parent 26b9d93f32
commit f454f2e682
2 changed files with 4 additions and 3 deletions

View File

@@ -124,7 +124,7 @@ export const ActiveCallCard = ({ lead, callerPhone }: ActiveCallCardProps) => {
</div> </div>
<div className="mt-3 flex gap-2"> <div className="mt-3 flex gap-2">
<Button size="sm" color="primary-destructive" onClick={() => { hangup(); handleReset(); }}> <Button size="sm" color="primary-destructive" onClick={() => { hangup(); handleReset(); }}>
Cancel End Call
</Button> </Button>
</div> </div>
</div> </div>

View File

@@ -50,10 +50,11 @@ export function connectSip(config: SIPConfig): void {
// Auto-answer SIP when it's a bridge from our outbound Kookoo call // Auto-answer SIP when it's a bridge from our outbound Kookoo call
if (state === 'ringing-in' && outboundPending) { if (state === 'ringing-in' && outboundPending) {
outboundPending = false; outboundPending = false;
// Auto-answer after a brief delay to let SIP negotiate console.log('[SIP] Outbound bridge detected — auto-answering');
setTimeout(() => { setTimeout(() => {
sipClient?.answer(); sipClient?.answer();
stateUpdater?.setCallState('active'); // Force active state in case SIP callbacks don't fire
setTimeout(() => stateUpdater?.setCallState('active'), 300);
}, 500); }, 500);
return; return;
} }