]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cdr_mysql.c: Apply cdrzone to start and answer
authoralex <alexandr.revin@gmail.com>
Wed, 13 Sep 2017 08:46:27 +0000 (11:46 +0300)
committerJoshua Colp <jcolp@digium.com>
Mon, 18 Sep 2017 12:03:20 +0000 (07:03 -0500)
Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0

addons/cdr_mysql.c

index f8f4192acde08f0901dd27c416ef0fc503a1726e..1c116636fb15bd272cef7ea380e4b86a78f4219a 100644 (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));