How to set up conditionals in the dialplan of your asterisk?

There is a piece of dialplan: pastebin.com/sC1XPwCt
How to add under ifTime else statement to if not run-time condition, were performed under dialplan else?
When you add in the else block ael-config not compileda, claiming that "syntax error, unexpected 'else'".
July 9th 19 at 10:16
2 answers
July 9th 19 at 10:18
And if to try so:
Set(var=1*1) ; here the time frame
GotoIf($["${var}" = "1"]?d1,d2) ; then the condition
What if there is a GotoIfTime? And the question from the author about the AEL. - Jensen.Rosenbaum commented on July 9th 19 at 10:21
July 9th 19 at 10:20
This option also gives an error?
context incoming {
 includes {
local_calls;
};

 _. => {
 ifTime (09:00-19:00|mon-fri|*|*)
 switch (${EXTEN}) {
 case 123:
 goto to_123,123,begin;
 case 456:
 goto to_456,456,begin;
};

 else {
Background(${ivr_dir}/16);
Waitexten(3);
};
};
};
Yes, the same parsing error. I've tried many options but nothing came up. - Jensen.Rosenbaum commented on July 9th 19 at 10:23

Find more questions by tags Asterisk