<p> Attention is currently required from: Joshua Colp. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/16629">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">Patchset:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16629?tab=comments">Patch Set #1:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Or to be more general, there is functionality already such as ExecIf which can be combined with othe […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">It's supposed to be analogous to the C function, to make doing this easy.<br>First of all, it would not be one line of dialplan but multiple, since we need to log a warning that the assertion failed, THEN hang up.<br>And one thing that comes to mind is that doing this manually won't print out the dialplan that actually "failed" the test.<br>I didn't do this before, but it probably also makes sense to print out the location here, which would make this even more cumbersome to do manually.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Think about test suite, for instance, where we can just have a bunch of them, and if it makes it to the end, it passes:</p><p style="white-space: pre-wrap; word-wrap: break-word;">same => n,Assert($[${cond}=${cond2}])<br>same => n,Assert($[${EPOCH}=${EPOCH}])<br>same => n,Assert(...)</p><p style="white-space: pre-wrap; word-wrap: break-word;">Much cleaner than:<br>same => n,GotoIf($[${cond}!=${cond2}]?fail1)<br>same => n,GotoIf($[${EPOCH}!=${EPOCH}]?fail2)<br>...<br>same => n,Goto(success)<br>same => n(fail1),Log(WARNING,fail1 happened: cond was not equal to cond2)<br>same => n,Hangup()<br>same => n(fail2),Log(WARNING,EPOCH was not equal to EPOCH)<br>same => n,Hangup()<br>...<br>well, you get the idea...</p><p style="white-space: pre-wrap; word-wrap: break-word;">Now, it's very clean for this to be in dialplan everywhere, without cluttering things up with ExecIf/Log/Hangup/GotoIf all over the place, and it's easy to interpret why it's there since everyone knows what assert() means in C.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16629">change 16629</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/+/16629"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia089c2debf608f42f5f87e6c29d50e8ebcc093e5 </div>
<div style="display:none"> Gerrit-Change-Number: 16629 </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-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Sun, 24 Oct 2021 16:06:48 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>