diff --git a/recording-daemon/output.c b/recording-daemon/output.c index c051b1144..b8dec15ec 100644 --- a/recording-daemon/output.c +++ b/recording-daemon/output.c @@ -84,11 +84,13 @@ static void create_parent_dirs(char *dir) { output_t *output_new(const char *path, const char *call, const char *type) { // construct output file name - time_t now = time(NULL); + struct timeval now; struct tm tm; - localtime_r(&now, &tm); const char *ax = call; + gettimeofday(&now, NULL); + localtime_r(&now.tv_sec, &tm); + GString *f = g_string_new(""); for (const char *p = output_pattern; *p; p++) { if (*p != '%') { @@ -127,6 +129,9 @@ output_t *output_new(const char *path, const char *call, const char *type) { case 'S': g_string_append_printf(f, "%02i", tm.tm_sec); break; + case 'u': + g_string_append_printf(f, "%06li", (long) now.tv_usec); + break; case '0': case '1': case '2': diff --git a/recording-daemon/rtpengine-recording.pod b/recording-daemon/rtpengine-recording.pod index 56d99e6bb..66cef35e4 100644 --- a/recording-daemon/rtpengine-recording.pod +++ b/recording-daemon/rtpengine-recording.pod @@ -183,6 +183,10 @@ was created) and are the same as the format sequences supported by L or L (year, month, day, hours, minutes, and seconds, respectively). +=item B<%u> + +Microseconds, expanded to 6 digits (B<000000> through B<999999>). + =item B<%>I References a prefix from the call ID of the given length. If this format