Add call ID to the call metadata

This commit is contained in:
Logan Cusano
2026-01-03 19:18:30 -05:00
parent d8190e307c
commit 051eac88b0

View File

@@ -327,7 +327,8 @@ async def mqtt_lifecycle_manager():
"timestamp": now.isoformat(),
"event": "call_end",
"metadata": last_metadata,
"audio_url": audio_url
"audio_url": audio_url,
"call_id": current_call_id
}
client.publish(f"nodes/{NODE_ID}/metadata", json.dumps(payload), qos=0)
@@ -352,7 +353,13 @@ async def mqtt_lifecycle_manager():
except Exception as e:
LOGGER.error(f"Failed to start recorder: {e}")
payload = {"node_id": NODE_ID, "timestamp": now.isoformat(), "event": "call_start", "metadata": current_meta}
payload = {
"node_id": NODE_ID,
"timestamp": now.isoformat(),
"event": "call_start",
"metadata": current_meta,
"call_id": current_call_id
}
client.publish(f"nodes/{NODE_ID}/metadata", json.dumps(payload), qos=0)
last_tgid = current_tgid
last_metadata = current_meta
@@ -374,7 +381,8 @@ async def mqtt_lifecycle_manager():
"timestamp": now.isoformat(),
"event": "call_end",
"metadata": last_metadata,
"audio_url": audio_url
"audio_url": audio_url,
"call_id": current_call_id
}
client.publish(f"nodes/{NODE_ID}/metadata", json.dumps(payload), qos=0)
last_tgid = 0