Name

ExitWhile() — Exit from a While() loop, whether or not the conditional has been satisfied

Synopsis

ExitWhile()

Will cause a While() loop to exit whether or not the conditional expression has been satisfied.

exten => 123,1,Set(COUNT=1)
exten => 123,n,While($[${COUNT} < 5])
exten => 123,n,GotoIf($[${COUNT} != 3]?continue)
exten => 123,n,ExitWhile()
exten => 123,n(continue),NoOp()
exten => 123,n,SayNumber(${COUNT})
exten => 123,n,Set(COUNT=$[${COUNT} + 1])
exten => 123,n,EndWhile()

Get Asterisk: The Future of Telephony, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.