Add beginning of auto-restart functionality

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@179 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Michael Jerris 2007-05-29 16:30:20 +00:00
parent ecfacdef7e
commit 577ffc85b5
4 changed files with 27 additions and 10 deletions

View File

@ -813,6 +813,9 @@ L3INT Q931ProcRestartTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
} }
else if (iFrom ==2) else if (iFrom ==2)
{ {
if (pTrunk->autoRestartAck) {
Q931AckRestart(pTrunk, buf);
}
/* TODO Add proc here*/ /* TODO Add proc here*/
ret = Q931Tx34(pTrunk,buf,pMes->Size); ret = Q931Tx34(pTrunk,buf,pMes->Size);
} }

View File

@ -39,6 +39,8 @@
#include "Q931.h" #include "Q931.h"
#include "memory.h" #include "memory.h"
extern L3INT Q931L4HeaderSpace;
/* /*
L3INT Q931CreateMesIndex(L3INT mc) L3INT Q931CreateMesIndex(L3INT mc)
{ {
@ -109,12 +111,13 @@ L3INT Q931Api_InitTrunk(Q931_TrunkInfo_t *pTrunk,
pTrunk->PrivateData32 = PrivateData32; pTrunk->PrivateData32 = PrivateData32;
pTrunk->PrivateData34 = PrivateData34; pTrunk->PrivateData34 = PrivateData34;
pTrunk->LastCRV = 0; pTrunk->LastCRV = 0;
pTrunk->Dialect = Dialect + NetUser; pTrunk->Dialect = Dialect + NetUser;
pTrunk->Enabled = 0; pTrunk->Enabled = 0;
pTrunk->TrunkType = TrunkType; pTrunk->TrunkType = TrunkType;
pTrunk->NetUser = NetUser; pTrunk->NetUser = NetUser;
pTrunk->TrunkState = 0; pTrunk->TrunkState = 0;
pTrunk->autoRestartAck = 0;
for(y=0; y < Q931MAXCHPERTRUNK; y++) for(y=0; y < Q931MAXCHPERTRUNK; y++)
{ {
pTrunk->ch[y].Available = 1; pTrunk->ch[y].Available = 1;
@ -541,3 +544,15 @@ L3INT Q931ReleaseComplete(Q931_TrunkInfo_t *pTrunk, L3INT iTo)
return 0; return 0;
} }
L3INT Q931AckRestart(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf)
{
L3INT RetCode;
Q931mes_Header *ptr = (Q931mes_Header*)&buf[Q931L4HeaderSpace];
ptr->MesType = Q931mes_RESTART_ACKNOWLEDGE;
RetCode = Q931Proc[pTrunk->Dialect][ptr->MesType](pTrunk, buf, 4);
return RetCode;
}

View File

@ -900,6 +900,7 @@ L3INT Q931InitIEHLComp(Q931ie_HLComp * pIE);
L3INT Q931Disconnect(Q931_TrunkInfo_t *pTrunk, L3INT iTo, L3INT iCRV, L3INT iCause); L3INT Q931Disconnect(Q931_TrunkInfo_t *pTrunk, L3INT iTo, L3INT iCRV, L3INT iCause);
L3INT Q931ReleaseComplete(Q931_TrunkInfo_t *pTrunk, L3INT iTo); L3INT Q931ReleaseComplete(Q931_TrunkInfo_t *pTrunk, L3INT iTo);
L3INT Q931AckRestart(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
L3INT Q931Api_InitTrunk(Q931_TrunkInfo_t *pTrunk, L3INT Q931Api_InitTrunk(Q931_TrunkInfo_t *pTrunk,
Q931Dialect_t Dialect, Q931Dialect_t Dialect,

View File

@ -72,9 +72,6 @@ static L3INT zap_isdn_931_34(void *pvt, L2UCHAR *msg, L2INT mlen)
zap_log(ZAP_LOG_DEBUG, "Yay I got an event! Type:[%d] Size:[%d]\n", gen->MesType, gen->Size); zap_log(ZAP_LOG_DEBUG, "Yay I got an event! Type:[%d] Size:[%d]\n", gen->MesType, gen->Size);
gen->MesType = Q931mes_RESTART_ACKNOWLEDGE;
Q931Rx43(&data->q931, msg, gen->Size);
return 0; return 0;
} }
@ -246,7 +243,8 @@ zap_status_t zap_isdn_configure_span(zap_span_t *span, Q921NetUser_t mode, Q931D
zap_isdn_931_err, zap_isdn_931_err,
&span->isdn_data->q921, &span->isdn_data->q921,
span); span);
span->isdn_data->q931.autoRestartAck = 1;
span->signal_type = ZAP_SIGTYPE_ISDN; span->signal_type = ZAP_SIGTYPE_ISDN;