From adb619389183f3eb204e61a27e3cfab57d5dd531 Mon Sep 17 00:00:00 2001 From: Dylan Mikus Date: Thu, 21 Jan 2016 23:01:53 +0000 Subject: [PATCH] Minorly adjusted the recording metadata file format In the recording metadata files, we now separate each logical section of metadata by two blank lines. So, it goes: 1. the PCAP file URL 2. two blank lines 3. all answer SDP, each separated by one blank line 4. two blank lines 5. start timestamp 6. end timestamp (no blank line in between) 7. the rest of the file is unstructured metadata (any number of lines) --- README.md | 19 +++++++++++++++++-- daemon/recording.c | 6 +++--- daemon/recording.h | 5 +++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b0f67fce5..0f72bfbc8 100644 --- a/README.md +++ b/README.md @@ -474,13 +474,28 @@ The options are described in more detail below. /path/to/recording-pcap.pcap + + first SDP answer + + second SDP answer + + ... + + n-th and final SDP answer + + start timestamp (YYYY-MM-DDThh:mm:ss) end timestamp (YYYY-MM-DDThh:mm:ss) + generic metadata - Metadata files will appear in the subdirectory when the call completes. - PCAP files will be written to the subdirectory as the call is being recorded. + There are two empty lines between each logic block of metadata. + We write out all answer SDP, each separated from one another by one empty + line. The generic metadata at the end can be any length with any number of + lines. Metadata files will appear in the subdirectory when the call + completes. PCAP files will be written to the subdirectory as the call is + being recorded. A typical command line (enabling both UDP and NG protocols) thus may look like: diff --git a/daemon/recording.c b/daemon/recording.c index e635265bf..cf5e46e4a 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -147,7 +147,7 @@ str *init_write_pcap_file(struct call *call) { if (pcap_path != NULL && call->recording->recording_pdumper != NULL && call->recording->meta_fp) { // Write the location of the PCAP file to the metadata file - fprintf(call->recording->meta_fp, "%s\n", pcap_path->s); + fprintf(call->recording->meta_fp, "%s\n\n", pcap_path->s); } } @@ -219,13 +219,13 @@ int meta_finish_file(struct call *call) { } timeinfo = localtime(&start); strftime(timebuffer, 20, "%FT%T", timeinfo); - fprintf(recording->meta_fp, "\n%s\n", timebuffer); + fprintf(recording->meta_fp, "\n\n%s\n", timebuffer); timeinfo = localtime(&end); strftime(timebuffer, 20, "%FT%T", timeinfo); fprintf(recording->meta_fp, "%s\n", timebuffer); // Print metadata - fprintf(recording->meta_fp, "\n%s\n", recording->metadata->s); + fprintf(recording->meta_fp, "\n\n%s\n", recording->metadata->s); free(recording->metadata); fclose(recording->meta_fp); diff --git a/daemon/recording.h b/daemon/recording.h index 92ba08542..824d8132e 100644 --- a/daemon/recording.h +++ b/daemon/recording.h @@ -51,6 +51,7 @@ int detect_setup_recording(struct call *call, str recordcall); * * /path/to/recording-pcap.pcap * + * * first SDP answer * * second SDP answer @@ -59,11 +60,15 @@ int detect_setup_recording(struct call *call, str recordcall); * * n-th and final SDP answer * + * * start timestamp (YYYY-MM-DDThh:mm:ss) * end timestamp (YYYY-MM-DDThh:mm:ss) * + * * generic metadata * + * There are two empty lines between each logic block of metadata. + * The generic metadata at the end can be any length with any number of lines. * Temporary files go in /tmp/. They will end up in * ${RECORDING_DIR}/metadata/. They are named like: * ${CALL_ID}-${RAND-HEX}.pcap