<div><div><font face="courier new, monospace">Hi!,</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">I would like to know how to proceed on this in order to generarte a proper patch.</font></div>

<div><font face="courier new, monospace"><br></font></div><div><span style="font-family:&#39;courier new&#39;,monospace">While testing trunk, found </span><span style="font-family:&#39;courier new&#39;,monospace">that the new way that pbx/pbx_config.c uses the new </span><span style="font-family:&#39;courier new&#39;,monospace">Asterisk 11 &#39;missing context </span><span style="font-family:&#39;courier new&#39;,monospace">feature&#39; from apps/app_stack.c behaves in a mode that </span><span style="font-family:&#39;courier new&#39;,monospace">you can only create a </span><span style="font-family:&#39;courier new&#39;,monospace">stdexten context in extensions.conf </span><span style="font-family:&#39;courier new&#39;,monospace">syntax and not </span><span style="font-family:&#39;courier new&#39;,monospace">in AEL2 </span><span style="font-family:&#39;courier new&#39;,monospace">or LUA being both not able to arbitrarily set priorities.</span></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">This is because pbx_config.c when using users.conf and hasvoicemail, instead of create </font><span style="font-family:&#39;courier new&#39;,monospace">an extension </span><font face="courier new, monospace">with all the proper a</font><span style="font-family:&#39;courier new&#39;,monospace">nd old fashion Gosub set of options context,extension,priority(args), it uses </span><span style="font-family:&#39;courier new&#39;,monospace">the shorter priority(args)</span><span style="font-family:&#39;courier new&#39;,monospace"> syntax </span><span style="font-family:&#39;courier new&#39;,monospace">which</span><span style="font-family:&#39;courier new&#39;,monospace"> leads you to necessarily add an </span><span style="font-family:&#39;courier new&#39;,monospace">include =&gt; stdexten to whatever it is &#39;usercontext&#39;, following the missing </span><span style="font-family:&#39;courier new&#39;,monospace">context feature in app_stack.cs that asumes that</span></div>

<div><span style="font-family:&#39;courier new&#39;,monospace"><br></span></div><div><span style="font-family:&#39;courier new&#39;,monospace">context=ast_channel_context(chan).</span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><br>

</span></div><div><font face="courier new, monospace">Therefore the new [stdexten] examples in extensions.conf adds a (stdexten) label inside [stdexten] context but also sets the priority to some high and arbitrary number, 50000 for [stdexten] and 60000 for [stdPrivacyexten]in order to isolate the merge between [default] (or &#39;usercontext&#39;) and the included stdexten. </font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">If you rewrite stdexten in LUA or AEL2, whenever you use a Return(), it will reach the 2nd priority of the LUA/AEL2 stdexten which is not desired (endless loop or at least until the stack empties).</font></div>

<div><br></div><div><font face="courier new, monospace">To workaround this, you must have to write stdexten in extensions.conf syntax </font><span style="font-family:&#39;courier new&#39;,monospace">starting with a priority non reachable  by the Gosub()/Return() stack (as the extensions.conf.sample does) assuming t</span><span style="font-family:&#39;courier new&#39;,monospace">hat the only way that it can be called using users.conf / pbx_config.c is doing </span><span style="font-family:&#39;courier new&#39;,monospace">an include to the stdexten context in the &#39;usercontext&#39;.</span></div>

</div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">I think a best approach would be to return to the old behavior when pbx_config.c generated the full set of options to GoSub </font><span style="font-family:&#39;courier new&#39;,monospace">context,extension,priority(args) (stdexten,${EXTEN},1(${HINT}) based on the idea that is desirable to be able to write stdexten in any of the provided languages to code dialplans in Asterisk.</span></div>

<div><br></div><div><span style="font-family:&#39;courier new&#39;,monospace">Any opinion? </span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><br></span></div><div><span style="font-family:&#39;courier new&#39;,monospace">Best.</span></div>