mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-12 02:18:18 +00:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user