code wiki / _hdl_build / nx_connect_call.nx
nx_connect_call.nx
buildroot/runtime/_hdl_build/nx_connect_call.nx
about
nx_connect_call.nx -- FUNCTIONALITY rung: call SESSION SIGNALING (the control plane of voice/
video calls) + group call rooms. This is the gateable LOGIC of calling -- the media plane
(audio/video codec + transport) is a separate substrate and stays ABSENT in the census until built.
1:1 call state machine (valid transitions ONLY): IDLE -> RINGING -> CONNECTED -> ENDED, with
RINGING -> REJECTED (callee) / CANCELLED (caller) / and illegal jumps refused. Actor rules: only
the callee accepts/rejects; only the caller cancels; either ends a connected call. SAFETY by
construction: you cannot cold-call a non-contact and cannot call a BLOCKED user (anti-harassment).
Group rooms: host create / join / leave / host-only end. 7 checks incl. negative controls.
100% sovereign. license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const C_IDLE: i64 = 0 |
| 14 | const C_RINGING: i64 = 1 |
| 15 | const C_CONNECTED:i64 = 2 |
| 16 | const C_ENDED: i64 = 3 |
| 17 | const C_REJECTED: i64 = 4 |
| 18 | const C_CANCELLED:i64 = 5 |
functions
| 21 | func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 22 | func sn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 } |
| 25 | func call_initiate(c: *i64, caller: i64, callee: i64, rel: i64, blocked: i64) -> i64 called by 1: main |
| 32 | func call_accept(c: *i64, actor: i64) -> i64 called by 1: main |
| 37 | func call_reject(c: *i64, actor: i64) -> i64 called by 1: main |
| 42 | func call_cancel(c: *i64, actor: i64) -> i64 called by 1: main |
| 47 | func call_end(c: *i64, actor: i64) -> i64 called by 1: main |
| 54 | func room_create(r: *i64, mem: *i64, host: i64) -> i64 { r[0]=host; r[1]=1; mem[0]=host; return 0 } called by 1: main |
| 55 | func room_find(r: *i64, mem: *i64, uid: i64) -> i64 { var i: i64=0; while i<r[1] { if mem[i]==uid { return i } i=i+1 } return 0-1 } |
| 56 | func room_join(r: *i64, mem: *i64, uid: i64) -> i64 { if room_find(r,mem,uid)>=0 { return 1 } let c: i64=r[1]; mem[c]=uid; r[1]=c+1; return 1 } |
| 57 | func room_leave(r: *i64, mem: *i64, uid: i64) -> i64 { let idx: i64=room_find(r,mem,uid); if idx<0 { return 0 } let c: i64=r[1]; mem[idx]=mem[c-1]; r[1]=c-1; return 1 } |
| 58 | func room_end(r: *i64, mem: *i64, actor: i64) -> i64 { if actor!=r[0] { return 0 } r[1]=0; return 1 } called by 1: main |
| 60 | func tcheck(pass: i64, label: *u8, fails: *i64) -> i64 |
| 66 | func main() -> i64 |