feat(fax): add fax routing, job tracking, inbox management, and T.38/UDPTL media support

This commit is contained in:
2026-04-20 20:43:42 +00:00
parent 3c010a3b1b
commit d2c18a4ebb
27 changed files with 4247 additions and 280 deletions
+57
View File
@@ -18,6 +18,7 @@ export interface IOutboundCallStartedEvent {
call_id: string;
number: string;
provider_id: string;
ring_browsers?: boolean;
}
export interface ICallRingingEvent {
@@ -28,6 +29,7 @@ export interface ICallAnsweredEvent {
call_id: string;
provider_media_addr?: string;
provider_media_port?: number;
media_protocol?: string;
sip_pt?: number;
}
@@ -67,6 +69,7 @@ export interface ILegAddedEvent {
state: string;
codec?: string | null;
rtpPort?: number | null;
mediaProtocol?: string | null;
remoteMedia?: string | null;
metadata?: Record<string, unknown>;
}
@@ -82,6 +85,7 @@ export interface ILegStateChangedEvent {
state: string;
codec?: string | null;
rtpPort?: number | null;
mediaProtocol?: string | null;
remoteMedia?: string | null;
metadata?: Record<string, unknown>;
}
@@ -128,6 +132,56 @@ export interface IVoicemailErrorEvent {
error: string;
}
export interface IFaxStartedEvent {
call_id: string;
leg_id: string;
direction: 'outbound' | 'inbound';
transport: 'audio' | 't38';
file_path: string;
fax_box_id?: string;
caller_number?: string;
codec?: string;
remote_media?: string;
}
export interface IFaxCompletedEvent {
call_id: string;
leg_id: string;
direction: 'outbound' | 'inbound';
transport: 'audio' | 't38';
file_path: string;
fax_box_id?: string;
caller_number?: string;
codec?: string;
success: boolean;
completion_code?: number | null;
completion_label?: string | null;
stats: {
bit_rate: number;
error_correcting_mode: boolean;
pages_tx: number;
pages_rx: number;
image_size: number;
bad_rows: number;
longest_bad_row_run: number;
ecm_retries: number;
current_status: number;
rtp_events: number;
rtn_events: number;
};
}
export interface IFaxFailedEvent {
call_id: string;
leg_id: string;
direction: 'outbound' | 'inbound';
transport: 'audio' | 't38';
file_path: string;
fax_box_id?: string;
caller_number?: string;
error: string;
}
export type TProxyEventMap = {
provider_registered: IProviderRegisteredEvent;
device_registered: IDeviceRegisteredEvent;
@@ -148,4 +202,7 @@ export type TProxyEventMap = {
voicemail_started: IVoicemailStartedEvent;
recording_done: IRecordingDoneEvent;
voicemail_error: IVoicemailErrorEvent;
fax_started: IFaxStartedEvent;
fax_completed: IFaxCompletedEvent;
fax_failed: IFaxFailedEvent;
};