summaryrefslogtreecommitdiff
path: root/cdr
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-03-29 00:42:16 +0000
committerMark Spencer <markster@digium.com>2003-03-29 00:42:16 +0000
commit13d3fd287b676e94698238fd0e5ee03172566aab (patch)
tree815f7d7364b438b8f4e8459d20a2cce0412de1e9 /cdr
parent7674dff43d576c1fa06d3ee38c427d38596e2fbf (diff)
Handle call forward on SIP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr')
-rwxr-xr-xcdr/cdr_mysql.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/cdr/cdr_mysql.c b/cdr/cdr_mysql.c
index 666a4e29a..137febb46 100755
--- a/cdr/cdr_mysql.c
+++ b/cdr/cdr_mysql.c
@@ -39,21 +39,18 @@ static MYSQL *mysql;
static int mysql_log(struct ast_cdr *cdr)
{
struct tm *tm;
- struct timeval *tv;
- struct timezone *tz;
- char *sqlcmd, *timestr;
+ struct timeval tv;
+ struct timezone tz;
+ char *sqlcmd, timestr[128];
time_t t;
- tv = (struct timeval *)malloc(sizeof(struct timeval));
- tz = (struct timezone *)malloc(sizeof(struct timezone));
sqlcmd = (char *)malloc(2048);
- timestr = (char*)malloc(128);
memset(sqlcmd,0,2048);
- gettimeofday(tv,tz);
- t = tv->tv_sec;
+ gettimeofday(&tv,&tz);
+ t = tv.tv_sec;
tm = localtime(&t);
strftime(timestr,128,DATE_FORMAT,tm);