]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #13139)
authorJeff Peeler <jpeeler@digium.com>
Thu, 9 Oct 2008 18:56:00 +0000 (18:56 +0000)
committerJeff Peeler <jpeeler@digium.com>
Thu, 9 Oct 2008 18:56:00 +0000 (18:56 +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/branches/1.4@147941 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_features.c

index 491ee40267f518c26148f2d2e0be7caacd4f0a10..6b5bc6b18f02a5dc367b3c20407131c5194e98e9 100644 (file)
@@ -2104,6 +2104,11 @@ static int park_exec(struct ast_channel *chan, void *data)
        pu = parkinglot;
        while(pu) {
                if (pu->parkingnum == park) {
+                       if (pu->chan->pbx) { /* do not allow call to be picked up until the PBX thread is finished */
+                               ast_mutex_unlock(&parking_lock);
+                               ast_module_user_remove(u);
+                               return -1;
+                       }
                        if (pl)
                                pl->next = pu->next;
                        else