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:
Mark Spencer
2004-03-04 01:11:25 +00:00
parent 534e78b372
commit 806bb3c63f
15 changed files with 152 additions and 48 deletions

View File

@@ -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;
}