From be505b8d1f6356047349cef2a2f6018b4751d6d7 Mon Sep 17 00:00:00 2001 From: saridsa2 Date: Fri, 10 Apr 2026 19:27:09 +0530 Subject: [PATCH] fix: #540 ignore call events for offline agents in live monitor Co-Authored-By: Claude Opus 4.6 (1M context) --- src/supervisor/supervisor.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/supervisor/supervisor.service.ts b/src/supervisor/supervisor.service.ts index a3b72c4..85e2355 100644 --- a/src/supervisor/supervisor.service.ts +++ b/src/supervisor/supervisor.service.ts @@ -68,6 +68,12 @@ export class SupervisorService implements OnModuleInit { if (!ucid) return; if (action === 'Answered' || action === 'Calling') { + // Don't show calls for offline agents (ghost calls) + const agentState = this.agentStates.get(agentId); + if (agentState?.state === 'offline') { + this.logger.warn(`Ignoring call event for offline agent ${agentId} (${ucid})`); + return; + } this.activeCalls.set(ucid, { ucid, agentId, callerNumber, callType, startTime: eventTime, status: 'active',