📞Layer 1: Voice Edge
The call's entry point (HGW / Asterisk / bridge). Current operations vs. Phase C v2.
The physical entry point for calls (the Voice Edge). A Hikari Denwa HGW receives the call, Asterisk
passes the audio to bridge.py over AudioSocket, and OpenAI Realtime makes the decision.
Architecture
Current operations vs. Phase C v2
spam is a Hangup (fail-safe = block); anything undecidable or any fault goes to a human (fail-open = stay in business). We do not use cutting everything off (fail-closed); it was removed in C-2(b). See the glossary for details.
Key parameters
- AudioSocket:
127.0.0.1:9092(μlaw 8kHz ↔ PCM16 24kHz resampling; also supports GAaudio/pcmudirect-send, which bypasses the resample — see below) - AMI:
127.0.0.1:5039(Plan B, current: look up the target channel viaStatusandHangup; the legacy Plan ADBPut/ AstDB verdict is archived) - OpenAI Realtime:
gpt-realtime(GA), connecting over/v1/realtime - dialplan placeholders:
<ALLOW_DESTINATION>(allow forwarding target) /<HUMAN_PEER>(fail-open hand-off target)
The OpenAI Realtime Beta API was retired on 2026-05-12. bridge.py is migrated to GA (gpt-realtime)
and verified live against real OpenAI (connect / session.update accepted / classify_call fires /
full pipeline: classify → closing line → AMI Hangup). No legacy Beta headers or wording remain.
GA accepts audio/pcmu (μlaw) on both input and output. bridge.py supports μlaw direct-send, which
bypasses the 8kHz μlaw ↔ 24kHz PCM resample (opt-in via AUDIO_FORMAT=ulaw).
The default stays pcm16 (the current resample path), and verdict parity between pcm16 and μlaw has been
measured live. Making μlaw the default will be considered after verification on real HGW hardware.
The decision→hangup path is now Plan B (function calling + AMI Hangup). The AI returns should_terminate,
and after a brief closing line bridge.py hangs up the target channel via AMI. The legacy Plan A (verdict via AstDB)
is archived and will be removed once on-device testing of Plan B passes.