<p> Attention is currently required from: George Joseph. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/16075">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">File funcs/func_lookup.c:</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/+/16075/comment/a64de643_6386d7a5">Patch Set #9, Line 127:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">/* Substitute variables now, using the location of the lookup */<br> /* strdupa required or we'll just overwrite what we read when we set these */<br>     realcontext = ast_strdupa(ast_channel_context(chan));<br> realexten = ast_strdupa(ast_channel_exten(chan));<br>     realpriority = ast_channel_priority(chan);<br>    ast_channel_lock(chan);<br>       ast_channel_context_set(chan, context);<br>       ast_channel_exten_set(chan, exten);<br>   ast_channel_priority_set(chan, priority);<br>     ast_channel_unlock(chan);<br><br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I don't understand this. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Correct... with a slight technicality.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The reason I added this is that variable substitution doesn't work properly with EXTEN (and also CONTEXT and PRIORITY, though use cases for this are probably rare or non-existent). Without this, EXTEN is the exten of the calling extension. The actual intent would be for EXTEN to be evaluated as the EXTEN of the lookup.</p><p style="white-space: pre-wrap; word-wrap: break-word;">e.g.<br>[lookup]<br>exten => something,2,${EXTEN:-1}</p><p style="white-space: pre-wrap; word-wrap: break-word;">[parent]<br>exten => s,1,NoOp(${EVAL_EXTEN(lookup,something,2)})</p><p style="white-space: pre-wrap; word-wrap: break-word;">We would expect that the function returns: g</p><p style="white-space: pre-wrap; word-wrap: break-word;">Without the code referenced, it will instead return: s.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I couldn't think of a better way to do it at the time. People will expect EXTEN in the lookup context to be the exten there, not the calling exten, and rightly so. Do you have any thoughts or ideas on this? Proper EXTEN evaluation is kind of an important thing. We don't actually need to change the extension, we just need the variable substituter to parse it properly.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Other than this thought, everything sounds good and I will work on this over the next few days.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16075">change 16075</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/+/16075"/><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: Iad81019689674c9f4ac77d235f5d7234adbb1432 </div>
<div style="display:none"> Gerrit-Change-Number: 16075 </div>
<div style="display:none"> Gerrit-PatchSet: 9 </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-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sarah Autumn <sarah@endlesstemple.org> </div>
<div style="display:none"> Gerrit-Attention: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 05 Aug 2021 15:51:44 +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: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>