summaryrefslogtreecommitdiff
path: root/apps/app_disa.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:01 +0000
commit161820396495a549c9a378d32136cbb5f28ef2af (patch)
treed6df892de3055d9765d58d5592ec33b6e4676d20 /apps/app_disa.c
parent6383d9214aaba9a7ace1753ff0f6dfe1f2c6c5fa (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_disa.c')
-rw-r--r--apps/app_disa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/app_disa.c b/apps/app_disa.c
index 824e8fe55..dbdad94be 100644
--- a/apps/app_disa.c
+++ b/apps/app_disa.c
@@ -210,7 +210,7 @@ static int disa_exec(struct ast_channel *chan, const char *data)
play_dialtone(chan, args.mailbox);
- ast_set_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_set_flag(chan, AST_FLAG_END_DTMF_ONLY);
for (;;) {
/* if outa time, give em reorder */
@@ -226,7 +226,7 @@ static int disa_exec(struct ast_channel *chan, const char *data)
}
if (!(f = ast_read(chan))) {
- ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
return -1;
}
@@ -234,7 +234,7 @@ static int disa_exec(struct ast_channel *chan, const char *data)
if (f->data.uint32)
ast_channel_hangupcause_set(chan, f->data.uint32);
ast_frfree(f);
- ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
return -1;
}
@@ -263,7 +263,7 @@ static int disa_exec(struct ast_channel *chan, const char *data)
fp = fopen(args.passcode,"r");
if (!fp) {
ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,ast_channel_name(chan));
- ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
return -1;
}
pwline[0] = 0;
@@ -359,7 +359,7 @@ static int disa_exec(struct ast_channel *chan, const char *data)
}
}
- ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
if (k == 3) {
int recheck = 0;