compose: opt-in trunk-recorder service + supervisor and uploadScript (node-26#45)
robotastic/trunk-recorder:5.2.1 pinned by digest, behind the trunk-recorder compose profile, host network, /dev/bus/usb. run.sh restarts TR when the edge-node rewrites config.json and reports state for health; drb-upload.sh hands each finished call (wav, then json) to recordings/tr-inbox. README carries the GPL-3.0 source note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
fa3eac3b28
commit
c9f162a508
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# Trunk Recorder uploadScript (node-26#45). TR runs this after every call as
|
||||
# drb-upload.sh <call.wav> <call.json> <call.m4a>
|
||||
# (run_upload_script_argv, call_concluder.cc v5.2.1; the m4a only exists with
|
||||
# compressWav, which DRB leaves off). TR deletes the wav/json as soon as this
|
||||
# exits (audioArchive/callLog false), so it copies them into the edge-node's
|
||||
# inbox first. Order matters: the WAV lands first and the JSON last, so the
|
||||
# JSON's presence tells the edge-node the WAV is complete. Exit non-zero = TR
|
||||
# marks the call failed.
|
||||
set -u
|
||||
WAV="${1:?wav path}"
|
||||
JSON="${2:?json path}"
|
||||
INBOX="${DRB_TR_INBOX:-/recordings/tr-inbox}"
|
||||
TMP="$INBOX/.incoming"
|
||||
|
||||
[ -f "$WAV" ] && [ -f "$JSON" ] || { echo "drb-upload: missing $WAV or $JSON" >&2; exit 1; }
|
||||
mkdir -p "$TMP" || exit 1
|
||||
|
||||
stem="$(basename "$JSON" .json)"
|
||||
# Hard link when on the same filesystem (no copy, TR's unlink leaves ours);
|
||||
# copy otherwise.
|
||||
put() { ln -f "$1" "$2" 2>/dev/null || cp -f "$1" "$2"; }
|
||||
|
||||
put "$WAV" "$TMP/$stem.wav" || exit 1
|
||||
put "$JSON" "$TMP/$stem.json" || exit 1
|
||||
mv -f "$TMP/$stem.wav" "$INBOX/$stem.wav" || exit 1
|
||||
mv -f "$TMP/$stem.json" "$INBOX/$stem.json" || exit 1
|
||||
exit 0
|
||||
Reference in New Issue
Block a user