Fix Q931Uie_UserUser() (broken length handling, IEs always only specify the length of attached data, excluding id and length field!) and allow User-User IE in incoming SETUP, ALERTING, CONNECT, DISCONNECT, RELEASE and RELEASE COMPLETE
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@753 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
e4b834b7a2
commit
56f9cfccd3
|
@ -2813,7 +2813,6 @@ L3INT Q931Uie_UserUser(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3UCHAR
|
|||
ie *pIE = &pMsg->UserUser;
|
||||
L3INT Off = 0;
|
||||
L3INT Octet = 0;
|
||||
L3INT x = 0;
|
||||
L3INT l;
|
||||
|
||||
*pIE = 0;
|
||||
|
@ -2821,22 +2820,20 @@ L3INT Q931Uie_UserUser(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3UCHAR
|
|||
pie->IEId = IBuf[Octet++];
|
||||
|
||||
/* Octet 2 */
|
||||
l = IBuf[Octet++] - 3;
|
||||
l = IBuf[Octet++] - 1;
|
||||
|
||||
/* Octet 3 */
|
||||
pie->ProtDisc = IBuf[Octet + Off];
|
||||
Octet++;
|
||||
pie->ProtDisc = IBuf[Octet++];
|
||||
|
||||
for (x = 0; x < l; x++) {
|
||||
pie->User[x] = IBuf[Octet + Off];
|
||||
Off++;
|
||||
for (Off = 0; Off < l; Off++) {
|
||||
pie->User[Off] = IBuf[Octet + Off];
|
||||
}
|
||||
|
||||
Q931SetIE(*pIE, *OOff);
|
||||
|
||||
*IOff = (*IOff) + Octet + Off;
|
||||
*OOff = (*OOff) + sizeof(Q931ie_UserUser) + x - 1;
|
||||
pie->Size = (L3UCHAR)(sizeof(Q931ie_UserUser) + x - 1);
|
||||
*OOff = (*OOff) + sizeof(Q931ie_UserUser) + Off - 1;
|
||||
pie->Size = (L3UCHAR)(sizeof(Q931ie_UserUser) + Off - 1);
|
||||
|
||||
return Q931E_NO_ERROR;
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ L3INT Q931Umes_Alerting(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic
|
|||
case Q931ie_DISPLAY:
|
||||
case Q931ie_SIGNAL:
|
||||
case Q931ie_HIGH_LAYER_COMPATIBILITY:
|
||||
case Q931ie_USER_USER:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
|
@ -289,6 +290,7 @@ L3INT Q931Umes_Connect(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic
|
|||
case Q931ie_LOW_LAYER_COMPATIBILITY:
|
||||
case Q931ie_HIGH_LAYER_COMPATIBILITY:
|
||||
case Q931ie_CONNECTED_NUMBER: /* not actually used, seen while testing BRI PTMP TE */
|
||||
case Q931ie_USER_USER:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
|
@ -448,6 +450,7 @@ L3INT Q931Umes_Disconnect(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Gener
|
|||
case Q931ie_DISPLAY:
|
||||
case Q931ie_SIGNAL:
|
||||
case Q931ie_FACILITY:
|
||||
case Q931ie_USER_USER:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
|
@ -734,6 +737,7 @@ L3INT Q931Umes_Release(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic
|
|||
case Q931ie_CAUSE:
|
||||
case Q931ie_DISPLAY:
|
||||
case Q931ie_SIGNAL:
|
||||
case Q931ie_USER_USER:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
|
@ -799,6 +803,7 @@ L3INT Q931Umes_ReleaseComplete(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_
|
|||
case Q931ie_CAUSE:
|
||||
case Q931ie_DISPLAY:
|
||||
case Q931ie_SIGNAL:
|
||||
case Q931ie_USER_USER:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
|
@ -1197,6 +1202,7 @@ L3INT Q931Umes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *m
|
|||
case Q931ie_LOW_LAYER_COMPATIBILITY:
|
||||
case Q931ie_HIGH_LAYER_COMPATIBILITY:
|
||||
case Q931ie_FACILITY:
|
||||
case Q931ie_USER_USER:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
|
|
Loading…
Reference in New Issue