Open coolbeevip opened 3 years ago
That looks OK to me.
Thank you, I have verified and solved this issue. Do you accept PR or I should just go ahead and fork it?
I will refactor it, so it will fully support SMPP 3.3. You can fork it for now.
I noticed that PR[1] tried to solve this problem, But it looks not finished yet.
Personally, I think to define setInterfaceVersion() method in SMPPSessionState
public interface SMPPSessionState extends GenericSMPPSessionState {
// add interface
void setInterfaceVersion(final InterfaceVersion interfaceVersion);
And, Set interface version in the changeState() method
public class SMPPSessionContext extends AbstractSessionContext {
@Override
protected void changeState(SessionState newState) {
if (!stateProcessor.getSessionState().equals(newState)) {
final SessionState oldState = stateProcessor.getSessionState();
...
} else if (newState == SessionState.BOUND_TX) {
stateProcessor = SMPPSessionState.BOUND_TX;
// set interface version
stateProcessor.setInterfaceVersion(this.getInterfaceVersion());
} else if (newState == SessionState.BOUND_TRX) {
...
}
}
}
I have SMSC devices that only support SMPP 3.3 protocol, But it will randomly send deliver_sm through TX or RX.
I want to be compatible with it. I found the following method
https://github.com/opentelecoms-org/jsmpp/blob/c7599e5d2fc62892b92e009da15337bb70f2c8af/jsmpp/src/main/java/org/jsmpp/session/state/SMPPSessionBoundTX.java#L146
I modify the method like :
Is that correct?