Fix encoding of the Channel ID IE

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@516 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Stefan Knoblich 2008-08-28 15:50:26 +00:00
parent be6eb554a7
commit 584880af5b
1 changed files with 17 additions and 19 deletions

View File

@ -1288,28 +1288,26 @@ L3INT Q931Pie_ChanID(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, L3UCHAR *OBuf, L3I
{ {
OBuf[(*Octet)++] = 0x80 | (pIE->InterfaceID & 0x7f); OBuf[(*Octet)++] = 0x80 | (pIE->InterfaceID & 0x7f);
} }
else
/* Octet 3.2 & 3.3 - PRI */
if(pIE->IntType)
{ {
/* Octet 3.2 & 3.3 - PRI */ OBuf[(*Octet)++] = 0x80
if(pIE->IntType == 1) | ((pIE->CodStand << 5) & 0x60)
{ | ((pIE->NumMap << 4) & 0x10)
OBuf[(*Octet)++] = 0x80 | (pIE->ChanMapType & 0x0f); /* TODO: support all possible channel map types */
| ((pIE->CodStand << 5) & 0x60)
| ((pIE->NumMap << 4) & 0x10)
| (pIE->ChanMapType & 0x0f); /* TODO: support all possible channel map types */
/* Octet 3.3 Channel number */ /* Octet 3.3 Channel number */
switch(pIE->ChanMapType) { switch(pIE->ChanMapType) {
case 0x6: /* Slot map: H0 Channel Units */ /* unsupported, Octets 3.3.1 - 3.3.3 */ case 0x6: /* Slot map: H0 Channel Units */ /* unsupported, Octets 3.3.1 - 3.3.3 */
return Q931E_CHANID; return Q931E_CHANID;
case 0x8: /* Slot map: H11 Channel Units */ case 0x8: /* Slot map: H11 Channel Units */
case 0x9: /* Slot map: H12 Channel Units */ case 0x9: /* Slot map: H12 Channel Units */
default: /* Channel number */ default: /* Channel number */
OBuf[(*Octet)++] = 0x80 | (pIE->ChanSlot & 0x7f); OBuf[(*Octet)++] = 0x80 | (pIE->ChanSlot & 0x7f);
break; break;
} }
}
} }
OBuf[li] = (L3UCHAR)((*Octet)-Beg) - 2; OBuf[li] = (L3UCHAR)((*Octet)-Beg) - 2;