Index: include/asterisk/channel.h =================================================================== --- include/asterisk/channel.h (revision 234094) +++ include/asterisk/channel.h (working copy) @@ -517,6 +517,10 @@ AST_FLAG_BRIDGE_HANGUP_DONT = (1 << 17), /*! This flag indicates whether the channel is in the channel list or not. */ AST_FLAG_IN_CHANNEL_LIST = (1 << 19), + /*! Disable certain workarounds. This reintroduces certain bugs, but allows + * some non-traditional dialplans (like AGI) to continue to function. + */ + AST_FLAG_DISABLE_WORKAROUNDS = (1 << 20), }; /*! \brief ast_bridge_config flags */ Index: main/pbx.c =================================================================== --- main/pbx.c (revision 235421) +++ main/pbx.c (working copy) @@ -5776,7 +5776,8 @@ * gone immediately to the "i" extension, but will now need to wait for a * timeout. */ - if ((exten[0] = res) && + if (!ast_test_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS) && + (exten[0] = res) && ast_canmatch_extension(chan, args.context, exten, 1, chan->cid.cid_num) && !ast_matchmore_extension(chan, args.context, exten, 1, chan->cid.cid_num)) { snprintf(chan->exten, sizeof(chan->exten), "%c", res); Index: res/res_agi.c =================================================================== --- res/res_agi.c (revision 235052) +++ res/res_agi.c (working copy) @@ -1125,7 +1125,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv) { - int res; + int res, workaround; struct ast_app *app; if (argc < 2) @@ -1140,7 +1140,13 @@ if(!strcasecmp(argv[1], PARK_APP_NAME)) { ast_masq_park_call(chan, NULL, 0, NULL); } + if (!(workaround = ast_test_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS))) { + ast_set_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS); + } res = pbx_exec(chan, app, argv[2]); + if (!workaround) { + ast_clear_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS); + } } else { ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]); res = -2;