From: Matthew Jordan Date: Mon, 17 Jun 2013 03:31:19 +0000 (+0000) Subject: Make cdr_mysql compile again by not directly setting the run-time CDR object X-Git-Tag: 13.0.0-beta1~1660 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b992bc74d13ae3ecb28f711a29c7bb6413be762;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391964 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/addons/cdr_mysql.c b/addons/cdr_mysql.c index 23e96c562f..25b55b35f6 100644 --- a/addons/cdr_mysql.c +++ b/addons/cdr_mysql.c @@ -251,7 +251,7 @@ db_reconnect: 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 @@ 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, "calldate")) { + /* Skip calldate - the value has already been dup'd */ } else { ast_cdr_format_var(cdr, cdrname, &value, workspace, sizeof(workspace), 0); }