[Asterisk-code-review] FIX: apply cdrzone to start and answer (asterisk[14])
Aleksandr Revin
asteriskteam at digium.com
Wed Sep 13 03:55:11 CDT 2017
Aleksandr Revin has uploaded this change for review. ( https://gerrit.asterisk.org/6486
Change subject: FIX: apply cdrzone to start and answer
......................................................................
FIX: apply cdrzone to start and answer
Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
---
M addons/cdr_mysql.c
1 file changed, 4 insertions(+), 6 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/86/6486/1
diff --git a/addons/cdr_mysql.c b/addons/cdr_mysql.c
index 26e8389..1032426 100644
--- a/addons/cdr_mysql.c
+++ b/addons/cdr_mysql.c
@@ -260,9 +260,7 @@
/* 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") ||
@@ -272,7 +270,8 @@
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);
@@ -366,7 +365,7 @@
}
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));
@@ -722,4 +721,3 @@
.unload = unload_module,
.reload = reload,
);
-
--
To view, visit https://gerrit.asterisk.org/6486
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
Gerrit-Change-Number: 6486
Gerrit-PatchSet: 1
Gerrit-Owner: Aleksandr Revin <alexandr.revin at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170913/e37587a8/attachment.html>
More information about the asterisk-code-review
mailing list