Skip to content
Snippets Groups Projects
  • Tilghman Lesher's avatar
    9af5c769
    Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4. · 9af5c769
    Tilghman Lesher authored
    This change restores functionality that was present in 1.4, when AEL macros
    were implemented with the Macro dialplan application.  Macros are fraught with
    functionality issues, because they consume a large portion of the underlying
    application stack.  This limits the ability of AEL users to call many layers
    of subroutines, an issue which Gosub does not have (originally tested to
    100,000 levels deep).  Therefore, starting in 1.6.0, AEL macros were
    implemented with Gosub.
    
    However, there were some implicit behaviors of Macro, which were not replicated
    at the same time as with the transition to Gosub, one of which is documented in
    the related issue.  In particular, the "h" extension is designed to execute not
    in the Macro context, but in the topmost calling context.  Due to legacy issues
    with a misapplied bugfix many years ago, when a macro exited in 1.4, it looks
    in all calling contexts, bubbling up from the deepest level until it finds an
    "h" extension.
    
    Since AEL hides the complexity of the underlying dialplan logic from the AEL
    programmer, it's reasonable to assume that this behavior should not change in
    the transition from Asterisk 1.4 LTS to Asterisk 1.8 LTS, lest we break
    working AEL configurations in the transition to Asterisk 1.8 LTS.  This fix
    is the result, which implements a search for the "h" extension in all calling
    Gosub contexts.
    
    Fixes ASTERISK-19336
    
    Patch: 20120308__ael_bugfix_for_trunk__2.diff (License #5003) by Tilghman Lesher
    	(with slight modifications for 1.8)
    
    Tested by: Johan Wilfer
    
    Review: https://reviewboard.asterisk.org/r/1776/
    ........
    
    Merged revisions 358810 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 358811 from http://svn.asterisk.org/svn/asterisk/branches/10
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
    9af5c769
    History
    Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4.
    Tilghman Lesher authored
    This change restores functionality that was present in 1.4, when AEL macros
    were implemented with the Macro dialplan application.  Macros are fraught with
    functionality issues, because they consume a large portion of the underlying
    application stack.  This limits the ability of AEL users to call many layers
    of subroutines, an issue which Gosub does not have (originally tested to
    100,000 levels deep).  Therefore, starting in 1.6.0, AEL macros were
    implemented with Gosub.
    
    However, there were some implicit behaviors of Macro, which were not replicated
    at the same time as with the transition to Gosub, one of which is documented in
    the related issue.  In particular, the "h" extension is designed to execute not
    in the Macro context, but in the topmost calling context.  Due to legacy issues
    with a misapplied bugfix many years ago, when a macro exited in 1.4, it looks
    in all calling contexts, bubbling up from the deepest level until it finds an
    "h" extension.
    
    Since AEL hides the complexity of the underlying dialplan logic from the AEL
    programmer, it's reasonable to assume that this behavior should not change in
    the transition from Asterisk 1.4 LTS to Asterisk 1.8 LTS, lest we break
    working AEL configurations in the transition to Asterisk 1.8 LTS.  This fix
    is the result, which implements a search for the "h" extension in all calling
    Gosub contexts.
    
    Fixes ASTERISK-19336
    
    Patch: 20120308__ael_bugfix_for_trunk__2.diff (License #5003) by Tilghman Lesher
    	(with slight modifications for 1.8)
    
    Tested by: Johan Wilfer
    
    Review: https://reviewboard.asterisk.org/r/1776/
    ........
    
    Merged revisions 358810 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 358811 from http://svn.asterisk.org/svn/asterisk/branches/10
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358812 65c4cc65-6c06-0410-ace0-fbb531ad65f3