summaryrefslogtreecommitdiffstats
path: root/chan_lcr.c
diff options
context:
space:
mode:
authorPeter Schlaile2008-08-23 09:56:19 +0200
committerroot2008-08-23 09:56:19 +0200
commite49617548291b390ecaf60ad1f570dde6ee844ba (patch)
tree4850f503a6f5293cdf09f0563b3642f096b933da /chan_lcr.c
parentchan_lcr: fixed typo, that made rebuffer-mode request a parameter, (diff)
downloadlcr-e49617548291b390ecaf60ad1f570dde6ee844ba.tar.gz
lcr-e49617548291b390ecaf60ad1f570dde6ee844ba.tar.xz
lcr-e49617548291b390ecaf60ad1f570dde6ee844ba.zip
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.
Diffstat (limited to 'chan_lcr.c')
-rw-r--r--chan_lcr.c16
1 files changed, 10 insertions, 6 deletions
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;
}