[svn-commits] mjordan: trunk r391964 - /trunk/addons/cdr_mysql.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jun 16 22:31:21 CDT 2013


Author: mjordan
Date: Sun Jun 16 22:31:19 2013
New Revision: 391964

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391964
Log:
Make cdr_mysql compile again by not directly setting the run-time CDR object

A stray ast_cdr_setvar was missed in cdr_mysql (silly addons). This has now
been refactored to not set the property, as the property would have been set
on a run-time object that was already dispatched to the backend. The module
simply remembers the value it wanted to set and writes it to MySQL later
in the processing.


Modified:
    trunk/addons/cdr_mysql.c

Modified: trunk/addons/cdr_mysql.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/cdr_mysql.c?view=diff&rev=391964&r1=391963&r2=391964
==============================================================================
--- trunk/addons/cdr_mysql.c (original)
+++ trunk/addons/cdr_mysql.c Sun Jun 16 22:31:19 2013
@@ -251,7 +251,7 @@
 					char timestr[128];
 					ast_localtime(&tv, &tm, ast_str_strlen(cdrzone) ? ast_str_buffer(cdrzone) : NULL);
 					ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %T", &tm);
-					ast_cdr_setvar(cdr, "calldate", timestr);
+					value = ast_strdupa(timestr);
 					cdrname = "calldate";
 				} else {
 					cdrname = "start";
@@ -278,6 +278,8 @@
 				 strstr(entry->type, "numeric") ||
 				 strstr(entry->type, "fixed"))) {
 				ast_cdr_format_var(cdr, cdrname, &value, workspace, sizeof(workspace), 1);
+			} else if (!strcmp(cdrname, "calldate")) {
+				/* Skip calldate - the value has already been dup'd */
 			} else {
 				ast_cdr_format_var(cdr, cdrname, &value, workspace, sizeof(workspace), 0);
 			}




More information about the svn-commits mailing list