Dial Plan and GotoIfTime issue

Good Morning all,

I have two problems working with GotoIfTime and dial plans not working as I would expect.

Firstly I have created a context called [test-context]. I have placed an extension in that context.

At the top of that context I have a include statement which calls a outbound route, as defined in the freepbx gui. The gui outbound route calls one of my trunks after asking the user for a pin number.

The first problem: If I comment out the GotoIfTime line in the test-context, it seems to work just fine. When a user calls outbound, the script calls the GUI based outbound route and asks the user for a PIN number, All good!.. But if I have the GotoIfTime included as below, even if outside of the time specified it no longer will call the include statement? Why is this?

Second Problem: When the GotoIfTime is activated, it jumps to the new context [in-hours] and then ONLY executes the single line listed in the last parameter of the GotoIfTime statement. So in this case it says “sorry” then returns to the calling context and continues on from the the next statement. What I want it to do is to jump to the [in-hours] context if the GotoIfTime is active and execute all commands in the [in-hours] context?

[test-context]
include => outrt-009-Test_context

exten => _X.,1,answer()
exten => _X.,2,GotoIfTime(09:00-12:00|mon-fri||?in-hours,${EXTEN},1)
exten => _X.,3,playback,yes-dear
exten => _X.,4,hangup()

[in-hours]
exten => _X.,1,Playback(sorry)
exten => _07.,2,Dial(IAX2/[email protected]/${EXTEN},20)
exten => _09.,3,Dial(IAX2/[email protected]/${EXTEN},20)
exten => _X.,4,Dial(IAX2/[email protected]/${EXTEN},20)
exten => _X.,5,hangup()

Any help would be Fantastic as I’m a bit of a newbee with custom contexts.

Thanks

Alan Scott
http://www.logicalsolutions.co.nz