code wiki / (root) / nx_callsig.nx

nx_callsig.nx

buildroot/runtime/nx_callsig.nx

2200 B42 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_callsig.nx -- sovereign CALL SIGNALING state machine: a telephone-style ring/accept/reject flow so the boy and girl can call each other and the callee is actively NOTIFIED (ringing) -- not silently ignored. Telephone semantics by construction: * a call must be EXPLICITLY accepted from RINGING -> no accidental tap can connect it * an unanswered ring TIMES OUT to MISSED -> a persistent record the callee still sees (notifications not lost) * only accept/reject/cancel/timeout leave RINGING; ANY stray event keeps it ringing (can't be fat-fingered away) The invite/accept/reject events themselves ride the E2E relay (nx_e2e); this is the pure state logic. license_tier: ORIGINAL

dependencies 0 imports · 1 importers

nx_callsig.nx nx_callsig_gate.nx

imports: none

imported by: nx_callsig_gate.nx

structs

none

consts

10const CS_IDLE: i64 = 0
11const CS_RINGING: i64 = 1
12const CS_CONNECTED: i64 = 2
13const CS_REJECTED: i64 = 3
14const CS_MISSED: i64 = 4
15const CS_CANCELLED: i64 = 5
16const CS_ENDED: i64 = 6
18const EV_INVITE: i64 = 1
19const EV_ACCEPT: i64 = 2
20const EV_REJECT: i64 = 3
21const EV_CANCEL: i64 = 4
22const EV_TIMEOUT: i64 = 5
23const EV_HANGUP: i64 = 6

functions

25func cs_step(state: i64, ev: i64) -> i64
called by 1: main
38func cs_is_ringing(state: i64) -> i64 { if state == CS_RINGING { return 1 } return 0 }
called by 1: main
40func cs_is_missed(state: i64) -> i64 { if state == CS_MISSED { return 1 } return 0 }
called by 1: main
42func cs_is_connected(state: i64) -> i64 { if state == CS_CONNECTED { return 1 } return 0 }
called by 1: main