mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4.
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
This commit is contained in:
@@ -668,6 +668,36 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_
|
||||
localized_merge_contexts_and_delete(extcontexts, exttable, registrar);
|
||||
}
|
||||
|
||||
const char *ast_get_context_name(struct ast_context *con);
|
||||
const char *ast_get_context_name(struct ast_context *con)
|
||||
{
|
||||
return con ? con->name : NULL;
|
||||
}
|
||||
|
||||
struct ast_exten *ast_walk_context_extensions(struct ast_context *con, struct ast_exten *exten);
|
||||
struct ast_exten *ast_walk_context_extensions(struct ast_context *con, struct ast_exten *exten)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct ast_include *ast_walk_context_includes(struct ast_context *con, struct ast_include *inc);
|
||||
struct ast_include *ast_walk_context_includes(struct ast_context *con, struct ast_include *inc)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct ast_ignorepat *ast_walk_context_ignorepats(struct ast_context *con, struct ast_ignorepat *ip);
|
||||
struct ast_ignorepat *ast_walk_context_ignorepats(struct ast_context *con, struct ast_ignorepat *ip)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct ast_sw *ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw);
|
||||
struct ast_sw *ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct ast_exten *pbx_find_extension(struct ast_channel *chan,
|
||||
struct ast_context *bypass,
|
||||
struct pbx_find_info *q,
|
||||
|
Reference in New Issue
Block a user