bedweather / jss7

Automatically exported from code.google.com/p/jss7
0 stars 0 forks source link

MAP: MAPDialogState=INITIAL_RECEIVED not handled correctly #333

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version: 2.0.0.FINAL

When sending a TC-CONTINUE to another SMSC after TC-BEGIN, the other SMSC sent 
TC-CONTINUE with a forwardSM in it. But the MAP stack failed with:

Received TC-CONTINUE. MAPDialog=MAPDialog: LocalDialogId=13 
RemoteDialogId=138228317 MAPDialogState=INITIAL_RECEIVED 
MAPApplicationContext=MAPApplicationContext [Name=shortMsgMTRelayContext, 
Version=version2, Oid=0, 4, 0, 0, 1, 0, 25, 2, ] TCAPDialogState=Active. But 
state is neither InitialSent or Active

As can be seen, the status is actually INITIAL_RECEIVED, which I believe is a 
valid state, but in the statement logging the error it is not handled:

In MAPProviderImpl.onTCContinue(TCContinueIndication tcContinueIndication):

// Now let us decode the Components
if (mapDialogImpl.getState() == MAPDialogState.InitialSent 
|| mapDialogImpl.getState() == MAPDialogState.Active) {
[...]
} else {
// This should never happen
loger.error(String.format("Received TC-CONTINUE. MAPDialog=%s. But state is 
neither InitialSent or Active",mapDialogImpl));
}

I believe this should be changed to:

// Now let us decode the Components
if (mapDialogImpl.getState() == MAPDialogState.INITIAL_SENT
  || mapDialogImpl.getState() == MAPDialogState.INITIAL_RECEIVED
  || mapDialogImpl.getState() == MAPDialogState.ACTIVE) {
[...]
} else {
  // This should never happen
  loger.error(String.format("Received TC-CONTINUE. MAPDialog=%s. But state is neither InitialSent, InitialReceived or Active",
  mapDialogImpl));
}

I've tested this patch myself and I now receive the SMS properly.

Kind regards,
Matthias van der Vlies

Original issue reported on code.google.com by mvdvl...@gmail.com on 20 Jun 2014 at 1:51