fix: #540 ignore call events for offline agents in live monitor

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 19:27:09 +05:30
parent dbefa9675a
commit be505b8d1f

View File

@@ -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',