FOOD FOR THOUGHT Telephone Reminders in the Midnight Hour

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Below is a video of my issue. Please watch the video in HD to see the Asterisk console output


In short:

-web portal for reminders work fine with Flite
- reminders via phone don't work when selecting time

Some important facts:

-running CentOS 6.8 - Still don't feel comfortable about 7
-running latest version of Asterisk
-running latest version of the FreePBX GUI
-using Pat Fleet voice pack - for the most part

I swear these reminders used to work before. Anyone?
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Do the Asterisk logs REALLY show more than what the command line does?
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Okay,

Here's a paste of my log:

https://pastebin.com/pb3RnN5C

I don't care if its "sanitized" or not.

What I found interesting in my experiments was I can set reminders for the next day but not on the current day if that makes sense. In the logs it showed me trying to set the reminder for the same day and the same hour - just a few minutes ahead.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Do the Asterisk logs REALLY show more than what the command line does?
Well they really do because they have a time stamp and by default the CLI doesn't (you can fix that though) , but that's beside the point, I haven't seen anything from you CLI or logs.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Okay,

Here's a paste of my log:

https://pastebin.com/pb3RnN5C

I don't care if its "sanitized" or not.

What I found interesting in my experiments was I can set reminders for the next day but not on the current day if that makes sense. In the logs it showed me trying to set the reminder for the same day and the same hour - just a few minutes ahead.


well you have a lot of calls in there , you should concentrate on tyhe useful bits (calls can be identifid by the number between between [ and ], grep can filter)
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Right, after more experimenting, I was able to confirm that no matter what, you CAN NOT set a reminder via TELEPHONE on the same day, no matter if the time is behind or ahead your current time. You can however set a reminder via telephone for the next day and so on. Could there be an error in the script or dial plan? This came default!

UPDATE: Also unable to set a reminder for the next day at midnight....hmmmm
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
Code:
[2016-11-02 23:41:33] VERBOSE[13089][C-00000bf6] res_agi.c: <SIP/3191-0000010c>AGI Script checktime.php completed, returning 0
[2016-11-02 23:41:33] VERBOSE[13089][C-00000bf6] pbx.c: Executing [s@reminder4:13] GotoIf("SIP/3191-0000010c", "1?99,1") in new stack
[2016-11-02 23:41:33] VERBOSE[13089][C-00000bf6] pbx_builtins.c: Goto (reminder4,99,1)
[2016-11-02 23:41:33] VERBOSE[13089][C-00000bf6] pbx.c: Executing [99@reminder4:1] Playback("SIP/3191-0000010c", "conf-errormenu") in new stack

Could you post the dialplan (reminder4)?
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Your agi script is returning an error

exten => s,5,AGI(checktime.php,${APPTDT},${APPTTIME},0,${APPTPHONE})
exten => s,6,GotoIf($["foo${HOTTIME}" = "fooBAD"]?99,1)

post the contents of checktime.php
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
My guess is that :-

  1. if ($NEWTIME<$RIGHTNOW) :
  2. $BADFLAG = 1 ;
  3. endif ;

  4. if ($BADFLAG<>0) :
  5. $txt2write = "SET VARIABLE HOTTIME \"BAD\"" ;
  6. execute_agi($txt2write) ;
  7. else :
  8. $txt2write = "SET VARIABLE HOTTIME \"" . $NEWTIME . "\"" ;
  9. execute_agi($txt2write) ;
  10. endif ;

is returning HOTTIME as BAD because your chosen alarm time is < than now(), try setting one for tomorrow. . .
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
So my results are:

can set reminder for tomorrow
cant set reminder for midnight
can set reminder 5 minutes or more after midnight

It's still inconvenient that you cant set a reminder for the next hour during the same day. Kinda defeats the purpose of reminders.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
So my results are:

can set reminder for tomorrow
cant set reminder for midnight
can set reminder 5 minutes or more after midnight

It's still inconvenient that you cant set a reminder for the next hour during the same day. Kinda defeats the purpose of reminders.


That sounds likely, try using todays date as 4 digits instead of #

and turn on agi debugging to see what is sent as argv[1] either way
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
Okay, I was able to enter 11:59PM. I cant go directly to 00:00 (12:00am). Strange....
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Not really strange at all, look at the code you posted :-

  1. if (strlen($APPTTIME)<>4) :
  2. $BADFLAG=1 ;
  3. endif ;
  4. if (substr($APPTTIME,0,4)<"0005") :
  5. $BADFLAG=1 ;
  6. endif ;
  7. if (substr($APPTTIME,0,4)>"2359") :
  8. $BADFLAG=1 ;
  9. endif ;
so it wont work for 0004 either, the problem is unix dates, both 0000 and 2400 are acceptable for time of day, but think about it , "which day?" what do YOU mean when you choose either for days > now() ? . Perhaps Ward could rethink the logic here, but generally us linux guys hate to program for the "witching hour" when a user is involved ;-)
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Before investing a lot of time in this, I guess the question is how many folks schedule reminders in the 5 minutes surrounding midnight. :sleep1:
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top