Calls: store every radio heard on a call; call_end writes srcaddr (server-26#304)
P1 of the radio-ID plan. The node now reports `radios`, one
{radio, start, end} per transmission, on /upload and on call_end. Both go
through app/internal/radios.py into `radios` + `radio_ids` on the call doc.
/upload writes them before the pipeline starts, because call_end arrives
after it.
call_end also writes srcaddr now. Only call_start used to, and the node
usually learns the talker after call_start, so most calls kept None and the
correlator's srcaddr match rarely fired. /upload fills srcaddr from the
latest radio when the doc has none.
Older nodes send neither field; nothing is blanked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
cbf45ff004
commit
5cdde85d55
@@ -6,6 +6,7 @@ import paho.mqtt.client as mqtt
|
||||
from app.config import settings
|
||||
from app.internal.logger import logger
|
||||
from app.internal import firestore as fstore
|
||||
from app.internal import radios
|
||||
from app.internal import talkgroups
|
||||
from app.internal.tenancy import FOUNDING_ORG_ID
|
||||
|
||||
@@ -307,6 +308,12 @@ class MQTTHandler:
|
||||
updates["org_id"] = node["org_id"]
|
||||
if payload.get("audio_url"):
|
||||
updates["audio_url"] = payload["audio_url"]
|
||||
# The node usually learns the talker after call_start went out; only
|
||||
# call_start used to write srcaddr, so most calls kept None
|
||||
# (server-26#304).
|
||||
if payload.get("srcaddr") is not None:
|
||||
updates["srcaddr"] = payload["srcaddr"]
|
||||
updates.update(radios.call_fields(payload.get("radios")))
|
||||
|
||||
await fstore.doc_set("calls", call_id, updates)
|
||||
logger.info(f"Call end: {call_id}")
|
||||
|
||||
Reference in New Issue
Block a user