GotoIfTime Problem

I’m using GotoIfTime to branch to play a different message depending on if we are open or closed.

Basically, it is GotoIfTime 1100-2300 open …

I’ve noticed that the first call that comes in after 2300 actually branches to open instead of falling through like it should. Subsequent calls fall through properly.

Has anyone else noticed this issue?


I have no idea what could be causing your problem but it might help if you post the relevant part of your dialplan.


Sean Browne
Cardiff IT Support Ltd
0800 011 2931

Thanks for the reply. Below is the relevaent code.

As I said above, this works - except for the very first call after 23:00. For example, last night I called at 23:05 and it branched to open. I called right back and it worked fine. And continued to work fine.



exten => s,1,Wait(3)
exten => s,n,Answer()
exten => s,n,Set(CALLERID(name)="${ARG1}")

exten => s,n,GotoIfTime(10:30-23:00,sun-thu,,?open)
exten => s,n,GotoIfTime(10:30-23:59,fri-sat,,?open)
exten => s,n,Goto(closed)

exten => s,n(open),Playback(/recordings/3Forall)
exten => s,n,Goto(queue)

exten => s,n(closed),Playback(/recordings/closed_message)
exten => s,n,Goto(queue)

exten => s,n(queue),Queue(order-queue)
exten => s,n,Hangup[/code]

Is it possible your server time is off by a few minutes?

I’ve had this problem as well. I verified that my time was correct by typing “date” in the command line. In addition, I dialed the extension to play the current date and time. After the first call or 2 minutes after the time condition will the dialplan actually route the calls correctly.

For me, I have business hours from 8am to 5pm. At 5:01pm, I can still call in to the open dialplan. Some unspecified time later (I’m assuming 2 minutes), calling again will reach the closed dialplan.

exten => s,1,GotoIfTime(08:00-17:00|mon-fri|*|*?ivr-open,s,1)
exten => s,n,Goto(ivr-closed,s,1)

I have same issue with v1.6.1.1 see below from message log (verbose on)

[[color=red]Jun 24 18:01:45[/color]] VERBOSE[23060] pbx.c: – Executing [start@synergy-techsupport:3] e[1;36;40mGotoIfTimee[0;37;40m(“e[1;35;40mDAHDI/1-1e[0;37;40m”, “e[1;35;40m[color=red]08:00-18:00,mon-fri[/color],,?[color=red]open[/color],1e[0;37;40m”) in new stack
[Jun 24 18:01:45] VERBOSE[23060] pbx.c: – Goto (synergy-techsupport,[color=red]open[/color],1)
[Jun 24 18:01:45] VERBOSE[23060] pbx.c: – Executing [open@synergy-techsupport:1] e[1;36;40mPlaybacke[0;37;40m(“e[1;35;40mDAHDI/1-1e[0;37;40m”, “e[1;35;40msyn-helpdesk-welcomee[0;37;40m”) in new stack

I can intermittently reproduce this.

Line in extensions.conf is

exten => start,n,GotoIfTime(08:00-18:00,mon-fri,,?open,1)