[asterisk-dev] (ASTERISK-19336) h exten is not run in the context that calls a AEL macro

Johan Wilfer lists at jttech.se
Tue Mar 6 16:23:51 CST 2012


2012-03-06 18:59, Tilghman Lesher skrev:
> On Fri, Mar 2, 2012 at 10:11 AM, Johan Wilfer <lists at jttech.se> wrote:
>> 2012-02-29 21:47, Tilghman Lesher skrev:
>>> On Wed, Feb 29, 2012 at 4:21 AM, Johan Wilfer <lists at jttech.se> wrote:
>>>> 2012-02-29 02:59, Tilghman Lesher skrev:
>>>>>> This change in >1.6 makes it hard to actually use macros for anything
>>>>>> complex as I have to duplicate hangup-code in every macro, and even
>>>>>> duplicate the same macro for different contexts calling the macro!
>>>>>>
>>>>>> To add to that, in 1.4 there was channel variables to know the context
>>>>>> invoking the macro. This is also less functionality in newer versions.
>>>>>>
>>>>> I have created a function called STACK_PEEK() which would provide the
>>>>> equivalent values.  It is on reviewboard here:
>>>>> https://reviewboard.asterisk.org/r/1776/
>>>> Wow! Thank you!
>>>> It looks very thought through.
>>>>
>>>> This is a tool to create very powerful ael dialplans.
>>>>
>>>>> (from [asterisk-dev] [Code Review] Create STACK_PEEK to view calling context, extension, and priority):
>>>>>
>>>>> Whether this goes into a version of Asterisk earlier than 11 is a case for the bug reporter to make.
>>>> I would really like to have this included in a release-branch so I can
>>>> upgrade from 1.4 to 1.8/10 without applying patches.
>>>> It's a matter of view if this lost functionality is a bug or a feature I
>>>> guess.
>>> That's definitely the issue:  is this a bug or a new feature?
>> I've spent some more time thinking about this. My opinion is that it's a
>> bug, and we should fix it in 1.8 and 10.
>> Can someone open ASTERISK-19336 so I can upload a patch for the ael
>> parser later?
> The code is now there on reviewboard, with the AEL code generation.  It was
> bugging me over the weekend, so I sat down at 3am and figured out how to
> generate the code.  While the STACK_PEEK function has been tested to
> verify functionality, and while the code generates as designed, I have not
> otherwise tested the bubble-up functionality, so this part of it does need to
> be tested before I can commit it.

Cool! Thank you!

I created a test dialplan and it works as expected in all cases but one.
If you call a macro within another macro and none of them has a catch h
it causes an infinite loop.
This is also true for any depth of macros called deeper than one that
lacks catch h.

For more details I've attached a textfile with the dialplan and the
results to the issue:
https://issues.asterisk.org/jira/browse/ASTERISK-19336
https://issues.asterisk.org/jira/secure/attachment/42919/testing-ASTERISK-19336_20120304__ael_bugfix_for_trunk__2.diff.txt

>> Or speak out if this is not a bug, so I can drop this...
> Bueller?  Bueller?  Bueller?  Bueller?
>
> -Tilghman


-- 
Johan Wilfer                 email: johan at jttech.se
JT Tech | Developer          webb: http://jttech.se




More information about the asterisk-dev mailing list