fix: skip outbound calls in webhook + filter abandon polls by campaign

Webhook controller now skips outbound calls (type=Manual/OutBound).
An unanswered outbound dial is NOT a missed inbound call — it was
being incorrectly created as MISSED with PENDING_CALLBACK status.

MissedQueueService now filters the Ozonetel abandonCalls API response
by campaign name (read from TelephonyConfigService). Prevents
cross-tenant ingestion when multiple sidecars share the same
Ozonetel account.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 16:03:48 +05:30
parent 9665500b63
commit 96d0c32000
4 changed files with 40 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ import { ConfigService } from '@nestjs/config';
import { MissedQueueService, istToUtc, normalizePhone } from './missed-queue.service';
import { PlatformGraphqlService } from '../platform/platform-graphql.service';
import { OzonetelAgentService } from '../ozonetel/ozonetel-agent.service';
import { TelephonyConfigService } from '../config/telephony-config.service';
import { ABANDON_CALL_RECORD } from '../__fixtures__/ozonetel-payloads';
describe('MissedQueueService', () => {
@@ -57,6 +58,16 @@ describe('MissedQueueService', () => {
getAbandonCalls: jest.fn().mockResolvedValue([ABANDON_CALL_RECORD]),
},
},
{
provide: TelephonyConfigService,
useValue: {
getConfig: () => ({
ozonetel: { campaignName: 'Inbound_918041763400', agentId: '', agentPassword: '', did: '918041763400', sipId: '' },
sip: { domain: 'test', wsPort: '444' },
exotel: { apiKey: '', accountSid: '', subdomain: '' },
}),
},
},
],
}).compile();