diff options
author | Mark Spencer <markster@digium.com> | 2004-03-04 01:11:25 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-03-04 01:11:25 +0000 |
commit | 806bb3c63f5c3cf8c06692051463120a8321767e (patch) | |
tree | 654f352211e2d0a687b2a6fe94df5f54c3b33d14 /channels/chan_zap.c | |
parent | 534e78b37206b8b61ac8a0af4bc1cd7cc75fcd2b (diff) |
Add support for parking with IAX2
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-x | channels/chan_zap.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 8b93e744a..1ce3a6a92 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -2537,11 +2537,12 @@ static int zt_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, static int zt_indicate(struct ast_channel *chan, int condition); -static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) +static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock) { struct zt_pvt *p = newchan->pvt->pvt; int x; - ast_mutex_lock(&p->lock); + if (needlock) + ast_mutex_lock(&p->lock); ast_log(LOG_DEBUG, "New owner for channel %d is %s\n", p->channel, newchan->name); if (p->owner == oldchan) p->owner = newchan; @@ -2554,7 +2555,8 @@ static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) if (newchan->_state == AST_STATE_RINGING) zt_indicate(newchan, AST_CONTROL_RINGING); update_conf(p); - ast_mutex_unlock(&p->lock); + if (needlock) + ast_mutex_unlock(&p->lock); return 0; } |