]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
channel: Fix some more unprotected channel flag setting.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 12 Jun 2018 20:13:14 +0000 (15:13 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 18 Jun 2018 15:55:47 +0000 (09:55 -0600)
Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c

channels/chan_dahdi.c
channels/sig_analog.c
main/channel.c

index 36f5deb9b89d4e9e2295709a2e941ceb226ee531..77c69061126f35e902eb86b30764ec00c43215e2 100644 (file)
@@ -10035,7 +10035,9 @@ static void *analog_ss_thread(void *data)
                                 * 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;
@@ -10068,7 +10070,9 @@ static void *analog_ss_thread(void *data)
                                                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. */
index 110942cba00682a6f1b1851efc33e3f6cadd26a1..7f78daa7786d5ed2b69ad6d2997c786605b51b9c 100644 (file)
@@ -2402,7 +2402,9 @@ static void *__analog_ss_thread(void *data)
                                 * 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;
@@ -2437,7 +2439,9 @@ static void *__analog_ss_thread(void *data)
                                                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);
index 92ec444d41f6306b13eb39f69a6616ae0e0ec63c..f056435334a495e3d8febff3464fcf4d27f70d60 100644 (file)
@@ -5922,7 +5922,9 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c
         */
        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;