[Asterisk-code-review] cdr mysql.c: Apply cdrzone to start and answer (asterisk[15])

Joshua Colp asteriskteam at digium.com
Tue Sep 19 06:45:52 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/6519 )

Change subject: cdr_mysql.c: Apply cdrzone to start and answer
......................................................................

cdr_mysql.c: Apply cdrzone to start and answer

Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
---
M addons/cdr_mysql.c
1 file changed, 4 insertions(+), 5 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved



diff --git a/addons/cdr_mysql.c b/addons/cdr_mysql.c
index f8f4192..1c11663 100644
--- a/addons/cdr_mysql.c
+++ b/addons/cdr_mysql.c
@@ -258,9 +258,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") ||
@@ -270,7 +268,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);
@@ -364,7 +363,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));

-- 
To view, visit https://gerrit.asterisk.org/6519
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
Gerrit-Change-Number: 6519
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Aleksandr Revin <alexandr.revin at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170919/faa9aab6/attachment-0001.html>


More information about the asterisk-code-review mailing list