/* Starting Codeset */
m->codeset = Q931_CODESET_0;
+ if (m->ProtDisc != 8) {
+ return Q931E_UNKNOWN_MESSAGE;
+ }
+
/* Call table proc to unpack codec message */
RetCode = Q931Umes[pTrunk->Dialect][m->MesType](pTrunk, Mes, (Q931mes_Generic *)pTrunk->L3Buf, Q931L4HeaderSpace + IOff , Size - Q931L4HeaderSpace - IOff + 1);
L3INT x;
for(x=0; x < Q931MAXCALLPERTRUNK; x++)
{
- if(!pTrunk->call[x].InUse)
+ if(pTrunk->call[x].InUse)
{
if(pTrunk->call[x].CRV == iCRV)
{
L3INT x;
for(x=0; x < Q931MAXCALLPERTRUNK; x++)
{
- if(!pTrunk->call[x].InUse)
+ if(pTrunk->call[x].InUse)
{
if(pTrunk->call[x].CRV == crv)
{
L3INT ret=Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
- /* Find the call using CRV */
- ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
- if(ret != Q931E_NO_ERROR)
- return ret;
+
+ if (pMes->CRV) {
+ /* Find the call using CRV */
+ ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
+ if(ret != Q931E_NO_ERROR)
+ return ret;
+
+ /* TODO - Set correct timer here */
+ Q931StartTimer(pTrunk, callIndex, 303);
+ }
/* TODO chack against state table for illegal or unexpected message here*/
- /* TODO - Set correct timer here */
- Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
/* TODO Add proc here*/
L3INT ret=Q931E_NO_ERROR;
Q931mes_Header *pMes = (Q931mes_Header *)&buf[Q931L4HeaderSpace];
- /* Find the call using CRV */
- ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
- if(ret != Q931E_NO_ERROR)
- return ret;
+ if (pMes->CRV) {
+ /* Find the call using CRV */
+ ret = Q931FindCRV(pTrunk, pMes->CRV, &callIndex);
+ if(ret != Q931E_NO_ERROR)
+ return ret;
+ /* TODO - Set correct timer here */
+ Q931StartTimer(pTrunk, callIndex, 303);
+ }
/* TODO chack against state table for illegal or unexpected message here*/
- /* TODO - Set correct timer here */
- Q931StartTimer(pTrunk, callIndex, 303);
if(iFrom == 4)
{
/* TODO Add proc here*/