Add call ID to the call metadata
This commit is contained in:
@@ -327,7 +327,8 @@ async def mqtt_lifecycle_manager():
|
|||||||
"timestamp": now.isoformat(),
|
"timestamp": now.isoformat(),
|
||||||
"event": "call_end",
|
"event": "call_end",
|
||||||
"metadata": last_metadata,
|
"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)
|
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:
|
except Exception as e:
|
||||||
LOGGER.error(f"Failed to start recorder: {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)
|
client.publish(f"nodes/{NODE_ID}/metadata", json.dumps(payload), qos=0)
|
||||||
last_tgid = current_tgid
|
last_tgid = current_tgid
|
||||||
last_metadata = current_meta
|
last_metadata = current_meta
|
||||||
@@ -374,7 +381,8 @@ async def mqtt_lifecycle_manager():
|
|||||||
"timestamp": now.isoformat(),
|
"timestamp": now.isoformat(),
|
||||||
"event": "call_end",
|
"event": "call_end",
|
||||||
"metadata": last_metadata,
|
"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)
|
client.publish(f"nodes/{NODE_ID}/metadata", json.dumps(payload), qos=0)
|
||||||
last_tgid = 0
|
last_tgid = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user