From: Peter Schlaile Date: Sat, 23 Aug 2008 07:56:19 +0000 (+0200) Subject: chan_lcr: fixed lcr_fixup (compare with chan_misdn for reference) X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=e49617548291b390ecaf60ad1f570dde6ee844ba chan_lcr: fixed lcr_fixup (compare with chan_misdn for reference) - oldast is totally unimportant - we didn't unlock correctly => works now :) Test case: open two lcr channels using a sip phone. Do a transfer between them. --- diff --git a/chan_lcr.c b/chan_lcr.c index 906e6a3..4ab8591 100644 --- a/chan_lcr.c +++ b/chan_lcr.c @@ -2096,21 +2096,25 @@ static int lcr_indicate(struct ast_channel *ast, int cond, const void *data, siz /* * fixup asterisk */ -static int lcr_fixup(struct ast_channel *oldast, struct ast_channel *newast) +static int lcr_fixup(struct ast_channel *oldast, struct ast_channel *ast) { struct chan_call *call; + if (!ast) { + return -1; + } + ast_mutex_lock(&chan_lock); - call = oldast->tech_pvt; + call = ast->tech_pvt; if (!call) { - CERROR(NULL, oldast, "Received fixup from Asterisk, but no call instance exists.\n"); + CERROR(NULL, ast, "Received fixup from Asterisk, but no call instance exists.\n"); ast_mutex_unlock(&chan_lock); return -1; } - CDEBUG(call, oldast, "Received fixup from Asterisk.\n"); - call->ast = newast; - ast_mutex_lock(&chan_lock); + CDEBUG(call, ast, "Received fixup from Asterisk.\n"); + call->ast = ast; + ast_mutex_unlock(&chan_lock); return 0; }