Skip to content
Snippets Groups Projects
Commit 2e5537a4 authored by Mark Spencer's avatar Mark Spencer
Browse files

Fix directed pickup deadlock bug (bug #5270)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent a21c9058
Branches devel
Tags 0.4.11
No related merge requests found
...@@ -51,7 +51,7 @@ LOCAL_USER_DECL; ...@@ -51,7 +51,7 @@ LOCAL_USER_DECL;
static int pickup_exec(struct ast_channel *chan, void *data) static int pickup_exec(struct ast_channel *chan, void *data)
{ {
int res = -1; int res = 0;
struct localuser *u = NULL; struct localuser *u = NULL;
struct ast_channel *origin = NULL, *target = NULL; struct ast_channel *origin = NULL, *target = NULL;
char *tmp = NULL, *exten = NULL, *context = NULL; char *tmp = NULL, *exten = NULL, *context = NULL;
...@@ -100,6 +100,7 @@ static int pickup_exec(struct ast_channel *chan, void *data) ...@@ -100,6 +100,7 @@ static int pickup_exec(struct ast_channel *chan, void *data)
if (res) { if (res) {
ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name); ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name);
res = -1; res = -1;
ast_mutex_unlock(&target->lock);
goto out; goto out;
} }
res = ast_queue_control(chan, AST_CONTROL_ANSWER); res = ast_queue_control(chan, AST_CONTROL_ANSWER);
...@@ -107,12 +108,14 @@ static int pickup_exec(struct ast_channel *chan, void *data) ...@@ -107,12 +108,14 @@ static int pickup_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Unable to queue answer on '%s'\n", ast_log(LOG_WARNING, "Unable to queue answer on '%s'\n",
chan->name); chan->name);
res = -1; res = -1;
ast_mutex_unlock(&target->lock);
goto out; goto out;
} }
res = ast_channel_masquerade(target, chan); res = ast_channel_masquerade(target, chan);
if (res) { if (res) {
ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, target->name); ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, target->name);
res = -1; res = -1;
ast_mutex_unlock(&target->lock);
goto out; goto out;
} }
/* Done */ /* Done */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment