<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 1:</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 1:</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 1:</p><p style="white-space: pre-wrap; word-wrap: break-word;">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.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">There's no manipulation at all of anything. I wrote it as an optimization to some of my existing dialplan code.</p><p style="white-space: pre-wrap; word-wrap: break-word;">For instance, suppose you have:<br>same => n(loop),GotoIf($["${somesetofconditions}"="1"|"${somethingelse}"="42"]?dosomething)<br>same => n,Wait(0.1)<br>same => n,Goto(loop)</p><p style="white-space: pre-wrap; word-wrap: break-word;">Well, now the Asterisk CLI is a mess with any verbosity at least 3.</p><p style="white-space: pre-wrap; word-wrap: break-word;">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.</p><p style="white-space: pre-wrap; word-wrap: break-word;">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.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">What are some real world example conditions?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Such as if you need to wait for a small amount of time for something to happen on another channel. That channel might set a SHARED variable (or GLOBAL, just something that's globally readable), and then the polling channel might do something. Except, there might be multiple channels that could be in this state, and the channel that sets the variables doesn't know what channels are waiting for that event to occur, so ChannelRedirect doesn't work so well. Then, consider there could be multiple channels checking for different conditions and such elsewhere in the dialplan. There really isn't a clean way of using ChannelRedirect, polling works since we're not doing it for very long, maybe a few seconds, but whenever the condition is true, we'd like to do something immediately. But this makes a mess in the CLI, so this is a cleaner and more efficient way to do that. I have maybe a dozen of these in my dialplan that I'm replacing with this application. I know others who use similar polling techniques and would benefit from it as well.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15928">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15928">change 15928</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15928"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I08adf2824b8bc63405778cf355963b5005612f41 </div>
<div style="display:none"> Gerrit-Change-Number: 15928 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-CC: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 24 May 2021 17:27:37 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>