]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #13139)
authorJeff Peeler <jpeeler@digium.com>
Thu, 9 Oct 2008 19:27:32 +0000 (19:27 +0000)
committerJeff Peeler <jpeeler@digium.com>
Thu, 9 Oct 2008 19:27:32 +0000 (19:27 +0000)
Reported by: krisk84
Tested by: krisk84

This change prevents a call that is placed in the parkinglot to be picked up before the PBX is finished. If another extension dials the parking extension before the PBX thread has completed at minimum warnings will occur about the PBX not properly being terminated. At worst, a crash could occur.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147952 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/features.c

index 63bf1952ae39656e82dc7f13488f7bb15e8d5be6..9884441923556288d110f0156dfa6a61293b3887 100644 (file)
@@ -2857,6 +2857,10 @@ static int park_exec_full(struct ast_channel *chan, void *data, struct ast_parki
        AST_LIST_LOCK(&parkinglot->parkings);
        AST_LIST_TRAVERSE_SAFE_BEGIN(&parkinglot->parkings, pu, list) {
                if (!data || pu->parkingnum == park) {
+                       if (pu->chan->pbx) { /* do not allow call to be picked up until the PBX thread is finished */
+                               AST_LIST_UNLOCK(&parkinglot->parkings);
+                               return -1;
+                       }
                        AST_LIST_REMOVE_CURRENT(list);
                        break;
                }