opentelecoms-org / jsmpp

SMPP implemented in Java
Apache License 2.0
232 stars 164 forks source link

Receive negative bind response: Negative response 00000005 found #180

Open ilkin opened 2 years ago

ilkin commented 2 years ago

Sometimes we retrieve the below exception during reconnection and only works after restarting the application:

Session state is CLOSED. Trying reconnect... 
Trying disconnect ... 
Disconnected...
Waiting 1 seconds to retry
java.io.IOException: Receive negative bind response: Negative response 00000005 found
    at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:246)
    at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:160)

We are using jsmpp-2.2.0 and some options are

bindType = BindType.BIND_TX
enquireLinkTimer=10000
transactionTimer=20000L

Our reconnection conditions like below:

if (smppSession.getSessionState() == SessionState.CLOSED 
     || smppSession.getSessionState() == SessionState.OUTBOUND
     || smppSession.getSessionState() == SessionState.UNBOUND) {
    //smppSession.unbindAndClose then smppSession.connectAndBind
    reconnect();
}

In smpp3.4 specification written ESME_RALYBND, 0x00000005, ESME Already in Bound State

How can we resolve this problem, and what is the reason? Please help

pmoerenhout commented 1 year ago

Hi, you are using a pretty old version of the jSMPP Java library. Could you retest with 2.3.11 ?

When the other part responds with 'Already bound', it could be that you didn't close the session (and thus the TCP connection). What would help is to make a tcpdump trace, and see that the bind is send on new TCP connection.