aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-11 05:04:16 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-11 05:04:16 +0000
commitd6b767d195f928b97241f349db0e2772dbf4abac (patch)
tree0b0c29b7b3ddd79764cb5a870ff99d4fb5589ae6 /cdr
parent4942b0387816dab43722766fb2b31ac4664cb5d0 (diff)
Missed cdr_csv commit for CDR user data
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1929 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr')
-rwxr-xr-xcdr/cdr_csv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cdr/cdr_csv.c b/cdr/cdr_csv.c
index 4531aab59..c669652be 100755
--- a/cdr/cdr_csv.c
+++ b/cdr/cdr_csv.c
@@ -28,6 +28,7 @@
#define DATE_FORMAT "%Y-%m-%d %T"
/* #define CSV_LOGUNIQUEID 1 */
+/* #define CSV_LOGUSERFIELD 1 */
#include <stdio.h>
#include <string.h>
@@ -60,6 +61,7 @@
"disposition", // ANSWERED, NO ANSWER, BUSY
"amaflags", // DOCUMENTATION, BILL, IGNORE etc, specified on a per channel basis like accountcode.
"uniqueid", // unique call identifier
+ "userfield" // user field set via SetCDRUserField
*/
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)
{
+
buf[0] = '\0';
/* Account code */
append_string(buf, cdr->accountcode, len);
@@ -164,6 +167,10 @@ static int build_csv_record(char *buf, int len, struct ast_cdr *cdr)
/* Unique ID */
append_string(buf, cdr->uniqueid, len);
#endif
+#ifdef CSV_LOGUSERFIELD
+ /* append the user field */
+ append_string(buf, cdr->userfield,len);
+#endif
/* If we hit the end of our buffer, log an error */
if (strlen(buf) < len - 5) {
/* Trim off trailing comma */