diff --git a/libs/openzap/src/isdn/Q931.c b/libs/openzap/src/isdn/Q931.c index 9b9b6331bd..b29bcf97dd 100644 --- a/libs/openzap/src/isdn/Q931.c +++ b/libs/openzap/src/isdn/Q931.c @@ -368,6 +368,9 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3INT ind, L3UCHAR tei, L3UCHAR * buf, /* Message Type */ m->MesType = Mes[IOff++]; + /* Store tei */ + m->Tei = tei; + /* d'oh a little ugly but this saves us from: * a) doing Q.921 work in the lower levels (extracting the TEI ourselves) * 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); RetCode = Q931Umes[pTrunk->Dialect][m->MesType](pTrunk, Mes, (Q931mes_Generic *)pTrunk->L3Buf, IOff, Size - L2HSize); diff --git a/libs/openzap/src/isdn/Q931StateNT.c b/libs/openzap/src/isdn/Q931StateNT.c index 5b8b0860b4..71f2e6e836 100644 --- a/libs/openzap/src/isdn/Q931StateNT.c +++ b/libs/openzap/src/isdn/Q931StateNT.c @@ -345,6 +345,9 @@ L3INT Q931ProcSetupNT(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom) return ret; } + /* store TEI in call */ + pTrunk->call[callIndex].Tei = pMes->Tei; + /* Send setup indication to user */ ret = Q931Tx34(pTrunk, (L3UCHAR*)pMes, pMes->Size); if (ret != Q931E_NO_ERROR) { diff --git a/libs/openzap/src/isdn/include/Q931.h b/libs/openzap/src/isdn/include/Q931.h index 110682d4d3..e05c7e9dce 100644 --- a/libs/openzap/src/isdn/include/Q931.h +++ b/libs/openzap/src/isdn/include/Q931.h @@ -559,11 +559,11 @@ typedef struct { provided in case a proprietary variant needs it. *****************************************************************************/ -typedef struct -{ +typedef struct { L3UINT Size; /* Size of message in bytes */ L3UCHAR ProtDisc; /* Protocol Discriminator */ L3UCHAR MesType; /* Message type */ + L3UCHAR Tei; /* TEI */ L3UCHAR CRVFlag; /* Call reference value flag */ L3INT CRV; /* Call reference value */