Implement Call Recording for STT and Replay #3
@@ -34,6 +34,9 @@ EXPOSE 8001 8081
|
|||||||
# Create and set up the configuration directory
|
# Create and set up the configuration directory
|
||||||
VOLUME ["/configs"]
|
VOLUME ["/configs"]
|
||||||
|
|
||||||
|
# Create the calls local cache directory
|
||||||
|
VOLUME ["/calls"]
|
||||||
|
|
||||||
# Set the working directory in the container
|
# Set the working directory in the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ async def mqtt_lifecycle_manager():
|
|||||||
|
|
||||||
def upload_audio(call_id):
|
def upload_audio(call_id):
|
||||||
if not AUDIO_BUCKET: return None
|
if not AUDIO_BUCKET: return None
|
||||||
local_path = f"/tmp/{call_id}.mp3"
|
local_path = f"/calls/{call_id}.mp3"
|
||||||
if not os.path.exists(local_path): return None
|
if not os.path.exists(local_path): return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -278,7 +278,7 @@ async def mqtt_lifecycle_manager():
|
|||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
data = response.json()
|
data = response.json()
|
||||||
LOGGER.debug(f"Response from OP25 API: {data}")
|
# LOGGER.debug(f"Response from OP25 API: {data}")
|
||||||
|
|
||||||
current_tgid = 0
|
current_tgid = 0
|
||||||
current_meta = {}
|
current_meta = {}
|
||||||
@@ -344,7 +344,7 @@ async def mqtt_lifecycle_manager():
|
|||||||
stream_url = get_current_stream_url()
|
stream_url = get_current_stream_url()
|
||||||
recorder_proc = await asyncio.create_subprocess_exec(
|
recorder_proc = await asyncio.create_subprocess_exec(
|
||||||
"ffmpeg", "-i", stream_url, "-y", "-t", "300",
|
"ffmpeg", "-i", stream_url, "-y", "-t", "300",
|
||||||
f"/tmp/{current_call_id}.mp3",
|
f"/calls/{current_call_id}.mp3",
|
||||||
stdout=asyncio.subprocess.DEVNULL,
|
stdout=asyncio.subprocess.DEVNULL,
|
||||||
stderr=asyncio.subprocess.DEVNULL
|
stderr=asyncio.subprocess.DEVNULL
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user