Implement Call Recording for STT and Replay #3

Merged
logan merged 11 commits from implement-call-recording into main 2026-01-03 19:38:05 -05:00
3 changed files with 11 additions and 2 deletions
Showing only changes of commit 9e92da4e58 - Show all commits

View File

@@ -4,3 +4,6 @@ ICECAST_SERVER=
AUDIO_BUCKET= AUDIO_BUCKET=
NODE_LAT= NODE_LAT=
NODE_LONG= NODE_LONG=
HTTP_SERVER_PROTOCOL=
HTTP_SERVER_ADDRESS=
HTTP_SERVER_PORT=

View File

@@ -20,6 +20,9 @@ app.include_router(create_op25_router(), prefix="/op25")
# Configuration # Configuration
NODE_ID = os.getenv("NODE_ID", "standalone-node") NODE_ID = os.getenv("NODE_ID", "standalone-node")
MQTT_BROKER = os.getenv("MQTT_BROKER", None) MQTT_BROKER = os.getenv("MQTT_BROKER", None)
HTTP_SERVER_PROTOCOL = os.getenv("HTTP_SERVER_PROTOCOL", "http")
HTTP_SERVER_ADDRESS = os.getenv("HTTP_SERVER_ADDRESS", "127.0.0.1")
HTTP_SERVER_PORT = os.getenv("HTTP_SERVER_PORT", 8000)
NODE_LAT = os.getenv("NODE_LAT") NODE_LAT = os.getenv("NODE_LAT")
NODE_LONG = os.getenv("NODE_LONG") NODE_LONG = os.getenv("NODE_LONG")
@@ -251,7 +254,7 @@ async def mqtt_lifecycle_manager():
try: try:
with open(local_path, "rb") as f: with open(local_path, "rb") as f:
files = {"file": (f"{call_id}.mp3", f, "audio/mpeg")} files = {"file": (f"{call_id}.mp3", f, "audio/mpeg")}
response = requests.post(f"http://{MQTT_BROKER}/upload", files=files, data={"node_id": NODE_ID, "call_id": call_id}, timeout=30) response = requests.post(f"{HTTP_SERVER_PROTOCOL}://{HTTP_SERVER_ADDRESS}:{HTTP_SERVER_PORT}/upload", files=files, data={"node_id": NODE_ID, "call_id": call_id}, timeout=30)
response.raise_for_status() response.raise_for_status()
return response.json().get("url") return response.json().get("url")
except Exception as e: except Exception as e:

View File

@@ -22,6 +22,9 @@ services:
- MQTT_BROKER=${MQTT_BROKER} - MQTT_BROKER=${MQTT_BROKER}
- ICECAST_SERVER=${ICECAST_SERVER} - ICECAST_SERVER=${ICECAST_SERVER}
- AUDIO_BUCKET=${AUDIO_BUCKET} - AUDIO_BUCKET=${AUDIO_BUCKET}
- HTTP_SERVER_PROTOCOL=${HTTP_SERVER_PROTOCOL}
- HTTP_SERVER_HOST=${HTTP_SERVER_HOST}
- HTTP_SERVER_PORT=${HTTP_SERVER_PORT}
networks: networks:
- radio-shared-net - radio-shared-net