app_dial and app_queue: Make lock the forwarding channel while taking the channel...
[asterisk/asterisk.git] / main / stasis_channels.c
index eefb7a9..3522fb2 100644 (file)
@@ -336,7 +336,9 @@ void ast_channel_publish_dial_forward(struct ast_channel *caller, struct ast_cha
        ast_multi_channel_blob_add_channel(payload, "peer", peer_snapshot);
 
        if (forwarded) {
+               ast_channel_lock(forwarded);
                forwarded_snapshot = ast_channel_snapshot_create(forwarded);
+               ast_channel_unlock(forwarded);
                if (!forwarded_snapshot) {
                        return;
                }