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

N A asteriskteam at digium.com
Sat May 22 11:32:40 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 1:

> Patch Set 1:
> 
> What are actual real world use cases for this? It feels like this is taking dialplan into some sort of external manipulation cross synchronization weird area.

There's no manipulation at all of anything. I wrote it as an optimization to some of my existing dialplan code.

For instance, suppose you have:
same => n(loop),GotoIf($["${somesetofconditions}"="1"|"${somethingelse}"="42"]?dosomething)
same => n,Wait(0.1)
same => n,Goto(loop)

Well, now the Asterisk CLI is a mess with any verbosity at least 3.

I try to avoid polling like this as much as possible, using ChannelRedirect instead, but in some cases, this kind of behavior is needed and it would be very useful to just have an application that waits for some amount of time or until some condition(s) are true.

It doesn't enable anything new per se, it's just a much cleaner and more efficient way to do that, and a generic Wait function unlike the existing functions which are very specific (e.g. WaitUntil, which is for time only, or WaitForRing, which is for ring only). This is just an ultra-generic version of that.


-- 
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: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Sat, 22 May 2021 16:32:40 +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/20210522/7479537d/attachment.html>


More information about the asterisk-code-review mailing list