Files
helix-engage-server/src/exotel/exotel.types.ts

36 lines
907 B
TypeScript

// Exotel webhook payload (from their API docs)
export type ExotelWebhookPayload = {
event_details: {
event_type: 'answered' | 'terminal';
};
call_details: {
call_sid: string;
direction: 'inbound' | 'outbound';
call_status?: string;
total_talk_time?: number;
assigned_agent_details?: {
name: string;
number: string;
};
customer_details?: {
number: string;
name?: string;
};
recordings?: { url: string }[];
};
};
// Internal call event (normalized)
export type CallEvent = {
exotelCallSid: string;
eventType: 'ringing' | 'answered' | 'ended';
direction: 'inbound' | 'outbound';
callerPhone: string;
agentName: string;
agentPhone: string;
duration?: number;
recordingUrl?: string;
callStatus?: string;
timestamp: string;
};