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:
parent
ecfacdef7e
commit
577ffc85b5
|
@ -813,6 +813,9 @@ L3INT Q931ProcRestartTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
|
|||
}
|
||||
else if (iFrom ==2)
|
||||
{
|
||||
if (pTrunk->autoRestartAck) {
|
||||
Q931AckRestart(pTrunk, buf);
|
||||
}
|
||||
/* TODO Add proc here*/
|
||||
ret = Q931Tx34(pTrunk,buf,pMes->Size);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include "Q931.h"
|
||||
#include "memory.h"
|
||||
|
||||
extern L3INT Q931L4HeaderSpace;
|
||||
|
||||
/*
|
||||
L3INT Q931CreateMesIndex(L3INT mc)
|
||||
{
|
||||
|
@ -115,6 +117,7 @@ L3INT Q931Api_InitTrunk(Q931_TrunkInfo_t *pTrunk,
|
|||
pTrunk->TrunkType = TrunkType;
|
||||
pTrunk->NetUser = NetUser;
|
||||
pTrunk->TrunkState = 0;
|
||||
pTrunk->autoRestartAck = 0;
|
||||
for(y=0; y < Q931MAXCHPERTRUNK; y++)
|
||||
{
|
||||
pTrunk->ch[y].Available = 1;
|
||||
|
@ -541,3 +544,15 @@ L3INT Q931ReleaseComplete(Q931_TrunkInfo_t *pTrunk, L3INT iTo)
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -900,6 +900,7 @@ L3INT Q931InitIEHLComp(Q931ie_HLComp * pIE);
|
|||
|
||||
L3INT Q931Disconnect(Q931_TrunkInfo_t *pTrunk, L3INT iTo, L3INT iCRV, L3INT iCause);
|
||||
L3INT Q931ReleaseComplete(Q931_TrunkInfo_t *pTrunk, L3INT iTo);
|
||||
L3INT Q931AckRestart(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
|
||||
L3INT Q931Api_InitTrunk(Q931_TrunkInfo_t *pTrunk,
|
||||
Q931Dialect_t Dialect,
|
||||
|
|
|
@ -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);
|
||||
|
||||
gen->MesType = Q931mes_RESTART_ACKNOWLEDGE;
|
||||
Q931Rx43(&data->q931, msg, gen->Size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -247,6 +244,7 @@ zap_status_t zap_isdn_configure_span(zap_span_t *span, Q921NetUser_t mode, Q931D
|
|||
&span->isdn_data->q921,
|
||||
span);
|
||||
|
||||
span->isdn_data->q931.autoRestartAck = 1;
|
||||
|
||||
span->signal_type = ZAP_SIGTYPE_ISDN;
|
||||
|
||||
|
|
Loading…
Reference in New Issue