[Q.931] Save TEI from incoming SETUP message in call struct + make the TEI available in all incoming messages

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@538 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Stefan Knoblich 2008-09-06 20:28:50 +00:00
parent 416f8e58b2
commit 8e25e1ef36
3 changed files with 9 additions and 3 deletions

View File

@ -368,6 +368,9 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3INT ind, L3UCHAR tei, L3UCHAR * buf,
/* Message Type */ /* Message Type */
m->MesType = Mes[IOff++]; m->MesType = Mes[IOff++];
/* Store tei */
m->Tei = tei;
/* d'oh a little ugly but this saves us from: /* d'oh a little ugly but this saves us from:
* a) doing Q.921 work in the lower levels (extracting the TEI ourselves) * a) doing Q.921 work in the lower levels (extracting the TEI ourselves)
* b) adding a tei parameter to _all_ Proc functions * b) adding a tei parameter to _all_ Proc functions
@ -382,7 +385,7 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3INT ind, L3UCHAR tei, L3UCHAR * buf,
} }
} }
Q931Log(pTrunk, Q931_LOG_DEBUG, "Received message from Q.921 (ind %d, tei %d, size %d)\nMesType: %d, CRVFlag %d (%s), CRV %d (Dialect: %d)\n", ind, tei, Size, Q931Log(pTrunk, Q931_LOG_DEBUG, "Received message from Q.921 (ind %d, tei %d, size %d)\nMesType: %d, CRVFlag %d (%s), CRV %d (Dialect: %d)\n", ind, m->Tei, Size,
m->MesType, m->CRVFlag, m->CRVFlag ? "Terminator" : "Originator", m->CRV, pTrunk->Dialect); 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); RetCode = Q931Umes[pTrunk->Dialect][m->MesType](pTrunk, Mes, (Q931mes_Generic *)pTrunk->L3Buf, IOff, Size - L2HSize);

View File

@ -345,6 +345,9 @@ L3INT Q931ProcSetupNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom)
return ret; return ret;
} }
/* store TEI in call */
pTrunk->call[callIndex].Tei = pMes->Tei;
/* Send setup indication to user */ /* Send setup indication to user */
ret = Q931Tx34(pTrunk, (L3UCHAR*)pMes, pMes->Size); ret = Q931Tx34(pTrunk, (L3UCHAR*)pMes, pMes->Size);
if (ret != Q931E_NO_ERROR) { if (ret != Q931E_NO_ERROR) {

View File

@ -559,11 +559,11 @@ typedef struct {
provided in case a proprietary variant needs it. provided in case a proprietary variant needs it.
*****************************************************************************/ *****************************************************************************/
typedef struct typedef struct {
{
L3UINT Size; /* Size of message in bytes */ L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */ L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */ L3UCHAR MesType; /* Message type */
L3UCHAR Tei; /* TEI */
L3UCHAR CRVFlag; /* Call reference value flag */ L3UCHAR CRVFlag; /* Call reference value flag */
L3INT CRV; /* Call reference value */ L3INT CRV; /* Call reference value */