- Shipped
- August 27, 2026 at 7:40 AM UTC
- Author
- Kamo
- Commit
- 43c4eab
Replaces the stub. KamoPBX is Kamo's own platform, so the organization holds no credential at all: KamoPBXAccountProvisioner creates the account when a phone server is added, and KamoPBXClient mints a short-lived child-scoped token per call from Kamo's single master credential. Auth uses the child account's OWN api_key, read with the master token and exchanged — documented and schema'd. The undocumented as:{account_id,owner_id} claim is deliberately not used: it fails open, returning the full-privilege PARENT token with no error when owner_id is omitted. scopedToken() asserts the returned token is scoped to the child and rejects a parent-scoped one as the privilege escalation it is. Also fixed from the stub: - getCallHistory returned null, which NPEs any caller that iterates. - CDRs are per-leg, so history is collapsed on interaction_id or one call shows up two or three times. - callResult is pinned by test to exactly ANSWERED/NO ANSWER/BUSY/FAILED; anything else silently makes missed-call counters read zero, so unknown hangup causes collapse to FAILED rather than passing through. Platform settings (base URL, master account, admin credential, WSS URL) are @Value-injected and never per-org. 246 tests pass, 29 of them new.