<p> Attention is currently required from: Joshua Colp, Sarah Autumn, George Joseph. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/16075">View Change</a></p><p>17 comments:</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/+/16075?tab=comments">Patch Set #1:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I think this would be a helpful feature.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Ack</p></li></ul></li><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/+/16075?tab=comments">Patch Set #4:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I personally still wouldn't like to see it in the tree because I disagree with configuring it from t […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><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/+/16075?tab=comments">Patch Set #9:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">If I'm understanding it right, this seems to be oriented around fetching a value from the DB and par […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><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/ea74cdf7_6466de6c">Patch Set #9, Line 39:</a> <code style="font-family:monospace,monospace">LOOKUP</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Rename to EVAL_EXTEN</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/b31eb724_b04a508c">Patch Set #9, Line 41:</a> <code style="font-family:monospace,monospace">Returns the variable-substituted value of an extension in a dialplan context.</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Evaluates the contents of a dialplan extension and returns it as a string.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/9e97ced9_baaef2ba">Patch Set #9, Line 43:</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;"> <syntax><br> <parameter name="extension" required="true" argsep=","><br> <parameter name="extension" required="true" argsep="@"><br> <argument name="extension" required="true" /><br> <argument name="context" /><br> </parameter><br> <argument name="priority" /><br> </parameter><br> </syntax><br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Change to normal [[context,]extensions,]priority syntax.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/85206adb_0d5b79ee">Patch Set #9, Line 52:</a> <code style="font-family:monospace,monospace"> <description></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Part of the confusion around this function were the dialplan entries for the data. Rather than […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/f5a2da96_ab63f949">Patch Set #9, Line 53:</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;"> <para>The LOOKUP function returns the parsed value of an extension<br> in the dialplan. Lookup extensions are no different from ordinary<br> extensions, but you may choose to use any arbitrary value or function,<br> similar to usage of the HINT function. Any variables in the lookup value<br> will be resolved in the context of the lookup context. For example,<br> <literal>${EXTEN}</literal> would refer to the LOOKUP extension, not<br> the extension in the context invoking the function.</para><br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">The EVAL_EXTEN function looks up a dialplan entry by context,extension,priority, evaluates the conte […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/b77d0fa6_537857f3">Patch Set #9, Line 62:</a> <code style="font-family:monospace,monospace"> <ref type="function">HINT</ref></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Referencing HINT is confusing. Reference EVAL instead.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/3ef37d6f_a6eab843">Patch Set #9, Line 72:</a> <code style="font-family:monospace,monospace"> e = pbx_find_extension(c, NULL, &q, context, exten, priority, NULL, "", E_MATCH);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">You need to check if the priority contains non-numeric characters and if it does, you need to pass t […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/694f8976_495db688">Patch Set #9, Line 82:</a> <code style="font-family:monospace,monospace">ast_get_extension_app(e);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">This won't work if the value contains any parentheses. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/48248d2f_c8482822">Patch Set #9, Line 67:</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;">tatic struct ast_exten *ast_lookup_extension(struct ast_channel *c, const char *context, const char *exten, int priority)<br>{<br> struct ast_exten *e;<br> struct pbx_find_info q = { .stacklen = 0 }; /* the rest is set in pbx_find_context */<br> ast_rdlock_contexts();<br> e = pbx_find_extension(c, NULL, &q, context, exten, priority, NULL, "", E_MATCH);<br> ast_unlock_contexts();<br> return e;<br>}<br><br>static int ast_get_lookup(char *lookup, int lookupsize, char *name, int namesize, struct ast_channel *c, const char *context, const char *exten, int priority)<br>{<br> struct ast_exten *e = ast_lookup_extension(c, context, exten, priority);<br> if (e) {<br> if (name) {<br> const char *tmp = ast_get_extension_app(e);<br> if (tmp)<br> ast_copy_string(name, tmp, namesize);<br> }<br> return 0;<br> }<br> return -1;<br>}<br><br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Collapse these two functions. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/752ceba2_e0ffb4a4">Patch Set #9, Line 99:</a> <code style="font-family:monospace,monospace"> AST_DECLARE_APP_ARGS(args,</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Refactor to use the standard [[context,]extensions,]priority syntax.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/81daceab_621d707c">Patch Set #9, Line 116:</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;">context = exten = args.exten;<br> strsep(&context, "@");<br> if (ast_strlen_zero(context))<br> context = "default";<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Default context should be "this" context and default exten should be "this" extension, like it is in […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/154645f2_82702c3c">Patch Set #9, Line 121:</a> <code style="font-family:monospace,monospace"> priority = atoi(args.priority);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">priority can be a label instead of a number.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/e21ae604_87230e6d">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;">Thinking more about this... Just leave it the way you have it. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Would this actually work? If an EVAL_EXTEN calls another EVAL_EXTEN, then the channel is already locked so the second one will fail. What is the downside if the channel is not locked?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16075/comment/e073792a_87ff5dcd">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;">Thinking more about this... Just leave it the way you have it. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</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: 10 </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: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: 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: Fri, 06 Aug 2021 19:40:29 +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"> Comment-In-Reply-To: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Comment-In-Reply-To: Sarah Autumn <sarah@endlesstemple.org> </div>
<div style="display:none"> Comment-In-Reply-To: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>