Browse Source

sipdump: make month in the file name from 1 to 12

- tm_mon is from 0-11
- backport of 97593d20875d26c38511f564fd7071bf79baa56b

(cherry picked from commit bfa58cdebc84aeca8220eb9d583b597706907a1d)
Daniel-Constantin Mierla 5 years ago
parent
commit
2c27b129d6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/sipdump/sipdump_write.c

+ 1 - 1
src/modules/sipdump/sipdump_write.c

@@ -201,7 +201,7 @@ static int sipdump_rotate_file(void)
 	n = snprintf(_sipdump_fpath+_sipdump_fpath_prefix.len,
 	n = snprintf(_sipdump_fpath+_sipdump_fpath_prefix.len,
 			SIPDUMP_FPATH_SIZE-_sipdump_fpath_prefix.len,
 			SIPDUMP_FPATH_SIZE-_sipdump_fpath_prefix.len,
 			"%d-%02d-%02d--%02d-%02d-%02d.data",
 			"%d-%02d-%02d--%02d-%02d-%02d.data",
-			1900+ti->tm_year, ti->tm_mon, ti->tm_mday,
+			1900+ti->tm_year, ti->tm_mon+1, ti->tm_mday,
 			ti->tm_hour, ti->tm_min, ti->tm_sec);
 			ti->tm_hour, ti->tm_min, ti->tm_sec);
 	LM_DBG("writing to file: %s (%d)\n", _sipdump_fpath, n);
 	LM_DBG("writing to file: %s (%d)\n", _sipdump_fpath, n);
 	_sipdump_file = fopen( _sipdump_fpath, "w" );
 	_sipdump_file = fopen( _sipdump_fpath, "w" );