mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Add support for parking with IAX2
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user