Asterisk Log's Time Changing Automatically

Asterisk server time is changing to GMT automatically. From automatically, I mean asterisk isn’t restarted or such but running asterisk log’s time changes. the default time zone of my system is PST and I have also set usegmttime=no in cdr. conf. The asterisk logs and server time are in the same timezone but after a few days, the asterisk logs’ time zone gets changed to GMT.

Make sure your system time zone set on your zone
please check the your system timezone using below command and set

timedatectl

Local time: Tue 2023-01-10 08:25:52 UTC
Universal time: Tue 2023-01-10 08:25:52 UTC
RTC time: Tue 2023-01-10 08:25:52
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a

and Set the timezone
like

timedatectl set-timezone Asia/Kolkata

System time seems in the correct format as shown below:

It can also be verified from the date command which is giving the time in the PST timezone, but mainly the issue is with asterisk logs which are in GMT.
To add, in cdr.conf usegmttime=no is used so that is creating an issue with why the queue, message, and cdr logs( all of the asterisk logs) have moved to GMT timezone.

Dear HarisFarooq
by default usegmttime is no but if you need to GMT then you will be set the usegmttime=yes otherwise no need to set no option,
now you need to comment this line on like this
;usegmttime=yes

and also try this …
[global]

dsn=CDRMYSQL
loguniqueid=yes
dispositionstring=yes
table=cdr ;<94>cdr<94> is default table name
usegmtime=no ; set to <93>yes<94> to log in GMT
hrtime=yes ;Enables microsecond accuracy with the billsec and duration fields
;newcdrcolumns=yes ;

Could it be that /etc/localtime symlink is breaking for some reason?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.