mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
Fix directed pickup to a call that is up (bug #5425 with mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -100,7 +100,6 @@ 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);
|
||||||
@@ -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",
|
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 */
|
|
||||||
ast_mutex_unlock(&target->lock);
|
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_DEBUG, "No call pickup possible...\n");
|
ast_log(LOG_DEBUG, "No call pickup possible...\n");
|
||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
|
/* Done */
|
||||||
out:
|
out:
|
||||||
|
if (target) ast_mutex_unlock(&target->lock);
|
||||||
LOCAL_USER_REMOVE(u);
|
LOCAL_USER_REMOVE(u);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
Reference in New Issue
Block a user