Index: cel/cel_pgsql.c =================================================================== --- cel/cel_pgsql.c (revisión: 406488) +++ cel/cel_pgsql.c (copia de trabajo) @@ -64,6 +64,7 @@ static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbport = NULL, *table = NULL; static int connected = 0; static int maxsize = 512, maxsize2 = 512; +static int usegmtime = 0; /*! \brief show_user_def is off by default */ #define CEL_SHOW_USERDEF_DEFAULT 0 @@ -129,7 +130,7 @@ ast_mutex_lock(&pgsql_lock); - ast_localtime(&record.event_time, &tm, NULL); + ast_localtime(&record.event_time, &tm, usegmtime ? "GMT" : NULL); ast_strftime(timestr, sizeof(timestr), DATE_FORMAT, &tm); if ((!connected) && pghostname && pgdbuser && pgpassword && pgdbname) { @@ -178,7 +179,7 @@ } else { /* char, hopefully */ LENGTHEN_BUF2(31); - ast_localtime(&record.event_time, &tm, NULL); + ast_localtime(&record.event_time, &tm, usegmtime ? "GMT" : NULL); ast_strftime(buf, sizeof(buf), DATE_FORMAT, &tm); ast_str_append(&sql2, 0, "%s'%s'", SEP, buf); } @@ -396,6 +397,7 @@ const char *tmp; PGresult *result; struct columns *cur; + int newusegmtime = 0; if (!(var = ast_variable_browse(cfg, "global"))) { ast_log(LOG_WARNING,"CEL pgsql config file missing global section.\n"); @@ -464,6 +466,10 @@ if ((tmp = ast_variable_retrieve(cfg, "global", "show_user_defined"))) { cel_show_user_def = ast_true(tmp) ? 1 : 0; } + if ((tmp = ast_variable_retrieve(cfg, "global", "usegmtime"))) { + newusegmtime = ast_true(tmp); + } + usegmtime = newusegmtime; if (option_debug) { if (ast_strlen_zero(pghostname)) { ast_debug(3, "cel_pgsql: using default unix socket\n"); Index: CHANGES =================================================================== --- CHANGES (revisión: 406488) +++ CHANGES (copia de trabajo) @@ -2108,6 +2108,7 @@ -------------------------- * cel_pgsql now supports the 'extra' column for data added using the CELGenUserEvent() application. + * cel_pgsql add option usegmtime to have timestamps in GMT for log entries pbx_lua -------------------------- Index: configs/cel_pgsql.conf.sample =================================================================== --- configs/cel_pgsql.conf.sample (revisión: 406488) +++ configs/cel_pgsql.conf.sample (copia de trabajo) @@ -59,6 +59,9 @@ ; ;show_user_defined=yes +; Log date/time in GMT. The default of this option is 'no'. +;usegmtime=yes + ;hostname=localhost ;port=5432 ;dbname=asterisk