aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-11 21:08:26 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-11 21:08:26 +0000
commit585bed62995f7fd660f3299104f0359a9636005f (patch)
tree5106cb14affc61f251fe137ddd96b9702cbf19d2 /apps
parent31fbdff1d7b5ada9720a7aa7bac808799532ede6 (diff)
Fix directed pickup to a call that is up (bug #5425 with mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6743 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_directed_pickup.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c
index e9282d262..df766366d 100755
--- a/apps/app_directed_pickup.c
+++ b/apps/app_directed_pickup.c
@@ -100,7 +100,6 @@ static int pickup_exec(struct ast_channel *chan, void *data)
if (res) {
ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name);
res = -1;
- ast_mutex_unlock(&target->lock);
goto out;
}
res = ast_queue_control(chan, AST_CONTROL_ANSWER);
@@ -108,24 +107,21 @@ static int pickup_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Unable to queue answer on '%s'\n",
chan->name);
res = -1;
- ast_mutex_unlock(&target->lock);
goto out;
}
res = ast_channel_masquerade(target, chan);
if (res) {
ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, target->name);
res = -1;
- ast_mutex_unlock(&target->lock);
goto out;
}
- /* Done */
- ast_mutex_unlock(&target->lock);
} else {
ast_log(LOG_DEBUG, "No call pickup possible...\n");
res = -1;
}
-
+ /* Done */
out:
+ if (target) ast_mutex_unlock(&target->lock);
LOCAL_USER_REMOVE(u);
return res;