[Asterisk-code-review] app_waitforcond: New application (asterisk[16])

N A asteriskteam at digium.com
Tue May 25 19:59:24 CDT 2021


N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15928 )

Change subject: app_waitforcond: New application
......................................................................


Patch Set 2:

> Patch Set 1: Code-Review-1
> 
> (6 comments)
> 
> Ready through the code I'm still not sure what an example might look like and why the substitution is being done the way it is. Could you provide an example dialplan of what a call would look like?

Here's an example:
WaitForCondition(#,#[#{EPOCH}>#{futuretime}],10,1)

In this case, I use # to replace $ since that doesn't appear in my expression. This example waits until ${EPOCH} is greater than the variable ${futuretime}, for up to 10 seconds, checking every 1 second.

The substitution is being done this way because normally the main PBX parser eats up the expression and evaluates it before passing it to the application. I looked around in the code and could not find anything that actually receives the expression from the dialplan. So, I had to get a bit creative with that, this was just one of the ways I thought of passing the expression itself into the application without the parser eating it up, so that way we can convert it back and keep evaluating it.

Obviously, that's not the intended use case, that's just to show the syntax, it's more suited for checking variables that were set on other channels (shared/global), or evaluating functions/expressions whose values could change at some point, but we're not sure when.


-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15928
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I08adf2824b8bc63405778cf355963b5005612f41
Gerrit-Change-Number: 15928
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-CC: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Wed, 26 May 2021 00:59:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210525/924ba77e/attachment-0001.html>


More information about the asterisk-code-review mailing list