Architecture
Every ScaiDial call is a LiveKit room. Whoever is on the call — a caller from the phone network, a desk phone, a ScaiWave user in a browser, a ScaiBot voice agent, ScaiDial's own prompt or music player — is a participant in that room. ScaiGrid decides who joins and who hears whom; the SIP edges connect the phone world to the rooms.
The components#
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
- ScaiLabs SBC (
sbc.scailabs.ai). Faces your carrier: registers with it, accepts its calls only from the carrier's addresses, handles NAT, TLS and media relay, and answers the carrier's authentication challenges on outbound calls. Each trunk you create is provisioned onto it. - Phones edge (
sip.scailabs.ai). The registrar for desk phones and softphones. Each tenant gets its own SIP domain,<label>.sip.scailabs.ai; phones register there and calls fork to every registered phone of an extension. Rate limits and brute-force protection apply. - livekit-sip. Turns SIP calls into LiveKit room participants and back. Both edges hand calls to it; ScaiGrid asks it to dial out.
- LiveKit (
rtc.scailabs.ai). The media server. Browsers and bots join over WebRTC. - ScaiGrid controller. Owns configuration and call records, runs dialplans, rings extensions through answerers (one per extension type), and drives call control. LiveKit tells it about rooms and participants through signed webhooks.
Inbound call#
- The carrier sends the call to the SBC, which checks it came from that carrier and hands it to livekit-sip with the trunk's identity.
- livekit-sip creates a room and joins the caller. LiveKit's webhook tells ScaiGrid a caller arrived.
- ScaiGrid looks up the dialled number (DID), walks its dialplan and performs the first matching rule: ring an extension, play an announcement, run an IVR menu, forward, voicemail or hang up.
- Ringing an extension goes through its answerer:
wave— the ScaiWave connector rings the user's devices; the device that accepts joins the room.sip_endpoint— livekit-sip dials the phones edge, which rings every phone registered on the extension; the first to pick up joins.bot— ScaiBot starts its voice worker in the room.external— livekit-sip dials the number through your trunk.voicemail— ScaiDial's recorder joins, plays the greeting and records.
- No answer within the ring timeout: the extension's forward rules or timeout action apply (voicemail by default).
Outbound call#
From a desk phone, the phones edge passes the call to livekit-sip; ScaiGrid classifies the dialled number (an extension, a national or international number, a blocked destination) and either rings the extension or dials out through the tenant's trunk. From a browser (/my/dial, ScaiWave), ScaiGrid creates the room, gives the browser a token and dials the far end into the room.
State#
| Lives in | What |
|---|---|
| ScaiGrid database | trunks, DIDs, extensions, dialplans and rules, calls and legs, voicemail metadata, music-on-hold playlists, tenant policy |
| ScaiGrid object storage | voicemail recordings, music-on-hold tracks |
| Redis | short-lived call state: transfers in progress, merged calls, who is on hold |
| SBC and phones edge | trunk registrations, phone accounts (password digests only) and registrations |
| LiveKit | live rooms, participants and media |
Configuration and call records live in ScaiGrid; the media path is deliberately ephemeral. A ScaiGrid restart does not drop calls in progress.
Why rooms#
A room-based design makes the hard PBX features ordinary operations: a transfer adds the target to the room and removes the transferor; hold changes what one participant can hear; a bot, a prompt or a music player is just another participant. Nothing depends on the carrier supporting SIP REFER or re-INVITEs.