Skip to end of metadata
Go to start of metadata

While()

Synopsis

Start a while loop.

Description

Start a While Loop. Execution will return to this point when EndWhile() is called until expr is no longer true.

Syntax

While(expr)
Arguments
  • expr

See Also

Import Version

This documentation was imported from Asterisk Version GIT-master-7d17164

  • No labels

4 Comments

  1. Extra information from  ASTERISK-25525 - A call EndWhile can cause the dial plan to jump to another context. Open

    Usage rules:

    1. While marks the start of a while loop in the dialplan as well as the condition to keep executing the loop. For the While to terminate the loop, the loop's EndWhile must have been executed before. This implies that the while condition must have been true at least once.
    2. EndWhile marks the end of the while loop.
    3. ExitWhile breaks out of the while loop and jumps to the loop's EndWhile location. For ExitWhile to know where to go, the loop's EndWhile must have been executed before.
    4. ContinueWhile jumps to the current while loop's While location.
    1. This page is created by a bot based on the source code documentation.

      Your comment will be purged if this page is updated.

      Please submit your suggested change to issues.asterisk.org/jira, and additionally, if possible, a patch to gerrit.asterisk.org.

      Thanks Jonathan Harris

      1. Thanks Rusty Newton - will do. Having got bitten by the Endwhile thing because of lack of While docs, I saw that in that ticket you noted that the documentation was not sufficient and that the extra info should go into the docs. As there's already a ticket, shall I just add to that to "nudge" it?

        1. Jonathan Harris , yeah you can add it on the ticket, or if you can make a patch for the source then you can submit it to the ticket and to Gerrit so it can be reviewed and merged in. If you need any help creating a patch feel free to send me an E-mail or you can ask for help on asterisk-dev on irc.freenode.net.