diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-05-26 09:25:51 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-05-26 09:25:51 -0500 |
commit | 56b6a71548c1c0ca8f187f245ccb0c41c8569457 (patch) | |
tree | 7e899e935eb3a64f3510eeb4715cf946c1797062 /res/res_agi.c | |
parent | 6bb3cedb1ba1e2c3aed977f2af6a345c45c8865e (diff) | |
parent | 5a7af00e80b9f360a11fcbbc6c6b6dfd2ee478a6 (diff) |
Merge "asterisk: Audit locking of channel when manipulating flags."
Diffstat (limited to 'res/res_agi.c')
-rw-r--r-- | res/res_agi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index f5dee00d9..e8497f7ca 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -3142,12 +3142,14 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, const char ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argc >= 3 ? argv[2] : ""); if ((app_to_exec = pbx_findapp(argv[1]))) { + ast_channel_lock(chan); if (!(workaround = ast_test_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_WORKAROUNDS))) { ast_set_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_WORKAROUNDS); } + ast_channel_unlock(chan); res = pbx_exec(chan, app_to_exec, argc == 2 ? "" : argv[2]); if (!workaround) { - ast_clear_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_WORKAROUNDS); + ast_channel_clear_flag(chan, AST_FLAG_DISABLE_WORKAROUNDS); } } else { ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]); |