cdr_mysql.c: Apply cdrzone to start and answer

Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
This commit is contained in:
alex
2017-09-13 11:46:27 +03:00
committed by Joshua Colp
parent b6e1b13de4
commit f1eb36ea51

View File

@@ -265,9 +265,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, "answer") || } else if ((!strcmp(cdrname, "disposition") ||
!strcmp(cdrname, "end") ||
!strcmp(cdrname, "disposition") ||
!strcmp(cdrname, "amaflags")) && !strcmp(cdrname, "amaflags")) &&
(strstr(entry->type, "int") || (strstr(entry->type, "int") ||
strstr(entry->type, "dec") || strstr(entry->type, "dec") ||
@@ -277,7 +275,8 @@ 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")) { } else if (!strcmp(cdrname, "start") || !strcmp(cdrname, "answer") ||
!strcmp(cdrname, "end")) {
struct ast_tm tm; struct ast_tm tm;
char timestr[128]; char timestr[128];
ast_localtime(&cdr->start, &tm, ast_str_strlen(cdrzone) ? ast_str_buffer(cdrzone) : NULL); ast_localtime(&cdr->start, &tm, ast_str_strlen(cdrzone) ? ast_str_buffer(cdrzone) : NULL);