Codingstyle cleanup

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@535 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Stefan Knoblich 2008-09-06 19:40:40 +00:00
parent cb92fcdf43
commit b2623fb871
24 changed files with 5286 additions and 5577 deletions

View File

@ -224,9 +224,9 @@ void ATT5ESSCreateTE(L3UCHAR i)
*****************************************************************************/
L3INT ATT5ESSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
if (pMes->ProtDisc == 8) {
/* Find the call using CRV */
@ -234,19 +234,16 @@ L3INT ATT5ESSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
if (ret != Q931E_NO_ERROR)
return ret;
/* TODO chack against state table for illegal or unexpected message here*/
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
}
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here*/
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom ==2) {
/* TODO Add proc here*/
ret = Q931Tx34(pTrunk, buf, pMes->Size);
@ -254,7 +251,6 @@ L3INT ATT5ESSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
printf("autoServiceAck is on, responding to Service Req from network...\n");
Q931AckService(pTrunk, buf);
}
}
return ret;
@ -267,9 +263,9 @@ L3INT ATT5ESSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT ATT5ESSProc0x07TE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
if (pMes->ProtDisc == 8) {
/* Find the call using CRV */
@ -277,19 +273,16 @@ L3INT ATT5ESSProc0x07TE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
if (ret != Q931E_NO_ERROR)
return ret;
/* TODO chack against state table for illegal or unexpected message here*/
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
}
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here*/
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here*/
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}

View File

@ -162,100 +162,113 @@ L3INT ATT5ESSPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT I
Q931MesgHeader(pTrunk, pMes, OBuf, *OSize, &Octet);
/* Sending Complete */
if(Q931IsIEPresent(pMes->SendComplete))
if (Q931IsIEPresent(pMes->SendComplete)) {
OBuf[Octet++] = (L3UCHAR)(pMes->SendComplete & 0x00ff);
}
/* Repeat Indicator */
if(Q931IsIEPresent(pMes->RepeatInd))
if (Q931IsIEPresent(pMes->RepeatInd)) {
OBuf[Octet++] = (L3UCHAR)(pMes->RepeatInd & 0x00ff);
}
/* Bearer capability */
if(Q931IsIEPresent(pMes->BearerCap))
{
if (Q931IsIEPresent(pMes->BearerCap)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_BEARER_CAPABILITY](pTrunk, Q931GetIEPtr(pMes->BearerCap,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
else
{
} else {
rc = Q931E_BEARERCAP;
}
/* Channel Identification */
if(Q931IsIEPresent(pMes->ChanID))
if (Q931IsIEPresent(pMes->ChanID)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CHANNEL_IDENTIFICATION](pTrunk, Q931GetIEPtr(pMes->ChanID,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Progress indicator */
if(Q931IsIEPresent(pMes->ProgInd))
if (Q931IsIEPresent(pMes->ProgInd)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_PROGRESS_INDICATOR](pTrunk, Q931GetIEPtr(pMes->ProgInd,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Network specific facilities */
if(Q931IsIEPresent(pMes->NetFac))
if (Q931IsIEPresent(pMes->NetFac)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_NETWORK_SPECIFIC_FACILITIES](pTrunk, Q931GetIEPtr(pMes->NetFac,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Display */
if(Q931IsIEPresent(pMes->Display))
if (Q931IsIEPresent(pMes->Display)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_DISPLAY](pTrunk, Q931GetIEPtr(pMes->Display,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Date/Time */
if(Q931IsIEPresent(pMes->DateTime))
if (Q931IsIEPresent(pMes->DateTime)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_DATETIME](pTrunk, Q931GetIEPtr(pMes->DateTime,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Keypad Facility */
if(Q931IsIEPresent(pMes->KeypadFac))
if (Q931IsIEPresent(pMes->KeypadFac)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_KEYPAD_FACILITY](pTrunk, Q931GetIEPtr(pMes->KeypadFac,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Signal */
if(Q931IsIEPresent(pMes->Signal))
if (Q931IsIEPresent(pMes->Signal)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_SIGNAL](pTrunk, Q931GetIEPtr(pMes->Signal,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Calling Party Number */
if(Q931IsIEPresent(pMes->CallingNum))
if (Q931IsIEPresent(pMes->CallingNum)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CallingNum,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Calling Party Subaddress */
if(Q931IsIEPresent(pMes->CallingSub))
if (Q931IsIEPresent(pMes->CallingSub)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CallingSub,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Called Party number */
if(Q931IsIEPresent(pMes->CalledNum))
if (Q931IsIEPresent(pMes->CalledNum)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CalledNum,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Called party subaddress */
if(Q931IsIEPresent(pMes->CalledSub))
if (Q931IsIEPresent(pMes->CalledSub)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CalledSub,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Transit network selection */
if(Q931IsIEPresent(pMes->TransNetSel))
if (Q931IsIEPresent(pMes->TransNetSel)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_TRANSIT_NETWORK_SELECTION](pTrunk, Q931GetIEPtr(pMes->TransNetSel,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* Repeat Indicator */
if(Q931IsIEPresent(pMes->LLRepeatInd))
if (Q931IsIEPresent(pMes->LLRepeatInd)) {
rc = Q931E_UNKNOWN_IE;/* TODO */
}
/* Low Layer Compatibility */
if(Q931IsIEPresent(pMes->LLComp))
if (Q931IsIEPresent(pMes->LLComp)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_LOW_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->LLComp,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
/* High Layer Compatibility */
if(Q931IsIEPresent(pMes->HLComp))
if (Q931IsIEPresent(pMes->HLComp)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_HIGH_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->HLComp,pMes->buf), OBuf, &Octet))!=0)
return rc;
}
*OSize = Octet;
return rc;
}

View File

@ -218,9 +218,9 @@ void DMSCreateTE(L3UCHAR i)
*****************************************************************************/
L3INT DMSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
if (pMes->ProtDisc == 8) {
/* Find the call using CRV */
@ -228,26 +228,22 @@ L3INT DMSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
if (ret != Q931E_NO_ERROR)
return ret;
/* TODO chack against state table for illegal or unexpected message here*/
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
}
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here*/
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here*/
ret = Q931Tx34(pTrunk, buf, pMes->Size);
if (pMes->ProtDisc == 3 && pTrunk->autoServiceAck) {
Q931AckService(pTrunk, buf);
}
}
return ret;
@ -260,9 +256,9 @@ L3INT DMSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT DMSProc0x07TE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
if (pMes->ProtDisc == 8) {
/* Find the call using CRV */
@ -270,19 +266,16 @@ L3INT DMSProc0x07TE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
if (ret != Q931E_NO_ERROR)
return ret;
/* TODO chack against state table for illegal or unexpected message here*/
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
}
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here*/
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here*/
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}

View File

@ -59,8 +59,7 @@ L3INT DMSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *me
L3UCHAR last_codeset = 0, codeset = 0;
L3UCHAR shift_lock = 1;
while(IOff < Size)
{
while (IOff < Size) {
if (!shift_lock) {
codeset = last_codeset;
}
@ -75,8 +74,7 @@ L3INT DMSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *me
}
if (codeset == 0) {
switch(IBuf[IOff])
{
switch (IBuf[IOff]) {
case Q931ie_SENDING_COMPLETE:
case Q931ie_BEARER_CAPABILITY:
case Q931ie_CHANNEL_IDENTIFICATION:
@ -110,8 +108,7 @@ L3INT DMSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *me
break;
}
} else if (codeset == 6) {
switch(IBuf[IOff])
{
switch (IBuf[IOff]) {
case Q931ie_GENERIC_DIGITS:
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
if (rc != Q931E_NO_ERROR)
@ -158,100 +155,114 @@ L3INT DMSPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize
Q931MesgHeader(pTrunk, pMes, OBuf, *OSize, &Octet);
/* Sending Complete */
if(Q931IsIEPresent(pMes->SendComplete))
if (Q931IsIEPresent(pMes->SendComplete)) {
OBuf[Octet++] = (L3UCHAR)(pMes->SendComplete & 0x00ff);
}
/* Repeat Indicator */
if(Q931IsIEPresent(pMes->RepeatInd))
if (Q931IsIEPresent(pMes->RepeatInd)) {
OBuf[Octet++] = (L3UCHAR)(pMes->RepeatInd & 0x00ff);
}
/* Bearer capability */
if(Q931IsIEPresent(pMes->BearerCap))
{
if (Q931IsIEPresent(pMes->BearerCap)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_BEARER_CAPABILITY](pTrunk, Q931GetIEPtr(pMes->BearerCap,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
else
{
} else {
rc = Q931E_BEARERCAP;
}
/* Channel Identification */
if(Q931IsIEPresent(pMes->ChanID))
if (Q931IsIEPresent(pMes->ChanID)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CHANNEL_IDENTIFICATION](pTrunk, Q931GetIEPtr(pMes->ChanID,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Progress indicator */
if(Q931IsIEPresent(pMes->ProgInd))
if (Q931IsIEPresent(pMes->ProgInd)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_PROGRESS_INDICATOR](pTrunk, Q931GetIEPtr(pMes->ProgInd,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Network spesific facilities */
if(Q931IsIEPresent(pMes->NetFac))
if (Q931IsIEPresent(pMes->NetFac)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_NETWORK_SPECIFIC_FACILITIES](pTrunk, Q931GetIEPtr(pMes->NetFac,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Display */
if(Q931IsIEPresent(pMes->Display))
if (Q931IsIEPresent(pMes->Display)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_DISPLAY](pTrunk, Q931GetIEPtr(pMes->Display,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Date/Time */
if(Q931IsIEPresent(pMes->DateTime))
if (Q931IsIEPresent(pMes->DateTime)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_DATETIME](pTrunk, Q931GetIEPtr(pMes->DateTime,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Keypad Facility */
if(Q931IsIEPresent(pMes->KeypadFac))
if (Q931IsIEPresent(pMes->KeypadFac)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_KEYPAD_FACILITY](pTrunk, Q931GetIEPtr(pMes->KeypadFac,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Signal */
if(Q931IsIEPresent(pMes->Signal))
if (Q931IsIEPresent(pMes->Signal)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_SIGNAL](pTrunk, Q931GetIEPtr(pMes->Signal,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Calling Party Number */
if(Q931IsIEPresent(pMes->CallingNum))
if (Q931IsIEPresent(pMes->CallingNum)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CallingNum,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Calling Party Subaddress */
if(Q931IsIEPresent(pMes->CallingSub))
if (Q931IsIEPresent(pMes->CallingSub)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CallingSub,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Called Party number */
if(Q931IsIEPresent(pMes->CalledNum))
if (Q931IsIEPresent(pMes->CalledNum)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CalledNum,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Called party subaddress */
if(Q931IsIEPresent(pMes->CalledSub))
if (Q931IsIEPresent(pMes->CalledSub)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CalledSub,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Transit network selection */
if(Q931IsIEPresent(pMes->TransNetSel))
if (Q931IsIEPresent(pMes->TransNetSel)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_TRANSIT_NETWORK_SELECTION](pTrunk, Q931GetIEPtr(pMes->TransNetSel,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Repeat Indicator */
if(Q931IsIEPresent(pMes->LLRepeatInd))
if (Q931IsIEPresent(pMes->LLRepeatInd)) {
rc = Q931E_UNKNOWN_IE;/* TODO */
}
/* Low Layer Compatibility */
if(Q931IsIEPresent(pMes->LLComp))
if (Q931IsIEPresent(pMes->LLComp)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_LOW_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->LLComp,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* High Layer Compatibility */
if(Q931IsIEPresent(pMes->HLComp))
if (Q931IsIEPresent(pMes->HLComp)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_HIGH_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->HLComp,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
*OSize = Octet;
return rc;
}

View File

@ -42,5 +42,3 @@
*****************************************************************************/
#include "Q931.h"

View File

@ -71,11 +71,7 @@ q931pie_func_t *Q931Pie[Q931MAXDLCT][Q931MAXIE];
q931timeout_func_t *Q931Timeout[Q931MAXDLCT][Q931MAXTIMER];
q931timer_t Q931Timer[Q931MAXDLCT][Q931MAXTIMER];
void (*Q931CreateDialectCB[Q931MAXDLCT]) (L3UCHAR iDialect)=
{
NULL,
NULL
};
void (*Q931CreateDialectCB[Q931MAXDLCT])(L3UCHAR iDialect) = { NULL, NULL };
Q931State Q931st[Q931MAXSTATE];
@ -96,9 +92,7 @@ L3INT Q931L2HeaderSpace = {4}; /* Q921 header space, sapi, tei etc */
*****************************************************************************/
Q931ErrorCB_t Q931ErrorProc;
/* callback for error messages. */
Q931ErrorCB_t Q931ErrorProc; /* callback for error messages. */
L3ULONG (*Q931GetTimeProc) (void) = NULL; /* callback for func reading time in ms */
/*****************************************************************************
@ -237,19 +231,17 @@ void Q931Initialize()
/* Secure the callbacks to default procs */
Q931ErrorProc = Q931ErrorDummy;
/* The user will only add the message handlers and IE handlers he need, */
/* so we need to initialize every single entry to a default function */
/* that will throw an appropriate error if they are ever called. */
for(x=0; x < Q931MAXDLCT; x++)
{
for(y=0; y < Q931MAXMES; y++)
{
/* The user will only add the message handlers and IE handlers he need,
* so we need to initialize every single entry to a default function
* that will throw an appropriate error if they are ever called.
*/
for (x = 0; x < Q931MAXDLCT; x++) {
for (y = 0; y < Q931MAXMES; y++) {
Q931Proc[x][y] = Q931ProcDummy;
Q931Umes[x][y] = Q931UmesDummy;
Q931Pmes[x][y] = Q931PmesDummy;
}
for(y=0; y < Q931MAXIE; y++)
{
for (y = 0; y < Q931MAXIE; y++) {
Q931Pie[x][y] = Q931PieDummy;
Q931Uie[x][y] = Q931UieDummy;
}
@ -284,10 +276,8 @@ void Q931Initialize()
Q931AddDialect(Q931_Dialect_5ESS + Q931_NT, ATT5ESSCreateNT);
/* The last step we do is to call the callbacks to create the dialects */
for(x=0; x < Q931MAXDLCT; x++)
{
if(Q931CreateDialectCB[x] != NULL)
{
for (x = 0; x < Q931MAXDLCT; x++) {
if (Q931CreateDialectCB[x] != NULL) {
Q931CreateDialectCB[x]((L3UCHAR)x);
}
}
@ -396,8 +386,7 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3INT ind, L3UCHAR tei, L3UCHAR * buf,
m->MesType, m->CRVFlag, m->CRVFlag ? "Terminator" : "Originator", m->CRV, pTrunk->Dialect);
RetCode = Q931Umes[pTrunk->Dialect][m->MesType](pTrunk, Mes, (Q931mes_Generic *)pTrunk->L3Buf, IOff, Size - L2HSize);
if(RetCode >= Q931E_NO_ERROR)
{
if (RetCode >= Q931E_NO_ERROR) {
RetCode = Q931Proc[pTrunk->Dialect][m->MesType](pTrunk, pTrunk->L3Buf, 2);
}
break;
@ -491,8 +480,7 @@ L3INT Q931Tx32Data(Q931_TrunkInfo_t *pTrunk, L3UCHAR bcast, L3UCHAR * Mes, L3INT
/* Call pack function through table. */
RetCode = Q931Pmes[iDialect][ptr->MesType](pTrunk, (Q931mes_Generic *)Mes, Size, &pTrunk->L2Buf[Offset], &OSize);
if(RetCode >= Q931E_NO_ERROR)
{
if (RetCode >= Q931E_NO_ERROR) {
L3INT callIndex;
L3UCHAR tei = 0;
@ -555,8 +543,7 @@ void Q931SetDefaultErrorCB(Q931ErrorCB_t Q931ErrorPar)
Return Value: Error Code. 0 = No Error, < 0 :error, > 0 : Warning
see q931errors.h for details.
*****************************************************************************/
****************************************************************************/
L3INT Q931CreateCRV(Q931_TrunkInfo_t *pTrunk, L3INT * callIndex)
{
L3INT CRV = Q931GetUniqueCRV(pTrunk);
@ -595,10 +582,8 @@ L3INT Q931ReleaseCRV(Q931_TrunkInfo_t *pTrunk, L3INT CRV)
L3INT Q931AllocateCRV(Q931_TrunkInfo_t *pTrunk, L3INT iCRV, L3INT * callIndex)
{
L3INT x;
for(x=0; x < Q931MAXCALLPERTRUNK; x++)
{
if(!pTrunk->call[x].InUse)
{
for (x = 0; x < Q931MAXCALLPERTRUNK; x++) {
if (!pTrunk->call[x].InUse) {
pTrunk->call[x].CRV = iCRV;
pTrunk->call[x].BChan = 255;
pTrunk->call[x].State = 0; /* null state - idle */
@ -628,12 +613,9 @@ L3INT Q931AllocateCRV(Q931_TrunkInfo_t *pTrunk, L3INT iCRV, L3INT * callIndex)
L3INT Q931GetCallState(Q931_TrunkInfo_t *pTrunk, L3INT iCRV)
{
L3INT x;
for(x=0; x < Q931MAXCALLPERTRUNK; x++)
{
if(pTrunk->call[x].InUse)
{
if(pTrunk->call[x].CRV == iCRV)
{
for (x = 0; x < Q931MAXCALLPERTRUNK; x++) {
if (pTrunk->call[x].InUse) {
if (pTrunk->call[x].CRV == iCRV) {
return pTrunk->call[x].State;
}
}
@ -657,7 +639,6 @@ L3INT Q931StartTimer(Q931_TrunkInfo_t *pTrunk, L3INT callIndex, L3USHORT iTimerI
pTrunk->call[callIndex].Timer = Q931GetTime() + duration;
pTrunk->call[callIndex].TimerID = iTimerID;
}
return 0;
}
@ -689,11 +670,9 @@ L3ULONG Q931GetTime()
L3ULONG tNow = 0;
static L3ULONG tLast = 0;
if(Q931GetTimeProc != NULL)
{
if (Q931GetTimeProc != NULL) {
tNow = Q931GetTimeProc();
if(tNow < tLast) /* wrapped */
{
if (tNow < tLast) { /* wrapped */
/* TODO */
}
tLast = tNow;
@ -709,12 +688,9 @@ void Q931SetGetTimeCB(L3ULONG (*callback)(void))
L3INT Q931FindCRV(Q931_TrunkInfo_t *pTrunk, L3INT crv, L3INT *callindex)
{
L3INT x;
for(x=0; x < Q931MAXCALLPERTRUNK; x++)
{
if(pTrunk->call[x].InUse)
{
if(pTrunk->call[x].CRV == crv)
{
for (x = 0; x < Q931MAXCALLPERTRUNK; x++) {
if (pTrunk->call[x].InUse) {
if (pTrunk->call[x].CRV == crv) {
*callindex = x;
return Q931E_NO_ERROR;
}
@ -726,8 +702,7 @@ L3INT Q931FindCRV(Q931_TrunkInfo_t *pTrunk, L3INT crv, L3INT *callindex)
void Q931AddDialect(L3UCHAR i, void (*callback)(L3UCHAR iD ))
{
if(i < Q931MAXDLCT)
{
if (i < Q931MAXDLCT) {
Q931CreateDialectCB[i] = callback;
}
}
@ -741,10 +716,8 @@ void Q931AddDialect(L3UCHAR i, void (*callback)(L3UCHAR iD ))
void Q931AddStateEntry(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir)
{
int x;
for(x=0; x < Q931MAXSTATE; x++)
{
if(Q931st[x].Message == 0)
{
for (x = 0; x < Q931MAXSTATE; x++) {
if (Q931st[x].Message == 0) {
Q931st[x].State = iState;
Q931st[x].Message = iMes;
Q931st[x].Direction = cDir;
@ -767,12 +740,9 @@ L3BOOL Q931IsEventLegal(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir)
{
int x;
/* TODO Sort table and use bsearch */
for(x=0; x < Q931MAXSTATE; x++)
{
if( Q931st[x].State == iState
&& Q931st[x].Message == iMes
&& Q931st[x].Direction == cDir)
{
for (x = 0; x < Q931MAXSTATE; x++) {
if (Q931st[x].State == iState && Q931st[x].Message == iMes &&
Q931st[x].Direction == cDir) {
return L3TRUE;
}
}

View File

@ -119,13 +119,13 @@ void Q931CreateNT(L3UCHAR i)
Q931SetIEProc(Q931ie_CONNECTED_NUMBER, i, Q931Pie_Generic, Q931Uie_Generic);
Q931SetIEProc(Q931ie_FACILITY, i, Q931Pie_Generic, Q931Uie_Generic);
/* The following define a state machine. The point is that the Message */
/* procs can when search this to find out if the message/state */
/* combination is legale. If not, the proc for unexpected message apply.*/
/* The following define a state machine. The point is that the Message
* procs can when search this to find out if the message/state
* combination is legale. If not, the proc for unexpected message apply.
*/
/* TODO define state table here */
/* Timer default values */
Q931SetTimerDefault(i, Q931_TIMER_T301, 180000); /* T301: 180s */
Q931SetTimerDefault(i, Q931_TIMER_T302, 15000); /* T302: 15s */
@ -153,9 +153,9 @@ void Q931CreateNT(L3UCHAR i)
*****************************************************************************/
L3INT Q931ProcAlertingNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -164,12 +164,10 @@ L3INT Q931ProcAlertingNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* Reset 4 sec timer. */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
return ret;
@ -182,9 +180,9 @@ L3INT Q931ProcAlertingNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcCallProceedingNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -195,13 +193,11 @@ L3INT Q931ProcCallProceedingNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iF
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -215,9 +211,9 @@ L3INT Q931ProcCallProceedingNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iF
*****************************************************************************/
L3INT Q931ProcConnectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -228,13 +224,11 @@ L3INT Q931ProcConnectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -248,9 +242,9 @@ L3INT Q931ProcConnectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcConnectAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -261,13 +255,11 @@ L3INT Q931ProcConnectAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -281,9 +273,9 @@ L3INT Q931ProcConnectAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcProgressNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -294,13 +286,11 @@ L3INT Q931ProcProgressNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -316,24 +306,23 @@ L3INT Q931ProcProgressNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSetupNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
L3INT rc=0;
Q931mes_Generic *pMes = (Q931mes_Generic *)&buf[Q931L4HeaderSpace];
L3INT rc = 0;
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
/* Reject SETUP on existing calls */
if(Q931GetCallState(pTrunk, pMes->CRV) != Q931_U0)
{
if (Q931GetCallState(pTrunk, pMes->CRV) != Q931_U0) {
Q931Disconnect(pTrunk, iFrom, pMes->CRV, 81);
return Q931E_UNEXPECTED_MESSAGE;
}
/* outgoing call */
if(iFrom == 4)
{
if (iFrom == 4) {
ret = Q931CreateCRV(pTrunk, &callIndex);
if (ret)
return ret;
pMes->CRV = pTrunk->call[callIndex].CRV;
/*
@ -344,43 +333,34 @@ L3INT Q931ProcSetupNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
return ret;
Q931StartTimer(pTrunk, callIndex, 303);
Q931SetState(pTrunk, callIndex, Q931_U1);
}
/* incoming call */
else
{
else {
/* Locate free CRV entry and store info */
ret = Q931AllocateCRV(pTrunk, pMes->CRV, &callIndex);
if(ret != Q931E_NO_ERROR)
{
if (ret != Q931E_NO_ERROR) {
/* Not possible to allocate CRV entry, so must reject call */
Q931Disconnect(pTrunk, iFrom, pMes->CRV, 42);
return ret;
}
/* Send setup indication to user */
ret = Q931Tx34(pTrunk, (L3UCHAR*)pMes, pMes->Size);
if(ret != Q931E_NO_ERROR)
if (ret != Q931E_NO_ERROR) {
return ret;
else
{
} else {
/* Must be full queue, meaning we can't process the call */
/* so we must disconnect */
Q931Disconnect(pTrunk, iFrom, pMes->CRV, 81);
return ret;
}
#if 0
/* TODO: Unreachable code??? */
/* Set state U6 */
Q931SetState(pTrunk, callIndex, Q931_U6);
Q931StartTimer(pTrunk, callIndex, 303);
#endif
}
return rc;
@ -399,9 +379,9 @@ L3INT Q931ProcSetupNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSetupAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -412,13 +392,11 @@ L3INT Q931ProcSetupAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -432,9 +410,9 @@ L3INT Q931ProcSetupAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcResumeNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -445,13 +423,11 @@ L3INT Q931ProcResumeNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -465,9 +441,9 @@ L3INT Q931ProcResumeNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcResumeAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -478,13 +454,11 @@ L3INT Q931ProcResumeAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -498,9 +472,9 @@ L3INT Q931ProcResumeAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcResumeRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -511,13 +485,11 @@ L3INT Q931ProcResumeRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFro
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -531,9 +503,9 @@ L3INT Q931ProcResumeRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFro
*****************************************************************************/
L3INT Q931ProcSuspendNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -544,13 +516,11 @@ L3INT Q931ProcSuspendNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -564,9 +534,9 @@ L3INT Q931ProcSuspendNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSuspendAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -577,13 +547,11 @@ L3INT Q931ProcSuspendAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -597,9 +565,9 @@ L3INT Q931ProcSuspendAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSuspendRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -610,13 +578,11 @@ L3INT Q931ProcSuspendRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -630,9 +596,9 @@ L3INT Q931ProcSuspendRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
*****************************************************************************/
L3INT Q931ProcUserInformationNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -643,13 +609,11 @@ L3INT Q931ProcUserInformationNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -663,9 +627,9 @@ L3INT Q931ProcUserInformationNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
*****************************************************************************/
L3INT Q931ProcDisconnectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -676,13 +640,11 @@ L3INT Q931ProcDisconnectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -696,9 +658,9 @@ L3INT Q931ProcDisconnectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcReleaseNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -709,13 +671,11 @@ L3INT Q931ProcReleaseNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -729,9 +689,9 @@ L3INT Q931ProcReleaseNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcReleaseCompleteNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -742,13 +702,11 @@ L3INT Q931ProcReleaseCompleteNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -762,9 +720,9 @@ L3INT Q931ProcReleaseCompleteNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
*****************************************************************************/
L3INT Q931ProcRestartNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -775,13 +733,11 @@ L3INT Q931ProcRestartNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -795,9 +751,9 @@ L3INT Q931ProcRestartNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcRestartAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -808,13 +764,11 @@ L3INT Q931ProcRestartAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -828,9 +782,9 @@ L3INT Q931ProcRestartAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcCongestionControlNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -841,13 +795,11 @@ L3INT Q931ProcCongestionControlNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -861,9 +813,9 @@ L3INT Q931ProcCongestionControlNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT
*****************************************************************************/
L3INT Q931ProcInformationNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -874,13 +826,11 @@ L3INT Q931ProcInformationNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -894,9 +844,9 @@ L3INT Q931ProcInformationNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
*****************************************************************************/
L3INT Q931ProcNotifyNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -907,13 +857,11 @@ L3INT Q931ProcNotifyNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -927,9 +875,9 @@ L3INT Q931ProcNotifyNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcStatusNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -940,13 +888,11 @@ L3INT Q931ProcStatusNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -960,9 +906,9 @@ L3INT Q931ProcStatusNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcStatusEnquiryNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -973,13 +919,11 @@ L3INT Q931ProcStatusEnquiryNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -993,9 +937,9 @@ L3INT Q931ProcStatusEnquiryNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
*****************************************************************************/
L3INT Q931ProcSegmentNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1006,13 +950,11 @@ L3INT Q931ProcSegmentNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1030,9 +972,9 @@ L3INT Q931ProcSegmentNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcFacilityNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1043,13 +985,11 @@ L3INT Q932ProcFacilityNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1063,9 +1003,9 @@ L3INT Q932ProcFacilityNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcHoldNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1076,13 +1016,11 @@ L3INT Q932ProcHoldNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1096,9 +1034,9 @@ L3INT Q932ProcHoldNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcHoldAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1109,13 +1047,11 @@ L3INT Q932ProcHoldAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1129,9 +1065,9 @@ L3INT Q932ProcHoldAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcHoldRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1142,13 +1078,11 @@ L3INT Q932ProcHoldRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1162,9 +1096,9 @@ L3INT Q932ProcHoldRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcRegisterNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1175,13 +1109,11 @@ L3INT Q932ProcRegisterNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1195,9 +1127,9 @@ L3INT Q932ProcRegisterNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcRetrieveNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1208,13 +1140,11 @@ L3INT Q932ProcRetrieveNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1228,9 +1158,9 @@ L3INT Q932ProcRetrieveNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcRetrieveAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1241,13 +1171,11 @@ L3INT Q932ProcRetrieveAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1261,9 +1189,9 @@ L3INT Q932ProcRetrieveAckNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
*****************************************************************************/
L3INT Q932ProcRetrieveRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1274,16 +1202,13 @@ L3INT Q932ProcRetrieveRejectNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iF
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
return ret;
}

View File

@ -126,9 +126,10 @@ void Q931CreateTE(L3UCHAR i)
Q931SetIEProc(Q931ie_CONNECTED_NUMBER, i, Q931Pie_Generic, Q931Uie_Generic);
Q931SetIEProc(Q931ie_FACILITY, i, Q931Pie_Generic, Q931Uie_Generic);
/* The following define a state machine. The point is that the Message */
/* procs can when search this to find out if the message/state */
/* combination is legale. If not, the proc for unexpected message apply.*/
/* The following define a state machine. The point is that the Message
* procs can when search this to find out if the message/state
* combination is legale. If not, the proc for unexpected message apply.
*/
/* State 0 Idle */
Q931AddStateEntry(i, Q931_U0, Q931mes_RESUME, 2);
@ -235,9 +236,9 @@ void Q931CreateTE(L3UCHAR i)
*****************************************************************************/
L3INT Q931ProcAlertingTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -246,12 +247,10 @@ L3INT Q931ProcAlertingTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* Reset 4 sec timer. */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
return ret;
@ -264,9 +263,9 @@ L3INT Q931ProcAlertingTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcCallProceedingTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -277,13 +276,11 @@ L3INT Q931ProcCallProceedingTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iF
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -297,9 +294,9 @@ L3INT Q931ProcCallProceedingTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iF
*****************************************************************************/
L3INT Q931ProcConnectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -310,19 +307,16 @@ L3INT Q931ProcConnectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
if (pTrunk->autoConnectAck) {
Q931AckConnect(pTrunk, buf);
}
}
return ret;
}
@ -334,9 +328,9 @@ L3INT Q931ProcConnectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcConnectAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -347,13 +341,11 @@ L3INT Q931ProcConnectAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -367,9 +359,9 @@ L3INT Q931ProcConnectAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcProgressTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -380,13 +372,11 @@ L3INT Q931ProcProgressTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -400,21 +390,19 @@ L3INT Q931ProcProgressTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSetupTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
L3INT rc=0;
Q931mes_Generic *pMes = (Q931mes_Generic *)&buf[Q931L4HeaderSpace];
L3INT rc = 0;
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
/* Reject SETUP on existing calls */
if(Q931GetCallState(pTrunk, pMes->CRV) != Q931_U0)
{
if (Q931GetCallState(pTrunk, pMes->CRV) != Q931_U0) {
Q931Disconnect(pTrunk, iFrom, pMes->CRV, 81);
return Q931E_UNEXPECTED_MESSAGE;
}
/* outgoing call */
if(iFrom == 4)
{
if (iFrom == 4) {
ret = Q931CreateCRV(pTrunk, &callIndex);
if (ret)
return ret;
@ -427,19 +415,15 @@ L3INT Q931ProcSetupTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
Q931StartTimer(pTrunk, callIndex, 303);
/* TODO: Add this back when we get the state stuff more filled out */
//Q931SetState(pTrunk, callIndex, Q931_U1);
/*Q931SetState(pTrunk, callIndex, Q931_U1);*/
}
/* incoming call */
else
{
else {
/* Locate free CRV entry and store info */
ret = Q931AllocateCRV(pTrunk, pMes->CRV, &callIndex);
if(ret != Q931E_NO_ERROR)
{
if (ret != Q931E_NO_ERROR) {
/* Not possible to allocate CRV entry, so must reject call */
Q931Disconnect(pTrunk, iFrom, pMes->CRV, 42);
return ret;
}
@ -450,9 +434,7 @@ L3INT Q931ProcSetupTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
Q931AckSetup(pTrunk, buf);
}
return ret;
}
else
{
} else {
/* Must be full queue, meaning we can't process the call */
/* so we must disconnect */
Q931Disconnect(pTrunk, iFrom, pMes->CRV, 81);
@ -466,7 +448,6 @@ L3INT Q931ProcSetupTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
Q931StartTimer(pTrunk, callIndex, 303);
#endif
}
return rc;
}
@ -485,21 +466,19 @@ L3INT Q931ProcSetupTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSetupAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
if (ret != Q931E_NO_ERROR)
return ret;
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
Q931StartTimer(pTrunk, callIndex, 303);
}
return ret;
@ -516,8 +495,7 @@ L3INT Q931ProcResumeTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
if(Q931GetCallState(pTrunk,pMes->CRV) == Q931_U0 && iFrom == 4)
{
if (Q931GetCallState(pTrunk, pMes->CRV) == Q931_U0 && iFrom ==4) {
/* Call reference selection */
ret = Q931CreateCRV(pTrunk, &callIndex);
if (ret != Q931E_NO_ERROR)
@ -534,9 +512,7 @@ L3INT Q931ProcResumeTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* set state U17 */
Q931SetState(pTrunk, callIndex, Q931_U17);
}
else
{
} else {
return Q931E_ILLEGAL_MESSAGE;
}
return ret;
@ -549,9 +525,9 @@ L3INT Q931ProcResumeTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcResumeAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -562,13 +538,11 @@ L3INT Q931ProcResumeAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -582,9 +556,9 @@ L3INT Q931ProcResumeAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcResumeRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -595,13 +569,11 @@ L3INT Q931ProcResumeRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFro
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -615,9 +587,9 @@ L3INT Q931ProcResumeRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFro
*****************************************************************************/
L3INT Q931ProcSuspendTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -628,13 +600,11 @@ L3INT Q931ProcSuspendTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -648,9 +618,9 @@ L3INT Q931ProcSuspendTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSuspendAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -661,13 +631,11 @@ L3INT Q931ProcSuspendAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -681,9 +649,9 @@ L3INT Q931ProcSuspendAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcSuspendRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -694,13 +662,11 @@ L3INT Q931ProcSuspendRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -714,9 +680,9 @@ L3INT Q931ProcSuspendRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
*****************************************************************************/
L3INT Q931ProcUserInformationTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -727,13 +693,11 @@ L3INT Q931ProcUserInformationTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -747,9 +711,9 @@ L3INT Q931ProcUserInformationTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
*****************************************************************************/
L3INT Q931ProcDisconnectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
Q931Log(pTrunk, Q931_LOG_DEBUG, "Processing DISCONNECT message from %s for CRV: %d (%#hx)\n",
iFrom == 4 ? "Local" : "Remote", pMes->CRV, pMes->CRV);
@ -763,13 +727,11 @@ L3INT Q931ProcDisconnectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -783,14 +745,16 @@ L3INT Q931ProcDisconnectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcReleaseTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
L3INT callIndex;
Q931mes_Generic *pMes = (Q931mes_Generic *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT state = Q931GetCallState(pTrunk, pMes->CRV);
L3INT ret = Q931E_NO_ERROR;
if (iFrom == 4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
} else if(state == Q931_U0 && iFrom == 2) {
}
else if (state == Q931_U0 && iFrom == 2) {
Q931Tx34(pTrunk, buf, pMes->Size);
ret = Q931ReleaseComplete(pTrunk, buf);
} else {
@ -813,16 +777,14 @@ 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 callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Generic *pMes = (Q931mes_Generic *)&buf[Q931L4HeaderSpace];
if(iFrom == 2)
{
if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
} else {
if (pMes->CRV) {
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -833,7 +795,6 @@ L3INT Q931ProcReleaseCompleteTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
/* TODO: experimental, send RELEASE_COMPLETE message */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
}
return ret;
}
@ -845,10 +806,9 @@ L3INT Q931ProcReleaseCompleteTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT i
*****************************************************************************/
L3INT Q931ProcRestartTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
if (pMes->CRV) {
/* Find the call using CRV */
@ -862,13 +822,11 @@ L3INT Q931ProcRestartTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO chack against state table for illegal or unexpected message here */
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
@ -886,9 +844,9 @@ L3INT Q931ProcRestartTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcRestartAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
if (pMes->CRV) {
/* Find the call using CRV */
@ -901,13 +859,11 @@ L3INT Q931ProcRestartAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO chack against state table for illegal or unexpected message here */
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -921,9 +877,9 @@ L3INT Q931ProcRestartAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcCongestionControlTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -934,13 +890,11 @@ L3INT Q931ProcCongestionControlTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -954,9 +908,9 @@ L3INT Q931ProcCongestionControlTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT
*****************************************************************************/
L3INT Q931ProcInformationTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -967,13 +921,11 @@ L3INT Q931ProcInformationTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -987,9 +939,9 @@ L3INT Q931ProcInformationTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
*****************************************************************************/
L3INT Q931ProcNotifyTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1000,13 +952,11 @@ L3INT Q931ProcNotifyTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1020,9 +970,9 @@ L3INT Q931ProcNotifyTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcStatusTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1033,13 +983,11 @@ L3INT Q931ProcStatusTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1053,9 +1001,9 @@ L3INT Q931ProcStatusTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q931ProcStatusEnquiryTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1066,13 +1014,11 @@ L3INT Q931ProcStatusEnquiryTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1086,9 +1032,9 @@ L3INT Q931ProcStatusEnquiryTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFr
*****************************************************************************/
L3INT Q931ProcSegmentTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1099,13 +1045,11 @@ L3INT Q931ProcSegmentTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1123,9 +1067,9 @@ L3INT Q931ProcSegmentTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcFacilityTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1136,13 +1080,11 @@ L3INT Q932ProcFacilityTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1156,9 +1098,9 @@ L3INT Q932ProcFacilityTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcHoldTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1169,13 +1111,11 @@ L3INT Q932ProcHoldTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1189,9 +1129,9 @@ L3INT Q932ProcHoldTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcHoldAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1202,13 +1142,11 @@ L3INT Q932ProcHoldAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1222,9 +1160,9 @@ L3INT Q932ProcHoldAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcHoldRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1235,13 +1173,11 @@ L3INT Q932ProcHoldRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1255,9 +1191,9 @@ L3INT Q932ProcHoldRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcRegisterTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1268,13 +1204,11 @@ L3INT Q932ProcRegisterTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1288,9 +1222,9 @@ L3INT Q932ProcRegisterTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcRetrieveTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1301,13 +1235,11 @@ L3INT Q932ProcRetrieveTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1321,9 +1253,9 @@ L3INT Q932ProcRetrieveTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
*****************************************************************************/
L3INT Q932ProcRetrieveAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1334,13 +1266,11 @@ L3INT Q932ProcRetrieveAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
@ -1354,9 +1284,9 @@ L3INT Q932ProcRetrieveAckTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom
*****************************************************************************/
L3INT Q932ProcRetrieveRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
{
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
L3INT callIndex;
L3INT ret = Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
/* Find the call using CRV */
ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
@ -1367,16 +1297,13 @@ L3INT Q932ProcRetrieveRejectTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iF
/* TODO - Set correct timer here */
Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
if (iFrom ==4) {
/* TODO Add proc here */
ret = Q931Tx32Data(pTrunk, 0, buf, pMes->Size);
}
else if (iFrom ==2)
{
else if (iFrom == 2) {
/* TODO Add proc here */
ret = Q931Tx34(pTrunk, buf, pMes->Size);
}
return ret;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,6 @@
Contents: Header and definition for the National ISDN dialect. The
header contents the following parts:
- Definition of codes
- Definition of information elements (nationalie_).
- Definition of messages (nationalmes_).
@ -77,8 +76,6 @@ L3INT DMSPmes_0x07(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize,
L3INT DMSUmes_0x0f(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
L3INT DMSPmes_0x0f(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
/*****************************************************************************
Q.931 Process Function Prototyping. Implemented in nationalStateTE.c
@ -88,7 +85,6 @@ L3INT DMSPmes_0x0f(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize,
L3INT DMSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom);
L3INT DMSProc0x07TE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom);
void DMSCreateTE(L3UCHAR i);
void DMSCreateNT(L3UCHAR i);

View File

@ -157,7 +157,6 @@
*****************************************************************************/
typedef enum {
Q931E_NO_ERROR = 0,
Q931E_UNKNOWN_MESSAGE = -3001,
@ -190,7 +189,6 @@ typedef enum {
Q931E_SEGMENT = -3028,
Q931E_SIGNAL = -3029,
Q931E_GENERIC_DIGITS = -3030
} q931_error_t;
/* The q931_error_t enum should be kept in sync with the q931_error_names array in Q931.c */

View File

@ -98,7 +98,6 @@ typedef enum {
#define Q931ie_ESCAPE_FOR_EX 0x7f /* 0111 1111 */
/* Variable Length Codeset 6 Information Elements */
#define Q931ie_GENERIC_DIGITS 0x37 /* 0011 0111 */
/* Variable Length Information Element to shut up BRI testing */
@ -114,10 +113,9 @@ typedef enum {
*****************************************************************************/
typedef struct
{
L3UCHAR IEId; /* 00000100 for Bearer Capability */
typedef struct {
L3UCHAR IEId; /* 00000100 for Bearer Capability */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CodStand; /* Coding Standard. */
@ -286,6 +284,7 @@ typedef struct
L3UCHAR AL3Info1; /* additional layer 3 info 1 */
L3UCHAR AL3Info2; /* additional layer 3 info 2 */
} Q931ie_BearerCap;
/*****************************************************************************
@ -295,11 +294,12 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00010000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CallId[1]; /* Call identity */
} Q931ie_CallID;
/*****************************************************************************
@ -309,12 +309,13 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00010100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CodStand; /* Coding Standard */
L3UCHAR CallState; /* Call State Value */
} Q931ie_CallState;
/*****************************************************************************
@ -324,8 +325,8 @@ typedef struct
Description: Cause IE as described in Q.850
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00010100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CodStand; /* Coding Standard */
@ -333,6 +334,7 @@ typedef struct
L3UCHAR Recom; /* Recommendation */
L3UCHAR Value; /* Cause Value */
L3UCHAR Diag[1]; /* Optional Diagnostics Field */
} Q931ie_Cause;
/*****************************************************************************
@ -340,13 +342,14 @@ typedef struct
Struct: Q931ie_CalledNum
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01110000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR TypNum; /* Type of Number */
L3UCHAR NumPlanID; /* Numbering plan identification */
L3UCHAR Digit[1]; /* Digit (IA5) */
} Q931ie_CalledNum;
/*****************************************************************************
@ -357,13 +360,14 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01110001 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR TypNum; /* Type of subaddress */
L3UCHAR OddEvenInd; /* Odd/Even indicator */
L3UCHAR Digit[1]; /* digits */
} Q931ie_CalledSub;
/*****************************************************************************
@ -374,8 +378,8 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01101100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR TypNum; /* Type of number */
@ -383,6 +387,7 @@ typedef struct
L3UCHAR PresInd; /* Presentation indicator */
L3UCHAR ScreenInd; /* Screening indicator */
L3UCHAR Digit[1]; /* Number digits (IA5) */
} Q931ie_CallingNum;
/*****************************************************************************
@ -393,13 +398,14 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01101101 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR TypNum; /* Type of subaddress */
L3UCHAR OddEvenInd; /* Odd/Even indicator */
L3UCHAR Digit[1]; /* digits */
} Q931ie_CallingSub;
/*****************************************************************************
@ -418,8 +424,8 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00011000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR IntIDPresent; /* Int. id. present */
@ -460,6 +466,7 @@ typedef struct
/* 1001 : H12 channel units */
L3UCHAR ChanSlot; /* Channel number */
} Q931ie_ChanID;
/*****************************************************************************
@ -470,8 +477,8 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00101001 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Year; /* Year */
@ -495,11 +502,12 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00101000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Display[1]; /* Display information (IA5) */
} Q931ie_Display;
/*****************************************************************************
@ -510,8 +518,8 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01111101 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CodStand; /* Coding standard */
@ -520,6 +528,7 @@ typedef struct
L3UCHAR HLCharID; /* High layer characteristics id. */
L3UCHAR EHLCharID; /* Extended high layer character. id. */
L3UCHAR EVideoTlfCharID; /* Ext. videotelephony char. id. */
} Q931ie_HLComp;
/*****************************************************************************
@ -530,11 +539,11 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00101100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR KeypadFac[1]; /* dynamic buffer */
} Q931ie_KeypadFac;
/*****************************************************************************
@ -545,8 +554,8 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01111100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CodStand; /* Coding standard */
@ -750,6 +759,7 @@ typedef struct
L3UCHAR PackWinSize; /* Packet window size */
L3UCHAR AddL3Info; /* Additional Layer 3 protocol info */
} Q931ie_LLComp;
/*****************************************************************************
@ -760,8 +770,8 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00100000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR LenNetID; /* Length of network facilities id. */
@ -769,6 +779,7 @@ typedef struct
L3UCHAR NetIDPlan; /* Network identification plan. */
L3UCHAR NetFac; /* Network specific facility spec. */
L3UCHAR NetID[1]; /* Network id. (IA5) */
} Q931ie_NetFac;
/*****************************************************************************
@ -779,11 +790,12 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00100000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Notification; /* Notification descriptor */
} Q931ie_NotifInd;
/*****************************************************************************
@ -794,13 +806,14 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00011110 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CodStand; /* Coding standard */
L3UCHAR Location; /* Location */
L3UCHAR ProgDesc; /* Progress description */
} Q931ie_ProgInd;
/*****************************************************************************
@ -811,19 +824,22 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00000000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR FSI; /* First segment indicator */
L3UCHAR NumSegRem; /* Number of segments remaining */
L3UCHAR SegType; /* Segment message type */
} Q931ie_Segment;
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00000000 */
L3UCHAR Size; /* Length of Information Element */
} Q931ie_SendComplete;
/*****************************************************************************
@ -834,8 +850,8 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00000000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Signal; /* Signal value */
@ -869,11 +885,12 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00000000 */
L3UCHAR Size; /* Length of Information Element */
L3ULONG TxDSIValue; /* Trans. delay sel. & ind. value */
} Q931ie_TransDelSelInd;
#endif
@ -885,13 +902,14 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01111000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Type; /* Type of network identifier */
L3UCHAR NetIDPlan; /* Network idetification plan */
L3UCHAR NetID[1]; /* Network identification(IA5) */
} Q931ie_TransNetSel;
/*****************************************************************************
@ -902,12 +920,13 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01111110 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR ProtDisc; /* Protocol discriminator */
L3UCHAR User[1]; /* User information */
} Q931ie_UserUser;
/*****************************************************************************
@ -918,12 +937,13 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01000111 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CUGInd; /* CUG indication */
L3UCHAR CUG[1]; /* CUG index code (IA5) */
} Q931ie_ClosedUserGrp;
#endif
@ -934,11 +954,12 @@ typedef struct
Description: Congestion Level
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01000111 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR CongLevel; /* Conguestion Level */
} Q931ie_CongLevel;
/*****************************************************************************
@ -949,13 +970,14 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01000010 */
L3UCHAR Size; /* Length of Information Element */
L3ULONG CumTxDelay; /* Cumulative transit delay value */
L3ULONG ReqTxDelay; /* Requested end to end transit delay */
L3ULONG MaxTxDelay; /* Maximum transit delay */
} Q931ie_EndEndTxDelay;
#endif
@ -967,14 +989,15 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01100000 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR InInfoRate; /* Incoming information rate */
L3UCHAR OutInfoRate; /* Outgoing information rate */
L3UCHAR MinInInfoRate; /* Minimum incoming information rate */
L3UCHAR MinOutInfoRate; /* Minimum outgoing information rate */
} Q931ie_InfoRate;
#endif
@ -986,14 +1009,15 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01000100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR FastSel; /* Fast selected */
L3UCHAR ExpData; /* Exp. data */
L3UCHAR DelConf; /* Delivery conf */
L3UCHAR Modulus; /* Modulus */
} Q931ie_PackParam;
#endif
@ -1005,12 +1029,13 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01000101 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR ForwardValue; /* Forward value */
L3UCHAR BackwardValue; /* Backward value */
} Q931ie_PackWinSize;
#endif
@ -1022,12 +1047,13 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01000110 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR ForwardValue; /* Forward value */
L3UCHAR BackwardValue; /* Backward value */
} Q931ie_PackSize;
#endif
@ -1039,8 +1065,8 @@ typedef struct
*****************************************************************************/
#ifdef Q931_X25_SUPPORT
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01110100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR TypeNum; /* Type of number */
@ -1049,19 +1075,20 @@ typedef struct
L3UCHAR ScreenInd; /* Screening indicator */
L3UCHAR Reason; /* Reason for redirection */
L3UCHAR Digit[1]; /* Number digits (IA5) */
} Q931ie_RedirNum;
#endif
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01110100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR RepeatInd; /* 0010 Prioritized list for selecting */
/* one possible. */
} Q931ie_RepeatInd;
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01110100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Spare; /* Spare */
@ -1071,8 +1098,8 @@ typedef struct
/* 111 All interfaces */
} Q931ie_RestartInd;
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 01110100 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Preference; /* Preference 0 = reserved, 1 = channel */
@ -1090,13 +1117,14 @@ typedef struct
*****************************************************************************/
typedef struct
{
typedef struct {
L3UCHAR IEId; /* 00110111 */
L3UCHAR Size; /* Length of Information Element */
L3UCHAR Type; /* Type of number */
L3UCHAR Encoding; /* Encoding of number */
L3UCHAR Digit[1]; /* Number digits (IA5) */
} Q931ie_GenericDigits;

View File

@ -44,8 +44,7 @@
Description: Message Index used to index a dynamic size Message FIFO.
*****************************************************************************/
typedef struct _mindex
{
typedef struct _mindex {
int offset; /* offset to message in buf */
int size; /* size of message in bytes */
} MINDEX;
@ -58,8 +57,7 @@ typedef struct _mindex
queue.
*****************************************************************************/
typedef struct
{
typedef struct {
int first; /* first out */
int last; /* last in + 1 */
int bsize; /* buffer size */

View File

@ -4,7 +4,6 @@
Contents: Header and definition for the National ISDN dialect. The
header contents the following parts:
- Definition of codes
- Definition of information elements (nationalie_).
- Definition of messages (nationalmes_).
@ -75,15 +74,12 @@ L3INT nationalPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT
#include "DMS.h"
/*****************************************************************************
Q.931 Process Function Prototyping. Implemented in nationalStateTE.c
*****************************************************************************/
void nationalCreateTE(L3UCHAR i);
void nationalCreateNT(L3UCHAR i);

View File

@ -226,28 +226,23 @@ int MFIFOWriteMes(unsigned char *buf, unsigned char *mes, int size)
of = MFIFOGetFBOffset(buf);
ol = MFIFOGetLBOffset(buf);
if(mf->last == mf->first) /* empty queue */
{
if (mf->last == mf->first) { /* empty queue */
mf->first = mf->last = 0; /* optimize */
MFIFOWriteIX(buf, mes, size, mf->first, 0);
return 1;
}
else if(of > ol)
{
if(mf->bsize - of >= size)
{
else if (of > ol) {
if (mf->bsize - of >= size) {
MFIFOWriteIX(buf, mes, size, mf->first, of);
return 1;
}
else if(ol > size)
{
else if (ol > size) {
MFIFOWriteIX(buf, mes, size, mf->first, ol);
return 1;
}
}
else if(ol - of > size)
{
else if (ol - of > size) {
MFIFOWriteIX(buf, mes, size, mf->first, of);
return 1;
}
@ -294,8 +289,7 @@ void MFIFOKillNext(unsigned char *buf)
MFIFO *mf = (MFIFO *)buf;
int x;
if(mf->first != mf->last)
{
if (mf->first != mf->last) {
x = mf->last + 1;
if (x >= mf->ixsize) {
x = 0;
@ -381,28 +375,23 @@ int MFIFOWriteMesOverwrite(unsigned char *buf, unsigned char *mes, int size)
of = MFIFOGetFBOffset(buf);
ol = MFIFOGetLBOffset(buf);
if(mf->last == mf->first) /* empty queue */
{
if (mf->last == mf->first) { /* empty queue */
mf->first = mf->last = 0; /* optimize */
MFIFOWriteIX(buf, mes, size, mf->first, 0);
return 1;
}
else if(of > ol)
{
if(mf->bsize - of >= size)
{
else if (of > ol) {
if (mf->bsize - of >= size) {
MFIFOWriteIX(buf, mes, size, mf->first, of);
return 1;
}
else if(ol > size)
{
else if (ol > size) {
MFIFOWriteIX(buf, mes, size, mf->first, ol);
return 1;
}
}
else if(ol - of > size)
{
else if (ol - of > size) {
MFIFOWriteIX(buf, mes, size, mf->first, of);
return 1;
}

View File

@ -130,9 +130,10 @@ void nationalCreateTE(L3UCHAR i)
Q931SetIEProc(Q931ie_CONNECTED_NUMBER, i, Q931Pie_Generic, Q931Uie_Generic);
Q931SetIEProc(Q931ie_FACILITY, i, Q931Pie_Generic, Q931Uie_Generic);
/* The following define a state machine. The point is that the Message */
/* procs can when search this to find out if the message/state */
/* combination is legale. If not, the proc for unexpected message apply.*/
/* The following define a state machine. The point is that the Message
* procs can when search this to find out if the message/state
* combination is legale. If not, the proc for unexpected message apply.
*/
/* State 0 Idle */
Q931AddStateEntry(i, Q931_U0, Q931mes_RESUME, 2);
@ -213,4 +214,3 @@ void nationalCreateTE(L3UCHAR i)
Q931AddStateEntry(i, Q931_U25,
*/
}

View File

@ -59,8 +59,7 @@ L3INT nationalUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generi
L3UCHAR last_codeset = 0, codeset = 0;
L3UCHAR shift_lock = 1;
while(IOff < Size)
{
while (IOff < Size) {
if (!shift_lock) {
codeset = last_codeset;
}
@ -75,8 +74,7 @@ L3INT nationalUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generi
}
if (codeset == 0) {
switch(IBuf[IOff])
{
switch (IBuf[IOff]) {
case Q931ie_SENDING_COMPLETE:
case Q931ie_BEARER_CAPABILITY:
case Q931ie_CHANNEL_IDENTIFICATION:
@ -110,8 +108,7 @@ L3INT nationalUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generi
break;
}
} else if (codeset == 6) {
switch(IBuf[IOff])
{
switch (IBuf[IOff]) {
case Q931ie_GENERIC_DIGITS:
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
if (rc != Q931E_NO_ERROR)
@ -158,101 +155,113 @@ L3INT nationalPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT
Q931MesgHeader(pTrunk, pMes, OBuf, *OSize, &Octet);
/* Sending Complete */
if(Q931IsIEPresent(pMes->SendComplete))
if (Q931IsIEPresent(pMes->SendComplete)) {
OBuf[Octet++] = (L3UCHAR)(pMes->SendComplete & 0x00ff);
}
/* Repeat Indicator */
if(Q931IsIEPresent(pMes->RepeatInd))
if (Q931IsIEPresent(pMes->RepeatInd)) {
OBuf[Octet++] = (L3UCHAR)(pMes->RepeatInd & 0x00ff);
}
/* Bearer capability */
if(Q931IsIEPresent(pMes->BearerCap))
{
if (Q931IsIEPresent(pMes->BearerCap)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_BEARER_CAPABILITY](pTrunk, Q931GetIEPtr(pMes->BearerCap,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
else
{
else {
rc = Q931E_BEARERCAP;
}
/* Channel Identification */
if(Q931IsIEPresent(pMes->ChanID))
if (Q931IsIEPresent(pMes->ChanID)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CHANNEL_IDENTIFICATION](pTrunk, Q931GetIEPtr(pMes->ChanID,pMes->buf), OBuf, &Octet)) != 0)
return rc;
/* Progress indicator */
if(Q931IsIEPresent(pMes->ProgInd))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_PROGRESS_INDICATOR](pTrunk, Q931GetIEPtr(pMes->ProgInd,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Network spesific facilities */
if(Q931IsIEPresent(pMes->NetFac))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_NETWORK_SPECIFIC_FACILITIES](pTrunk, Q931GetIEPtr(pMes->NetFac,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Display */
if(Q931IsIEPresent(pMes->Display))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_DISPLAY](pTrunk, Q931GetIEPtr(pMes->Display,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Date/Time */
if(Q931IsIEPresent(pMes->DateTime))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_DATETIME](pTrunk, Q931GetIEPtr(pMes->DateTime,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Keypad Facility */
if(Q931IsIEPresent(pMes->KeypadFac))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_KEYPAD_FACILITY](pTrunk, Q931GetIEPtr(pMes->KeypadFac,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Signal */
if(Q931IsIEPresent(pMes->Signal))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_SIGNAL](pTrunk, Q931GetIEPtr(pMes->Signal,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Calling Party Number */
if(Q931IsIEPresent(pMes->CallingNum))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CallingNum,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Calling Party Subaddress */
if(Q931IsIEPresent(pMes->CallingSub))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CallingSub,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Called Party number */
if(Q931IsIEPresent(pMes->CalledNum))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CalledNum,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Called party subaddress */
if(Q931IsIEPresent(pMes->CalledSub))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CalledSub,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Transit network selection */
if(Q931IsIEPresent(pMes->TransNetSel))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_TRANSIT_NETWORK_SELECTION](pTrunk, Q931GetIEPtr(pMes->TransNetSel,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* Repeat Indicator */
if(Q931IsIEPresent(pMes->LLRepeatInd))
rc = Q931E_UNKNOWN_IE;/* TODO */
/* Low Layer Compatibility */
if(Q931IsIEPresent(pMes->LLComp))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_LOW_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->LLComp,pMes->buf), OBuf, &Octet))!=0)
return rc;
/* High Layer Compatibility */
if(Q931IsIEPresent(pMes->HLComp))
if((rc=Q931Pie[pTrunk->Dialect][Q931ie_HIGH_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->HLComp,pMes->buf), OBuf, &Octet))!=0)
return rc;
*OSize = Octet;
return rc;
}
/* Progress indicator */
if (Q931IsIEPresent(pMes->ProgInd)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_PROGRESS_INDICATOR](pTrunk, Q931GetIEPtr(pMes->ProgInd,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Network spesific facilities */
if (Q931IsIEPresent(pMes->NetFac)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_NETWORK_SPECIFIC_FACILITIES](pTrunk, Q931GetIEPtr(pMes->NetFac,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Display */
if (Q931IsIEPresent(pMes->Display)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_DISPLAY](pTrunk, Q931GetIEPtr(pMes->Display,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Date/Time */
if (Q931IsIEPresent(pMes->DateTime)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_DATETIME](pTrunk, Q931GetIEPtr(pMes->DateTime,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Keypad Facility */
if (Q931IsIEPresent(pMes->KeypadFac)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_KEYPAD_FACILITY](pTrunk, Q931GetIEPtr(pMes->KeypadFac,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Signal */
if (Q931IsIEPresent(pMes->Signal)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_SIGNAL](pTrunk, Q931GetIEPtr(pMes->Signal,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Calling Party Number */
if (Q931IsIEPresent(pMes->CallingNum)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CallingNum,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Calling Party Subaddress */
if (Q931IsIEPresent(pMes->CallingSub)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLING_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CallingSub,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Called Party number */
if (Q931IsIEPresent(pMes->CalledNum)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_NUMBER](pTrunk, Q931GetIEPtr(pMes->CalledNum,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Called party subaddress */
if (Q931IsIEPresent(pMes->CalledSub)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_CALLED_PARTY_SUBADDRESS](pTrunk, Q931GetIEPtr(pMes->CalledSub,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Transit network selection */
if (Q931IsIEPresent(pMes->TransNetSel)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_TRANSIT_NETWORK_SELECTION](pTrunk, Q931GetIEPtr(pMes->TransNetSel,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* Repeat Indicator */
if (Q931IsIEPresent(pMes->LLRepeatInd)) {
rc = Q931E_UNKNOWN_IE;/* TODO */
}
/* Low Layer Compatibility */
if (Q931IsIEPresent(pMes->LLComp)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_LOW_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->LLComp,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
/* High Layer Compatibility */
if (Q931IsIEPresent(pMes->HLComp)) {
if ((rc = Q931Pie[pTrunk->Dialect][Q931ie_HIGH_LAYER_COMPATIBILITY](pTrunk, Q931GetIEPtr(pMes->HLComp,pMes->buf), OBuf, &Octet)) != 0)
return rc;
}
*OSize = Octet;
return rc;
}