aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_parking.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-20 16:30:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-20 16:30:10 +0000
commitec76498f552e4ff10adcaa0ffc27d1c21cb5792e (patch)
treeefbb775d4f7e80cb61b314075217774d082e881a /res/res_parking.c
parent7e42c962d89de0673789eed30649fc7ae276aa50 (diff)
Make ast_channel_walk become ast_channel_walk_locked
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3029 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_parking.c')
-rwxr-xr-xres/res_parking.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_parking.c b/res/res_parking.c
index 29b63684c..e63f490cb 100755
--- a/res/res_parking.c
+++ b/res/res_parking.c
@@ -737,7 +737,7 @@ int ast_pickup_call(struct ast_channel *chan)
{
struct ast_channel *cur;
int res = -1;
- cur = ast_channel_walk(NULL);
+ cur = ast_channel_walk_locked(NULL);
while(cur) {
if (!cur->pbx &&
(cur != chan) &&
@@ -746,7 +746,8 @@ int ast_pickup_call(struct ast_channel *chan)
(cur->_state == AST_STATE_RING))) {
break;
}
- cur = ast_channel_walk(cur);
+ ast_mutex_unlock(&cur->lock);
+ cur = ast_channel_walk_locked(cur);
}
if (cur) {
ast_log(LOG_DEBUG, "Call pickup on chan '%s' by '%s'\n",cur->name, chan->name);
@@ -759,6 +760,7 @@ int ast_pickup_call(struct ast_channel *chan)
res = ast_channel_masquerade(cur, chan);
if (res)
ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, cur->name); /* Done */
+ ast_mutex_unlock(&cur->lock);
} else {
ast_log(LOG_DEBUG, "No call pickup possible...\n");
}