Draft: rotate cdr csv log when reach max row
Compare changes
+ 63
− 12
@@ -48,6 +48,8 @@
@@ -48,6 +48,8 @@
@@ -57,8 +59,11 @@ static int loguniqueid = 0;
@@ -57,8 +59,11 @@ static int loguniqueid = 0;
@@ -113,6 +118,7 @@ static int load_config(int reload)
@@ -113,6 +118,7 @@ static int load_config(int reload)
@@ -123,6 +129,10 @@ static int load_config(int reload)
@@ -123,6 +129,10 @@ static int load_config(int reload)
@@ -137,6 +147,8 @@ static int load_config(int reload)
@@ -137,6 +147,8 @@ static int load_config(int reload)
@@ -303,19 +315,54 @@ static int build_csv_record(char *buf, size_t bufsize, struct ast_cdr *cdr)
@@ -303,19 +315,54 @@ static int build_csv_record(char *buf, size_t bufsize, struct ast_cdr *cdr)
@@ -324,12 +371,16 @@ static int writefile(char *s, char *file_path)
@@ -324,12 +371,16 @@ static int writefile(char *s, char *file_path)
snprintf(file_account, sizeof(file_account), "%s/%s/%s.csv", ast_config_AST_LOG_DIR,CSV_LOG_DIR, acc);
@@ -348,7 +399,7 @@ static int csv_log(struct ast_cdr *cdr)
@@ -348,7 +399,7 @@ static int csv_log(struct ast_cdr *cdr)
ast_log(LOG_WARNING, "Unable to write CSV record to master '%s' : %s\n", file_csv_master, strerror(errno));