mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
36 lines
907 B
TypeScript
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;
|
|
};
|