Fixes from bkw_. Formatting in app_db.c and handle start right in cdr_pgsql.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
James Golovich
2004-07-09 16:19:00 +00:00
parent f107562f75
commit 9e0e3799bf
2 changed files with 175 additions and 238 deletions

View File

@@ -49,18 +49,14 @@ PGresult *result;
static int pgsql_log(struct ast_cdr *cdr)
{
struct tm tm;
struct timeval tv;
char sqlcmd[2048], timestr[128];
time_t t;
char *pgerror;
char *pgerror;
ast_mutex_lock(&pgsql_lock);
memset(sqlcmd,0,2048);
gettimeofday(&tv,NULL);
t = tv.tv_sec;
localtime_r(&t,&tm);
localtime_r(&cdr->start.tv_sec,&tm);
strftime(timestr,128,DATE_FORMAT,&tm);
if ((!connected) && pghostname && pgdbuser && pgpassword && pgdbname) {