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 317b62c8b4
commit 1199927fc0
1 changed files with 4 additions and 5 deletions

View File

@ -258,9 +258,7 @@ db_reconnect:
/* Need the type and value to determine if we want the raw value or not */
if (entry->staticvalue) {
value = ast_strdupa(entry->staticvalue);
} else if ((!strcmp(cdrname, "answer") ||
!strcmp(cdrname, "end") ||
!strcmp(cdrname, "disposition") ||
} else if ((!strcmp(cdrname, "disposition") ||
!strcmp(cdrname, "amaflags")) &&
(strstr(entry->type, "int") ||
strstr(entry->type, "dec") ||
@ -270,7 +268,8 @@ db_reconnect:
strstr(entry->type, "numeric") ||
strstr(entry->type, "fixed"))) {
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;
char timestr[128];
ast_localtime(&cdr->start, &tm, ast_str_strlen(cdrzone) ? ast_str_buffer(cdrzone) : NULL);
@ -364,7 +363,7 @@ static void free_strings(void)
}
static int my_unload_module(int reload)
{
{
struct column *entry;
ast_cli_unregister_multiple(cdr_mysql_status_cli, sizeof(cdr_mysql_status_cli) / sizeof(struct ast_cli_entry));