diff --git a/main/features.c b/main/features.c index 63bf1952ae..9884441923 100644 --- a/main/features.c +++ b/main/features.c @@ -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; }