Missed cdr_csv commit for CDR user data

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jeremy McNamara
2004-01-11 05:04:16 +00:00
parent 6ae49b9ccd
commit 02196c2c68

View File

@@ -28,6 +28,7 @@
#define DATE_FORMAT "%Y-%m-%d %T" #define DATE_FORMAT "%Y-%m-%d %T"
/* #define CSV_LOGUNIQUEID 1 */ /* #define CSV_LOGUNIQUEID 1 */
/* #define CSV_LOGUSERFIELD 1 */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -60,6 +61,7 @@
"disposition", // ANSWERED, NO ANSWER, BUSY "disposition", // ANSWERED, NO ANSWER, BUSY
"amaflags", // DOCUMENTATION, BILL, IGNORE etc, specified on a per channel basis like accountcode. "amaflags", // DOCUMENTATION, BILL, IGNORE etc, specified on a per channel basis like accountcode.
"uniqueid", // unique call identifier "uniqueid", // unique call identifier
"userfield" // user field set via SetCDRUserField
*/ */
static char *desc = "Comma Separated Values CDR Backend"; static char *desc = "Comma Separated Values CDR Backend";
@@ -126,6 +128,7 @@ static int append_date(char *buf, struct timeval tv, int len)
static int build_csv_record(char *buf, int len, struct ast_cdr *cdr) static int build_csv_record(char *buf, int len, struct ast_cdr *cdr)
{ {
buf[0] = '\0'; buf[0] = '\0';
/* Account code */ /* Account code */
append_string(buf, cdr->accountcode, len); append_string(buf, cdr->accountcode, len);
@@ -163,6 +166,10 @@ static int build_csv_record(char *buf, int len, struct ast_cdr *cdr)
#ifdef CSV_LOGUNIQUEID #ifdef CSV_LOGUNIQUEID
/* Unique ID */ /* Unique ID */
append_string(buf, cdr->uniqueid, len); append_string(buf, cdr->uniqueid, len);
#endif
#ifdef CSV_LOGUSERFIELD
/* append the user field */
append_string(buf, cdr->userfield,len);
#endif #endif
/* If we hit the end of our buffer, log an error */ /* If we hit the end of our buffer, log an error */
if (strlen(buf) < len - 5) { if (strlen(buf) < len - 5) {