Prove the key, the protocol, and the events with a file first. Ten minutes. No switch needed.What you need#
Python 3 and pip install websockets.
A mono 16-bit WAV at 8000 or 16000 Hz. A recording of a scam call works best.
The script#
It streams the WAV at real-time pace and prints every event.What you should see#
session.started ""
transcript.line "This is officer Smith from Social Security."
verdict {"score": 0.72, "level": "likely_scam", ...}
transcript.line "Pay the fine today with gift cards or you will be arrested."
verdict {"score": 0.94, "level": "scam", ...}
session.ended {"score": 0.94, "level": "scam", ...}
A clean recording prints session.started, some transcript.line events, and session.ended with "level": "clean". Zero verdict events on a clean call is normal.If it fails#
| What you see | Cause |
|---|
Upgrade refused with 401 | Wrong key. |
Upgrade refused with 503 | live_filter is false. See Before you start. |
session.started then nothing | The WAV is stereo, 8-bit, or silent. |
Garbage in transcript.line | Wrong sample rate. |
If this script works, the rest is switch configuration, not protocol work. Next: Connect your switch. Modified at 2026-09-18 16:56:43