Merge changes from topic 'ASTERISK-27625'
[asterisk/asterisk.git] / main / channel.c
index c4b63c6..094658d 100644 (file)
@@ -5921,7 +5921,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;