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:23 +0000
commit5a7af00e80b9f360a11fcbbc6c6b6dfd2ee478a6 (patch)
tree6f5b088ad13c1451d1e8421e57b9cd1a9a2d3434 /apps/app_disa.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_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 8dc61ff64..cceb5541d 100644
--- a/apps/app_disa.c
+++ b/apps/app_disa.c
@@ -208,7 +208,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 */
@@ -224,7 +224,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;
}
@@ -232,7 +232,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;
}
@@ -261,7 +261,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;
@@ -357,7 +357,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;