initial commit — SIP B2BUA + WebRTC bridge with Rust codec engine

Full-featured SIP router with multi-provider trunking, browser softphone
via WebRTC, real-time Opus/G.722/PCM transcoding in Rust, RNNoise ML
noise suppression, Kokoro neural TTS announcements, and a Lit-based
web dashboard with live call monitoring and REST API.
This commit is contained in:
2026-04-09 23:03:55 +00:00
commit f3e1c96872
59 changed files with 18377 additions and 0 deletions

68
ts/call/types.ts Normal file
View File

@@ -0,0 +1,68 @@
/**
* Hub model type definitions — Call, Leg, and status types.
*/
import type { IEndpoint } from '../sip/index.ts';
// ---------------------------------------------------------------------------
// State types
// ---------------------------------------------------------------------------
export type TCallState =
| 'setting-up'
| 'ringing'
| 'connected'
| 'on-hold'
| 'transferring'
| 'terminating'
| 'terminated';
export type TLegState =
| 'inviting'
| 'ringing'
| 'connected'
| 'on-hold'
| 'terminating'
| 'terminated';
export type TLegType = 'sip-device' | 'sip-provider' | 'webrtc';
export type TCallDirection = 'inbound' | 'outbound' | 'internal';
// ---------------------------------------------------------------------------
// Status interfaces (for frontend dashboard)
// ---------------------------------------------------------------------------
export interface ILegStatus {
id: string;
type: TLegType;
state: TLegState;
remoteMedia: IEndpoint | null;
rtpPort: number | null;
pktSent: number;
pktReceived: number;
codec: string | null;
transcoding: boolean;
}
export interface ICallStatus {
id: string;
state: TCallState;
direction: TCallDirection;
callerNumber: string | null;
calleeNumber: string | null;
providerUsed: string | null;
createdAt: number;
duration: number;
legs: ILegStatus[];
}
export interface ICallHistoryEntry {
id: string;
direction: TCallDirection;
callerNumber: string | null;
calleeNumber: string | null;
providerUsed: string | null;
startedAt: number;
duration: number;
}