mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -71,15 +71,15 @@ static PGconn *conn = NULL;
|
||||
|
||||
static int pgsql_log(struct ast_cdr *cdr)
|
||||
{
|
||||
struct tm tm;
|
||||
struct ast_tm tm;
|
||||
char sqlcmd[2048] = "", timestr[128];
|
||||
char *pgerror;
|
||||
PGresult *result;
|
||||
|
||||
ast_mutex_lock(&pgsql_lock);
|
||||
|
||||
ast_localtime(&cdr->start.tv_sec, &tm, NULL);
|
||||
strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
|
||||
ast_localtime(&cdr->start, &tm, NULL);
|
||||
ast_strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm);
|
||||
|
||||
if ((!connected) && pghostname && pgdbuser && pgpassword && pgdbname) {
|
||||
conn = PQsetdbLogin(pghostname, pgdbport, NULL, NULL, pgdbname, pgdbuser, pgpassword);
|
||||
|
||||
Reference in New Issue
Block a user