Check if Time Condition True


(Rabba Zabba) #1

Hi everyone! I would like to set a cronjob that checks if a particular time condition is activated or matches and send an email if this is the case.
I have been looking for a way to check for time conditions in an asterisk session and can’t really find a solution. Does anyone here have a hint or an advice for me? Would be greatly appreciated.

thanks,

Ryan


(Itzik) #2

Make sure that Time Condition has a BLF. In my case *272 is the BLF of TC2

Then, you can do either of the following

[root@yptest ~]# asterisk -x"core show hints" | grep *272
*272@timeconditions-: Custom:TC2            State:Idle            Presence:not_set         Watchers  0

Or

[root@yptest ~]# asterisk -x"core show hint *272"
*272@timeconditions-: Custom:TC2            State:Idle            Presence:not_set         Watchers  0
1 hint matching extension *272

Or

[root@yptest ~]# asterisk -x"database show" | grep TC2
/CustomDevstate/TC2                               : NOT_INUSE

Or…

[root@yptest ~]# asterisk -x"database show CustomDevstate TC2"
/CustomDevstate/TC2                               : NOT_INUSE
1 results found.

(Rabba Zabba) #3

Thank you! I set the “invert BLF hint” in the freePBX time condition console to “yes” and now I can find it with core show hint. I thought that it literally meant “invert” and left it on “no” and was wondering why it wasn’t showing up with core show hint. After reading your message and seeing that I pretty much had the same approach I just tried the setting out. Thank you for the help!