mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +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:
@@ -53,9 +53,17 @@ export class MissedCallWebhookController {
|
||||
return { received: true, processed: false };
|
||||
}
|
||||
|
||||
// Skip outbound calls — an unanswered outbound dial is NOT a
|
||||
// "missed call" in the call-center sense. Outbound call records
|
||||
// are created by the disposition flow, not the webhook.
|
||||
if (type === 'Manual' || type === 'OutBound') {
|
||||
this.logger.log(`Skipping outbound call webhook (type=${type}, status=${status})`);
|
||||
return { received: true, processed: false, reason: 'outbound' };
|
||||
}
|
||||
|
||||
// Determine call status for our platform
|
||||
const callStatus = status === 'Answered' ? 'COMPLETED' : 'MISSED';
|
||||
const direction = type === 'InBound' ? 'INBOUND' : 'OUTBOUND';
|
||||
const direction = 'INBOUND'; // only inbound reaches here now
|
||||
|
||||
// Use API key auth for server-to-server writes
|
||||
const authHeader = this.apiKey ? `Bearer ${this.apiKey}` : '';
|
||||
|
||||
Reference in New Issue
Block a user