app_dial and app_queue: Make lock the forwarding channel while taking the channel...
[asterisk/asterisk.git] / apps / app_queue.c
index 4d97db4..f71ddba 100644 (file)
@@ -4671,16 +4671,11 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                                        numnochan++;
                                                }
                                        }
-                                       ast_channel_lock_both(qe->chan, o->chan);
+
                                        ast_channel_publish_dial(qe->chan, o->chan, stuff, NULL);
-                                       ast_channel_unlock(o->chan);
-                                       ast_channel_unlock(qe->chan);
-
-                                       ast_channel_lock_both(qe->chan, original);
-                                       ast_channel_publish_dial_forward(qe->chan, original, o->chan, NULL, "CANCEL",
-                                               ast_channel_call_forward(original));
-                                       ast_channel_unlock(original);
-                                       ast_channel_unlock(qe->chan);
+                                       ast_channel_publish_dial_forward(qe->chan, original, o->chan, NULL,
+                                               "CANCEL", ast_channel_call_forward(original));
+
                                        /* Hangup the original channel now, in case we needed it */
                                        ast_hangup(winner);
                                        continue;