[asterisk-dev] [Code Review] 2689: Add two new stack related applications - GosubEntry and StackPopGoto

Tilghman Lesher reviewboard at asterisk.org
Mon Jul 22 09:57:51 CDT 2013



> On July 22, 2013, 6:29 a.m., Tilghman Lesher wrote:
> > /trunk/apps/app_stack.c, lines 158-175
> > <https://reviewboard.asterisk.org/r/2689/diff/1/?file=42376#file42376line158>
> >
> >     While I understand this as a possible exercise for the author to understand the API, combining two applications does not sound like a good precedent we want to set.
> >     
> >     We could also write PlaybackGoto, PlaybackHangup, PlaybackGosub, and various other combinations of two applications, when it would clearly be better simply to invoke those applications separately.
> 
> jrose wrote:
>     My impression based on the description is that combining the two applications in this way has a little added benefit.
>     
>     > This allows the Goto destination to be loaded from a LOCAL variable that is being discarded.
>     
>     So this is apparently to close out a stack operation while setting the return destination while still being able to use local variables that will fall out of stack. I mean, it's not like you couldn't just store those variables in a non-local manner after returning, but this still makes more sense than any of the proposed Playback operations you mentioned because those aren't going to affect the scope.

That should be the step that should be taken, then.  I completely understand the use of this at a higher level (that is, in AEL), but that doesn't mean that we should support it as a basic operation.

In fact, both of these applications look like AEL abstractions, that don't need support in the dialplan.  The intended use of the Stack applications isn't to do anything you might want to do, but rather to allow anything you might want to do, by implementing the basic operations that can be combined as needed.


- Tilghman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2689/#review9191
-----------------------------------------------------------


On July 22, 2013, 2:41 a.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2689/
> -----------------------------------------------------------
> 
> (Updated July 22, 2013, 2:41 a.m.)
> 
> 
> Review request for Asterisk Developers and Corey Farrell.
> 
> 
> Bugs: ASTERISK-21390
>     https://issues.asterisk.org/jira/browse/ASTERISK-21390
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This adds to new stack-related applications to Asterisk - GosubEntry and StackPopGoto.
> 
> GosubEntry allows the dialplan to modify the LOCAL variable values while in a Gosub stack frame.
> 
> StackPopGoto lets you pop off the next stack frame and immediately goto that location. Using the GosubEntry application, you can modify a LOCAL channel variable on the current stack frame and use it as input to this application.
> 
> {note}
> This patch was written by Corey Farrell - see ASTERISK-21390. I tweaked it slightly for coding guidelines and formatting.
> {note}
> 
> 
> Diffs
> -----
> 
>   /trunk/CHANGES 394981 
>   /trunk/apps/app_stack.c 394981 
> 
> Diff: https://reviewboard.asterisk.org/r/2689/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matt Jordan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130722/c45b47cb/attachment-0001.htm>


More information about the asterisk-dev mailing list