add auto acks.
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@246 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
c0d9b613bd
commit
6d857dc808
|
@ -298,6 +298,10 @@ L3INT Q931ProcConnectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
|
|||
{
|
||||
/* TODO Add proc here*/
|
||||
ret = Q931Tx34(pTrunk,buf,pMes->Size);
|
||||
if (pTrunk->autoConnectAck) {
|
||||
Q931AckConnect(pTrunk, buf);
|
||||
}
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -419,8 +423,12 @@ L3INT Q931ProcSetupTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
|
|||
|
||||
/* Send setup indication to user */
|
||||
ret = Q931Tx34(pTrunk,(L3UCHAR*)pMes,pMes->Size);
|
||||
if(ret != Q931E_NO_ERROR)
|
||||
if(ret != Q931E_NO_ERROR) {
|
||||
if (pTrunk->autoSetupAck) {
|
||||
Q931AckSetup(pTrunk, buf);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Must be full queue, meaning we can't process the call */
|
||||
|
|
|
@ -214,33 +214,12 @@ L3INT Q931GetUniqueCRV(Q931_TrunkInfo_t *pTrunk)
|
|||
return crv++;
|
||||
}
|
||||
|
||||
L3INT Q931InitMesSetup(Q931mes_Generic *pMes)
|
||||
L3INT Q931InitMesGeneric(Q931mes_Generic *pMes)
|
||||
{
|
||||
memset(pMes, 0, sizeof(*pMes));
|
||||
pMes->ProtDisc = 0x80;
|
||||
pMes->CRV = 0; /* CRV to be allocated, might be receive*/
|
||||
pMes->MesType = Q931mes_SETUP;
|
||||
|
||||
pMes->Size = Q931GetMesSize(pMes);
|
||||
|
||||
pMes->SendComplete =0; /* Sending Complete */
|
||||
pMes->RepeatInd =0; /* Repeat Indicator */
|
||||
pMes->BearerCap =0; /* Bearer Capability */
|
||||
pMes->ChanID =0; /* Channel ID */
|
||||
pMes->ProgInd =0; /* Progress Indicator */
|
||||
pMes->NetFac =0; /* Network-specific facilities */
|
||||
pMes->Display =0; /* Display */
|
||||
pMes->DateTime =0; /* Date/Time */
|
||||
pMes->KeypadFac =0; /* Keypad Facility */
|
||||
pMes->Signal =0; /* Signal */
|
||||
pMes->CallingNum =0; /* Calling party number */
|
||||
pMes->CallingSub =0; /* Calling party sub address */
|
||||
pMes->CalledNum =0; /* Called party number */
|
||||
pMes->CalledSub =0; /* Called party sub address */
|
||||
pMes->TransNetSel =0; /* Transit network selection */
|
||||
pMes->LLRepeatInd =0; /* Repeat Indicator 2 LLComp */
|
||||
pMes->LLComp =0; /* Low layer compatibility */
|
||||
pMes->HLComp =0; /* High layer compatibility */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -557,5 +536,29 @@ L3INT Q931AckRestart(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf)
|
|||
return RetCode;
|
||||
}
|
||||
|
||||
L3INT Q931AckSetup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf)
|
||||
{
|
||||
L3INT RetCode;
|
||||
|
||||
Q931mes_Header *ptr = (Q931mes_Header*)&buf[Q931L4HeaderSpace];
|
||||
ptr->MesType = Q931mes_SETUP_ACKNOWLEDGE;
|
||||
|
||||
RetCode = Q931Proc[pTrunk->Dialect][ptr->MesType](pTrunk, buf, 4);
|
||||
|
||||
return RetCode;
|
||||
}
|
||||
|
||||
L3INT Q931AckConnect(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf)
|
||||
{
|
||||
L3INT RetCode;
|
||||
|
||||
Q931mes_Header *ptr = (Q931mes_Header*)&buf[Q931L4HeaderSpace];
|
||||
ptr->MesType = Q931mes_CONNECT_ACKNOWLEDGE;
|
||||
|
||||
RetCode = Q931Proc[pTrunk->Dialect][ptr->MesType](pTrunk, buf, 4);
|
||||
|
||||
return RetCode;
|
||||
}
|
||||
|
||||
Q931_ENUM_NAMES(DIALECT_TYPE_NAMES, DIALECT_STRINGS)
|
||||
Q931_STR2ENUM(q931_str2Q931Diaelct_type, q931_Q931Diaelct_type2str, Q931Dialect_t, DIALECT_TYPE_NAMES, Q931_Dialect_Count)
|
||||
|
|
|
@ -938,6 +938,8 @@ 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 Q931AckConnect(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
L3INT Q931AckSetup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
|
||||
L3INT Q931Api_InitTrunk(Q931_TrunkInfo_t *pTrunk,
|
||||
Q931Dialect_t Dialect,
|
||||
|
|
Loading…
Reference in New Issue