Can't get time condition working, where am I wrong?


#1

I’ve created a time group “working hours”:

Time to start 08:00
Time to finish 17:00
Week day start: Monday
Week day end: Friday

This is used by time condition “opening hours” set as destination for inbound route:
Destination matches: IVR
Destinatio non-matches: “Closed Office” announcement

At 17:00 Closed Office message is played but next day at 08:00 (or Monday 08:00) calls are not switched in service to IVR, closed office is still playing…
Where am I wrong ?


#2

Can you send a pick of the config?


#3

(Tom Ray) #4

Set the time zone to your time zone in the time condition. Your system time might not be the PHP time zone you have set. Those are two different time zone settings. The PHP time zone is only used when PHP scripts are used. The time conditions will use the actual server time setting.


#5

First of all, sorry for my bad english.

You must to select in the inbound routes the time condition.

check that :

Inbound routes:
I have some inbound routes but you must select only where you want the time condition:


#6

Already done, same behavior.
The actual server time shows the right time and date.
The fact the “current state” inside time condition is “unknown” make me think of something wrong.

What I really don’t know, and I ask for is : no one else have this issue ? no one else use this “not working” time conditions system that is one of basic feature one wants in a telephone system ?
I’ve read something similar as freepbx issue , probably still unresolved.
Unless I’m making a macroscopic error, that’s why I’m here for…


#7

P.S.
time conditions timezone is the same as Advanced Settings->PHP_Timezone (both Europe/Rome)
Correct server time shown,
However, “date” command in linux cli returns UTC time
Is this ok ?


(Dave Burgess) #8

This might seem random, but make sure incron is working.


(Andrew) #9

No, it should show you the correct timezone if set correctly in OS. ls -l /etc/localtime will show you what timezone you are set to use.


(R. Stindl) #10

What does it say in system-admin/time-zone in the GUI?

EDIT: cli: date should look like this
cli-date


(Dave Burgess) #11

The reason I suggested this is the “Unknown” time condition. Incron runs once an minute to check these, and if you have a problem with incron not running (as I recently did), your time conditions won’t get set correctly.


(R. Stindl) #12

By the way…do you have an original freePBX distro or did you build your own freePBX-Asterisk server? Did you reboot it after changing the time zone?


#13

Reinhard, my fault, I was sure I set timezone in sysadmin to my timezone, it wasn’t…:tired_face:
Fixed.
Dave, incron is running:

service incrond status
Redirecting to /bin/systemctl status incrond.service
● incrond.service - Inotify System Scheduler
Loaded: loaded (/usr/lib/systemd/system/incrond.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-06-01 22:40:52 CEST; 15min ago
Main PID: 642 (incrond)
CGroup: /system.slice/incrond.service
└─642 /usr/sbin/incrond

but incrontab -l returns nothing, empty.
time conditions status still unknown


(Lorne Gaetz) #14

Time zone change needs lots of services restarted, so the advice is just to reboot.


#15

Yes, already rebooted, and still unknown…

/var/log/cron gives me this every minute :

Jun 1 23:13:01 freepbx crond[915]: (asterisk) RELOAD (/var/spool/cron/asterisk)
Jun 1 23:13:01 freepbx CROND[7030]: (asterisk) CMD ([ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null)
Jun 1 23:13:01 freepbx CROND[7031]: (asterisk) CMD (/var/www/html/admin/modules/iotserver/bin/check_system_settings.php 2>&1 >/dev/null)
Jun 1 23:13:01 freepbx CROND[7032]: (asterisk) CMD (/usr/sbin/fwconsole queuestats --syncall >> /tmp/reader.log 2>&1)
Jun 1 23:13:23 freepbx crontab[7082]: (asterisk) LIST (asterisk)
Jun 1 23:13:23 freepbx crontab[7084]: (asterisk) LIST (asterisk)
Jun 1 23:13:23 freepbx crontab[7106]: (asterisk) LIST (asterisk)
Jun 1 23:13:23 freepbx crontab[7108]: (asterisk) LIST (asterisk)
Jun 1 23:13:23 freepbx crontab[7110]: (asterisk) LIST (asterisk)
Jun 1 23:13:23 freepbx crontab[7111]: (asterisk) REPLACE (asterisk)
Jun 1 23:13:23 freepbx crontab[7113]: (asterisk) LIST (asterisk)
Jun 1 23:13:23 freepbx crontab[7115]: (asterisk) LIST (asterisk)
Jun 1 23:13:23 freepbx crontab[7116]: (asterisk) REPLACE (asterisk)
Jun 1 23:13:23 freepbx crontab[7118]: (asterisk) LIST (asterisk)

Latest FreePBX distro.


#16

Time condition itself works, tested !
My fault was the wrong system timezone declared in sysadmin (two hours back - UTC) indeed.

The other fault is probably to look at “Change Override” state (currently listed as unknown) as indicator of timegroup matching or not.
Should that state really reflect the timegroup matching ? or just the manually-forced time condition state ?