From 33f70e63bcb4ed658d97541552c83267a7f7d7e7 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 6 Feb 2008 18:10:27 +0000 Subject: [PATCH] try to release the call refs. git-svn-id: http://svn.openzap.org/svn/openzap/trunk@389 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/isdn/Q931StateTE.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libs/openzap/src/isdn/Q931StateTE.c b/libs/openzap/src/isdn/Q931StateTE.c index a45aa06472..3cd45dab33 100644 --- a/libs/openzap/src/isdn/Q931StateTE.c +++ b/libs/openzap/src/isdn/Q931StateTE.c @@ -782,14 +782,24 @@ L3INT Q931ProcReleaseTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom) *****************************************************************************/ L3INT Q931ProcReleaseCompleteTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom) { - Q931mes_Generic *pMes = (Q931mes_Generic *)&buf[Q931L4HeaderSpace]; - //L3INT state = Q931GetCallState(pTrunk, pMes->CRV); - L3INT ret = Q931E_NO_ERROR; + L3INT callIndex; + L3INT ret=Q931E_NO_ERROR; + Q931mes_Generic *pMes = (Q931mes_Generic *)&buf[Q931L4HeaderSpace]; + if(iFrom == 2) { /* TODO Add proc here*/ ret = Q931Tx34(pTrunk,buf,pMes->Size); } + + if (pMes->CRV) { + /* Find the call using CRV */ + ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex); + if(ret != Q931E_NO_ERROR) + return ret; + pTrunk->call[callIndex].InUse = 0; + } + return ret; }