Summary:ASTERISK-29497: Add conditional branch applications
Reporter:N A (InterLinked)Labels:
Date Opened:2021-06-28 11:54:46Date Closed:2022-12-08 13:53:16.000-0600
Versions:18.5.0 Frequency of
Description:Adds the If, EndIf, and ExitIf applications to allow for conditional execution, similar to While/EndWhile/ExitWhile except that it executes the branch, if true, only once.
Comments:By: Asterisk Team (asteriskteam) 2021-06-28 11:54:46.666-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: N A (InterLinked) 2022-02-02 11:37:37.286-0600

Cross-posting from the asterisk-users list:

> > -----Original Message-----
> > From: asterisk-users <asterisk-users-bounces at lists.digium.com> On Behalf
> > Of Dovid Bender
> > Sent: Thursday, December 23, 2021 12:11 PM
> > To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-
> > users at lists.digium.com>
> > Subject: Re: [asterisk-users] Exec two commands with ExecIf
> >
> > Anyone know why this never made it into Asterisk?
> I believe it was deemed not to be of interest to the community.

Assuming that the dates in that ticket refer to 2021 (I see only months and
days, not years), I don't recall any discussion taking place with the
community about it, so that seems to me like a surprising explanation.

After all, if GotoIf(), ExecIf() and While() are "deemed to be of interest",
and therefore exist, why would a simple If() be deemed not to be of interest?

And, taking it from the other point of view, even if many people genuinely
think "meh, I don't think I'd use this", then surely they just avoid using it,
as I suspect the majority of people do with DumpChan() (for example, to take a
pretty obscure, yet still available, command at random).

In short, what's the drawback to making If() available for those who would use

Personally, I would very much like to see an If() statement made available.


By: Friendly Automation (friendly-automation) 2022-12-08 13:53:17.434-0600

Change 19674 merged by Friendly Automation:
app_if: Adds conditional branch applications


By: Friendly Automation (friendly-automation) 2022-12-08 13:57:36.387-0600

Change 16121 merged by Friendly Automation:
app_if: Adds conditional branch applications


By: Friendly Automation (friendly-automation) 2022-12-08 13:57:59.731-0600

Change 19675 merged by Friendly Automation:
app_if: Adds conditional branch applications