|
|
@ -33,6 +33,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <unistd.h>
|
|
|
@ -218,7 +219,7 @@ static int csv_log(struct ast_cdr *cdr)
|
|
|
|
we open write and close the log file each time */
|
|
|
|
we open write and close the log file each time */
|
|
|
|
mf = fopen(csvmaster, "a");
|
|
|
|
mf = fopen(csvmaster, "a");
|
|
|
|
if (!mf) {
|
|
|
|
if (!mf) {
|
|
|
|
ast_log(LOG_ERROR, "Unable to re-open master file %s\n", csvmaster);
|
|
|
|
ast_log(LOG_ERROR, "Unable to re-open master file %s : %s\n", csvmaster, strerror(errno));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (mf) {
|
|
|
|
if (mf) {
|
|
|
|
fputs(buf, mf);
|
|
|
|
fputs(buf, mf);
|
|
|
@ -228,7 +229,7 @@ static int csv_log(struct ast_cdr *cdr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!ast_strlen_zero(cdr->accountcode)) {
|
|
|
|
if (!ast_strlen_zero(cdr->accountcode)) {
|
|
|
|
if (writefile(buf, cdr->accountcode))
|
|
|
|
if (writefile(buf, cdr->accountcode))
|
|
|
|
ast_log(LOG_WARNING, "Unable to write CSV record to account file '%s'\n", cdr->accountcode);
|
|
|
|
ast_log(LOG_WARNING, "Unable to write CSV record to account file '%s' : %s\n", cdr->accountcode, strerror(errno));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|