[Asterisk-code-review] channel: Fix some more unprotected channel flag setting. (asterisk[13])
Richard Mudgett
asteriskteam at digium.com
Mon Jun 18 10:55:24 CDT 2018
Richard Mudgett has uploaded this change for review. ( https://gerrit.asterisk.org/9192
Change subject: channel: Fix some more unprotected channel flag setting.
......................................................................
channel: Fix some more unprotected channel flag setting.
Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c
---
M channels/chan_dahdi.c
M channels/sig_analog.c
M main/channel.c
3 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/92/9192/1
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 6870e67..2f5daae 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -10112,7 +10112,9 @@
* emulation. The DTMF digits can come so fast that emulation
* can drop some of them.
*/
+ ast_channel_lock(chan);
ast_set_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_unlock(chan);
off_ms = 4000;/* This is a typical OFF time between rings. */
for (;;) {
struct ast_frame *f;
@@ -10145,7 +10147,9 @@
ast_channel_state(chan) == AST_STATE_RINGING)
break; /* Got ring */
}
+ ast_channel_lock(chan);
ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_unlock(chan);
dtmfbuf[k] = '\0';
dahdi_setlinear(p->subs[idx].dfd, p->subs[idx].linear);
/* Got cid and ring. */
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 467d548..ea0c31d 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -2403,7 +2403,9 @@
* emulation. The DTMF digits can come so fast that emulation
* can drop some of them.
*/
+ ast_channel_lock(chan);
ast_set_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_unlock(chan);
timeout_ms = 4000;/* This is a typical OFF time between rings. */
for (;;) {
struct ast_frame *f;
@@ -2438,7 +2440,9 @@
break; /* Got ring */
}
}
+ ast_channel_lock(chan);
ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
+ ast_channel_unlock(chan);
dtmfbuf[k] = '\0';
analog_set_linear_mode(p, idx, oldlinearity);
diff --git a/main/channel.c b/main/channel.c
index a5cc4e7..c9a6552 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -6032,7 +6032,9 @@
*/
ast_set_callerid(chan, cid_num, cid_name, cid_num);
+ ast_channel_lock(chan);
ast_set_flag(ast_channel_flags(chan), AST_FLAG_ORIGINATED);
+ ast_channel_unlock(chan);
ast_party_connected_line_set_init(&connected, ast_channel_connected(chan));
if (cid_num) {
connected.id.number.valid = 1;
--
To view, visit https://gerrit.asterisk.org/9192
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c
Gerrit-Change-Number: 9192
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180618/55a17114/attachment-0001.html>
More information about the asterisk-code-review
mailing list