A
A
Alghazanth2016-05-31 14:21:30
Asterisk
Alghazanth, 2016-05-31 14:21:30

How to correctly set up conditional jumps in the asterisk dialplan?

There is a piece of the dialplan: pastebin.com/sC1XPwCt
How to add an else statement under ifTime so that if the time condition is not met, the dialplan under else is executed?
When adding an else block, ael-config does not compile, stating "syntax error, unexpected 'else'".

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Henry, 2016-05-31
@Henryh

And if you try like this:

Set(var=1*1) ; тут время подставить
GotoIf($["${var}" = "1"]?d1,d2) ; тут условие

D
Dmitry Shitskov, 2016-05-31
@Zarom

Does this option also produce 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);
        };
    };
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question