All;
I'm trying to implement day/night mode so what I did is set my main inbound route with 2 actions/time-based handlers. The first says if the office is closed run script tl-menu and go to IVR "Company-Closed", except if OFFICE_OPEN_OVERRIDE is set. The second action says if the office is open, run script tl-menu and go to IVR "Company-Open". Straightforward, right? When OFFICE_OPEN_OVERRIDE IS NOT set, everything works. When it IS set, I get this error:
Timeout, but no rule 't' in context 'from-outside-redir'
It seems to me that the dialplan logic is wrong in the file inbound.include. This is what I have:
exten => 2402153479,3,GotoIf($["${OFFICE_OPEN_OVERRIDE}" != ""]?7)
...
...
exten => 2402153479,7,NoOp(${EXTEN})
exten => 2402153479,8,GotoIfTime(9:00-17:00,mon-fri,*,*?from-outside-2402153479-vbs-open-hours,${EXTEN},1)
So lets say in the case that it is a Sunday and I have OFFICE_OPEN_OVERRIDE = 1, I then jump to the code above. It should fail then. I think what it should do is add a line 9 that does something like this and jump to that one.
exten => 2402153479,9,GotoIfTime(*,*,*,*?from-outside-2402153479-vbs-open-hours,${EXTEN},1)
Now that would work. On a seperate note, doesn't it make better sense to put all global variables in Astdb so their values are preserved after a restart? What do all of you think?
Thanks
FSD
Yeah, I'm an idiot. Theres
Yeah, I'm an idiot. Theres no question about it. For some reason, in my mind I had it backwards. Thanks for clearing that up.
FSD
it sounds backwards to me. Open/closed is a binary condition right? so if it isnt open, naturally its closed. So why would you define your closed hours and open hours? Logic dictates that if you arent open... your closed right? So create a 2nd all-hour schedule
step 1... if time is from 9:00 - 16:59 and mon-fri, run open office ivr
step 2 ... new-all-hours ... go to closed office ivr unless OPEN_OFFICE_OVERRIDE is set
step 3 ... tl-all-hours .. go to open office IVR
I generally use the open office override in reverse. I never run into a situation where someone who is normally closed will open up their phones; they work extra hours but not to talk to callers. I do run into customers who need to close the office when its normally open. So mine is 2 steps..
step 1 .. daytime schedule, run open office ivr unless OPEN_OFFICE_OVERRIDE is set
step 2 .. tl-all-hours, go to closed office ivr
And you are correct that variables do not survive a restart unless you set them in Global Variables inside PBX Manager. Using the astdb would resolve this.