|
|
@ -245,7 +245,7 @@ db_reconnect:
|
|
|
|
struct ast_tm tm;
|
|
|
|
struct ast_tm tm;
|
|
|
|
char timestr[128];
|
|
|
|
char timestr[128];
|
|
|
|
ast_localtime(&tv, &tm, ast_str_strlen(cdrzone) ? ast_str_buffer(cdrzone) : NULL);
|
|
|
|
ast_localtime(&tv, &tm, ast_str_strlen(cdrzone) ? ast_str_buffer(cdrzone) : NULL);
|
|
|
|
ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %T", &tm);
|
|
|
|
ast_strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
|
|
|
|
value = ast_strdupa(timestr);
|
|
|
|
value = ast_strdupa(timestr);
|
|
|
|
cdrname = "calldate";
|
|
|
|
cdrname = "calldate";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -260,8 +260,7 @@ db_reconnect:
|
|
|
|
/* Need the type and value to determine if we want the raw value or not */
|
|
|
|
/* Need the type and value to determine if we want the raw value or not */
|
|
|
|
if (entry->staticvalue) {
|
|
|
|
if (entry->staticvalue) {
|
|
|
|
value = ast_strdupa(entry->staticvalue);
|
|
|
|
value = ast_strdupa(entry->staticvalue);
|
|
|
|
} else if ((!strcmp(cdrname, "start") ||
|
|
|
|
} else if ((!strcmp(cdrname, "answer") ||
|
|
|
|
!strcmp(cdrname, "answer") ||
|
|
|
|
|
|
|
|
!strcmp(cdrname, "end") ||
|
|
|
|
!strcmp(cdrname, "end") ||
|
|
|
|
!strcmp(cdrname, "disposition") ||
|
|
|
|
!strcmp(cdrname, "disposition") ||
|
|
|
|
!strcmp(cdrname, "amaflags")) &&
|
|
|
|
!strcmp(cdrname, "amaflags")) &&
|
|
|
@ -273,6 +272,12 @@ db_reconnect:
|
|
|
|
strstr(entry->type, "numeric") ||
|
|
|
|
strstr(entry->type, "numeric") ||
|
|
|
|
strstr(entry->type, "fixed"))) {
|
|
|
|
strstr(entry->type, "fixed"))) {
|
|
|
|
ast_cdr_format_var(cdr, cdrname, &value, workspace, sizeof(workspace), 1);
|
|
|
|
ast_cdr_format_var(cdr, cdrname, &value, workspace, sizeof(workspace), 1);
|
|
|
|
|
|
|
|
} else if (!strcmp(cdrname, "start")) {
|
|
|
|
|
|
|
|
struct ast_tm tm;
|
|
|
|
|
|
|
|
char timestr[128];
|
|
|
|
|
|
|
|
ast_localtime(&cdr->start, &tm, ast_str_strlen(cdrzone) ? ast_str_buffer(cdrzone) : NULL);
|
|
|
|
|
|
|
|
ast_strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
|
|
|
|
|
|
|
|
value = ast_strdupa(timestr);
|
|
|
|
} else if (!strcmp(cdrname, "calldate")) {
|
|
|
|
} else if (!strcmp(cdrname, "calldate")) {
|
|
|
|
/* Skip calldate - the value has already been dup'd */
|
|
|
|
/* Skip calldate - the value has already been dup'd */
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|