]> 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:54:03 +0000 (10:54 -0500)
Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c

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

index 6870e676bae5ab1376fb3364291f57995bb9fee1..2f5daae76833104f5a5688226566dacf56a0d6b8 100644 (file)
@@ -10112,7 +10112,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;
@@ -10145,7 +10147,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 467d548e436da6fb08b3d73c6cd24524ac983a8e..ea0c31d8024d0ce4d6d551a25360d14ba1109c3d 100644 (file)
@@ -2403,7 +2403,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;
@@ -2438,7 +2440,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 a5cc4e7e9fcedcdeca55ea07a998bd765e14f61b..c9a655294d2aae7343e931f5272fb62ef761a1d8 100644 (file)
@@ -6032,7 +6032,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;