Browse Source

MT#55283 add timestamp markers to recording metadata for pause/resume events

Write human-readable timestamp markers to the metadata file whenever
recording is paused or resumed via control protocol commands.

Include ISO-format timestamps with millisecond precision that aid in
tracking changes in recording state.

Example metadata output:
  Recording paused at: 2025-07-29T15:30:45 (1234567.890 ms)
  Recording resumed at: 2025-07-29T15:31:20 (1234598.123 ms)

🤖 Generated with [Claude Code](https://claude.ai/code)

Closes #1982

Change-Id: Id92c14900a29f53ba0ee00b3d0f53132bb11cff7
Co-Authored-By: Claude <noreply@anthropic.com>
pull/1987/head
Orgad Shaneh 5 months ago
committed by Richard Fuchs
parent
commit
2d5565738f
1 changed files with 29 additions and 0 deletions
  1. +29
    -0
      daemon/recording.c

+ 29
- 0
daemon/recording.c View File

@ -402,7 +402,22 @@ void recording_start_daemon(call_t *call) {
}
// lock must be held
void recording_start(call_t *call) {
bool was_paused = call->recording && !CALL_ISSET(call, RECORDING_ON);
CALL_SET(call, RECORDING_ON);
// Write resume timestamp to metadata file if resuming a paused recording
if (was_paused && call->recording->pcap.meta_fp) {
time_t now = rtpe_now / 1000000;
char timebuffer[32];
struct tm timeinfo;
if (localtime_r(&now, &timeinfo) != NULL) {
strftime(timebuffer, sizeof(timebuffer), "%FT%T", &timeinfo);
fprintf(call->recording->pcap.meta_fp,
"\nRecording resumed at: %s (%.3lf ms)\n",
timebuffer, rtpe_now / 1000.0);
}
}
recording_start_daemon(call);
}
// lock must be held
@ -438,6 +453,20 @@ void recording_pause(call_t *call) {
if (!call->recording)
return;
ilog(LOG_NOTICE, "Pausing call recording.");
// Write pause timestamp to metadata file
if (call->recording->pcap.meta_fp) {
time_t now = rtpe_now / 1000000;
char timebuffer[32];
struct tm timeinfo;
if (localtime_r(&now, &timeinfo) != NULL) {
strftime(timebuffer, sizeof(timebuffer), "%FT%T", &timeinfo);
fprintf(call->recording->pcap.meta_fp,
"\nRecording paused at: %s (%.3lf ms)\n",
timebuffer, rtpe_now / 1000.0);
}
}
recording_update_flags(call, true);
}
// lock must be held


Loading…
Cancel
Save