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_sip.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_sip.c')
-rwxr-xr-x | channels/chan_sip.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 275caa703..49e0bef36 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1364,17 +1364,20 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame) return res; } -static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) +static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock) { struct sip_pvt *p = newchan->pvt->pvt; - ast_mutex_lock(&p->lock); + if (needlock) + ast_mutex_lock(&p->lock); if (p->owner != oldchan) { ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner); - ast_mutex_unlock(&p->lock); + if (needlock) + ast_mutex_unlock(&p->lock); return -1; } p->owner = newchan; - ast_mutex_unlock(&p->lock); + if (needlock) + ast_mutex_unlock(&p->lock); return 0; } |