summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-05-13 16:40:00 +0000
committerJoshua Colp <jcolp@digium.com>2017-05-16 14:25:23 +0000
commit5a7af00e80b9f360a11fcbbc6c6b6dfd2ee478a6 (patch)
tree6f5b088ad13c1451d1e8421e57b9cd1a9a2d3434 /apps/app_dial.c
parentce4d8dac91631599452a9c7aa9c81001704afb62 (diff)
asterisk: Audit locking of channel when manipulating flags.
When manipulating flags on a channel the channel has to be locked to guarantee that nothing else is also manipulating the flags. This change introduces locking where necessary to guarantee this. It also adds helper functions that manipulate channel flags and lock to reduce repeated code. ASTERISK-26789 Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 79e2a9b0b..847a095f4 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -2855,7 +2855,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
ast_log(LOG_ERROR, "error streaming file '%s' to callee\n", opt_args[OPT_ARG_ANNOUNCE]);
}
- ast_set_flag(ast_channel_flags(peer), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_set_flag(peer, AST_FLAG_END_DTMF_ONLY);
while (ast_channel_stream(peer)) {
int ms;
@@ -2919,13 +2919,13 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
}
ast_sched_runq(ast_channel_sched(peer));
}
- ast_clear_flag(ast_channel_flags(peer), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_clear_flag(peer, AST_FLAG_END_DTMF_ONLY);
}
if (chan && peer && ast_test_flag64(&opts, OPT_GOTO) && !ast_strlen_zero(opt_args[OPT_ARG_GOTO])) {
/* chan and peer are going into the PBX; as such neither are considered
* outgoing channels any longer */
- ast_clear_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING);
+ ast_channel_clear_flag(chan, AST_FLAG_OUTGOING);
ast_replace_subargument_delimiter(opt_args[OPT_ARG_GOTO]);
ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);