[asterisk-bugs] [JIRA] (ASTERISK-21390) New applications for app_stack.c: GosubEntry and StackPopGoto

Tilghman Lesher (JIRA) noreply at issues.asterisk.org
Thu Jul 25 16:19:05 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=208236#comment-208236 ] 

Tilghman Lesher edited comment on ASTERISK-21390 at 7/25/13 4:18 PM:
---------------------------------------------------------------------

It certainly could "remove" the arguments -- just set them to blank (_not_ NULL) after you set the new name.

Since you're using this for routing, I'd actually suggest that your Return($\{newcontext},$\{newextension},$\{newpriority}) and then Goto($\{RETVAL}) as your next priority.  The purpose of StackPop is exception handling, not routine abuse of the stack functionality.
                
      was (Author: tilghman):
    It certainly could "remove" the arguments -- just set them to blank (_not_ NULL) after you set the new name.

Since you're using this for routing, I'd actually suggest that your Return($\{newcontext},${newextension},${newpriority}) and then Goto(${RETVAL}) as your next priority.  The purpose of StackPop is exception handling, not routine abuse of the stack functionality.
                  
> New applications for app_stack.c: GosubEntry and StackPopGoto
> -------------------------------------------------------------
>
>                 Key: ASTERISK-21390
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21390
>             Project: Asterisk
>          Issue Type: New Feature
>      Security Level: None
>          Components: Applications/app_stack
>    Affects Versions: SVN
>            Reporter: Corey Farrell
>            Severity: Minor
>         Attachments: app_stack-new_apps.patch
>
>
> I've created two applications for use with Gosub scripts.
> GosubEntry
> Accepts a list of variable names to be initialized as local variable with values of ${ARGn}
> This application is mainly to reduce the verbosity of Gosub's created by a GUI.  Instead of setting local variables for each argument separately it allows all to be set by a single priority.
> {code}
> exten => s,1,Set(LOCAL(NUMBER)=${ARG1})
> same => n,Set(LOCAL(STATUS)=${ARG2})
> same => n,Set(LOCAL(RESULTS)=${ARG3})
> ; Can be rewritten:
> exten => s,1,GosubEntry(NUMBER,STATUS,RESULTS)
> {code}
> Verbose >= 6 can be used to have GosubEntry produce output for each variable set.
> StackPopGoto - runs StackPop followed by Goto.  The combined command is needed for leak-free Gosub's where the final Goto destination is in a local variable.
> I feel that the code for these are ready, the xmldocs need help.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list