Dialplan – Using Multiple AND Or OR In Set Is It Possible ?

Home » Asterisk Users » Dialplan – Using Multiple AND Or OR In Set Is It Possible ?
Asterisk Users 3 Comments

Hello,

we want to use something like

same = n,ExecIf($[“A” = “B”]?Set(C=1) & Set(D=2) & …)

Problem is that result gives C=1) & Set(D=2) & …

Is there a possibility to use multiple AND or OR in such a way ?


Daniel

3 thoughts on - Dialplan – Using Multiple AND Or OR In Set Is It Possible ?

  • No, logical operators are for comparing True and False – they can’t be used to say “do multiple things”.

    I’d suggest two ways of doing what you need:

    a) invert the test and change the ExecIf() to a GotoIf() which skips past the next few lines, each of which has one of your Set() statements on it.

    b) leave the logic as it is but change ExecIf() to GosubIf) and put the Set()
    statements into a subroutine context.

    Regards,

    Antony.


    René Descartes walks in to a bar. The barman asks him “Do you want a drink?”
    Descartes says “I think not,” and disappears.

    Please reply to the list;
    please *don’t* CC me.

  • Le 21/04/2020 à 15:23, Antony Stone a écrit :

    Thanks for your reply. We had applied the second approach.

    Regards


    Daniel

  • Use the ARRAY version of Set.

    same = n,ExecIf($[“A” = “B”]?Set(ARRAY(C,D)=1,2))