Code Monkey home page Code Monkey logo

jsmpp's Introduction

Introduction

Maven Central

jSMPP is a java implementation (SMPP API) of the SMPP protocol (currently supports SMPP v3.3, v3.4 and v5.0). It provides interfaces to communicate with a Message Center or an ESME (External Short Message Entity) and is able to handle traffic of 3000-5000 messages per second.

jSMPP is not a high-level library. People looking for a quick way to get started with SMPP may be better of using an abstraction layer such as the Apache Camel SMPP component Apache Camel SMPP component

Travis-CI status:

Build Status

History

The project started on Google Code: http://code.google.com/p/jsmpp/

It was maintained by uudashr on GitHub until 2013.

It is now a community project maintained at https://jsmpp.org

Release procedure

mvn deploy -DperformRelease=true -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -Dgpg.passphrase=\<yourpassphrase\>
  • log in here: https://oss.sonatype.org
  • click the 'Staging Repositories' link
  • select the repository and click close
  • select the repository and click release

License

Copyright (C) 2007-2013, Nuruddin Ashr [email protected] Copyright (C) 2012-2013, Denis Kostousov [email protected] Copyright (C) 2014, Daniel Pocock http://danielpocock.com Copyright (C) 2016-2024, Pim Moerenhout [email protected]

This project is licensed under the Apache Software License 2.0.

jsmpp's People

Contributors

aabiabdallah avatar assens avatar coolbeevip avatar crocarneiro avatar dependabot[bot] avatar der-ambi avatar dpocock avatar engin avatar georgekankava avatar ihrigb avatar jeonghuncha avatar kostousov-ds avatar mykolap avatar pascalschumacher avatar pmoerenhout avatar pruh avatar rprevot avatar sana167 avatar scop avatar terukizm avatar tomasmorecom avatar uudashr avatar vivekanandasofware avatar vkosharskyi avatar willemjiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsmpp's Issues

SMPPSession sendBind causes null array length error

On Line 297 in the sendBind method. OptionalParameters seems to causes the connectAndBind method to break (as it is not declared and sendBind is called internally to this method). I commented this out this line and it is working fine. It did not seem like it would effect the system in any way. Let me know if I am wrong though.

Build problem

I'm trying to execute this example.
I get this erreur
I'm not familiar with SMPP
can any one help me
Regards.
[ERROR] Failed to execute goal on project jsmpp-examples: Could not resolve dependencies for project org.jsmpp:jsmpp-examples:jar:2.2.0-SNAPSHOT: Could not find artifact org.jsmpp:jsmpp:jar:2.2.0-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

JVM Deadlock

At random times we get deadlocks. The jstack is showing this:

"pool-15-thread-4":
waiting to lock Monitor@0x00007fd4cc0bc4b8 (Object@0x000000044b81fc90, a mobi/coolsigns/sms/proxy/service/gateway/embedded/smpp/session/SMPPSessionCustom),
which is held by "PDUReaderWorker: mobi.coolsigns.sms.proxy.service.gateway.embedded.smpp.session.SMPPSessionCustom@454fd63"
"PDUReaderWorker: mobi.coolsigns.sms.proxy.service.gateway.embedded.smpp.session.SMPPSessionCustom@454fd63":
waiting for ownable synchronizer 0x000000042de26f70, (a java/util/concurrent/locks/ReentrantLock$NonfairSync),
which is held by "pool-15-thread-4"

The SMPPSessionCustom is nothing fancy just an extension of the original Class that returns the SMPPResultResp and not only the Id.

`public class SMPPSessionCustom extends SMPPSession {
private static final AtomicReference currentTime = new AtomicReference<>(System.currentTimeMillis());

private final ConnectionProperties connectionProperties;
private final int timeout;
private final long id;

public SMPPSessionCustom(ConnectionProperties connectionProperties) {
	super();
	this.connectionProperties = connectionProperties;
	this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
	this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
			(prev, next) -> next > prev ? next : prev + 1);
}

public SMPPSessionCustom(PDUSender pduSender, PDUReader pduReader, ConnectionFactory connFactory,
		ConnectionProperties connectionProperties) {
	super(pduSender, pduReader, connFactory);
	this.connectionProperties = connectionProperties;
	this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
	this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
			(prev, next) -> next > prev ? next : prev + 1);
}

public SMPPSessionCustom(String host, int port, BindParameter bindParam, PDUSender pduSender, PDUReader pduReader,
		ConnectionFactory connFactory, ConnectionProperties connectionProperties) throws IOException {
	super(host, port, bindParam, pduSender, pduReader, connFactory);
	this.connectionProperties = connectionProperties;
	this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
	this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
			(prev, next) -> next > prev ? next : prev + 1);

}

public SMPPSessionCustom(String host, int port, BindParameter bindParam, ConnectionProperties connectionProperties)
		throws IOException {
	super(host, port, bindParam);
	this.connectionProperties = connectionProperties;
	this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
	this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
			(prev, next) -> next > prev ? next : prev + 1);

}

public SubmitSmResp submitShortMessageGetResp(String serviceType, TypeOfNumber sourceAddrTon,
		NumberingPlanIndicator sourceAddrNpi, String sourceAddr, TypeOfNumber destAddrTon,
		NumberingPlanIndicator destAddrNpi, String destinationAddr, ESMClass esmClass, byte protocolId,
		byte priorityFlag, String scheduleDeliveryTime, String validityPeriod,
		RegisteredDelivery registeredDelivery, byte replaceIfPresentFlag, DataCoding dataCoding,
		byte smDefaultMsgId, byte[] shortMessage, OptionalParameter... optionalParameters) throws PDUException,
		ResponseTimeoutException, InvalidResponseException, NegativeResponseException, IOException {

	ensureTransmittable("submitShortMessage");

	SubmitSmCommandTask submitSmTask = new SubmitSmCommandTask(pduSender(), serviceType, sourceAddrTon,
			sourceAddrNpi, sourceAddr, destAddrTon, destAddrNpi, destinationAddr, esmClass, protocolId,
			priorityFlag, scheduleDeliveryTime, validityPeriod, registeredDelivery, replaceIfPresentFlag,
			dataCoding, smDefaultMsgId, shortMessage, optionalParameters);

	SubmitSmResp resp = (SubmitSmResp) executeSendCommand(submitSmTask, timeout);
	return resp;
}

public long getId() {
	return id;
}

}`

It affected both the last and the previous releases of JSMPP. Have not tried with previous ones lately. When I was using the 0.2.2 did not have this but i have not confirmed lately.

About the ResponseTimeoutException

Dear:

No response after waiting for 2000 millis when executing unbind with sessionId cd173506 and sequenceNumber

this is the exception when session.unbindAndClose(). Plase tell how to resolve this problem ,I didn't find how to set the waiting for unbindAndClose()

Failed getting delivery receipt containing extended final message states

Specifically, Mblox extends the final message states (see Table B-2 in Appendix B of the SMPP 3.4 spec) with the following...
BUFFRED
ACKED
FAILED
https://my.mblox.com/docs/sms.html#smpp-acceptance-status-codes

Failed getting delivery receipt
org.jsmpp.util.InvalidDeliveryReceiptException: There is an error found when parsing delivery receipt
        at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:80)
        at org.jsmpp.util.DefaultDecomposer.deliveryReceipt(DefaultDecomposer.java:394)
        at org.jsmpp.util.DefaultDecomposer.deliveryReceipt(DefaultDecomposer.java:404)
        at org.jsmpp.bean.DefaultDeliveryReceiptStripper.strip(DefaultDeliveryReceiptStripper.java:36)
        at org.jsmpp.bean.DefaultDeliveryReceiptStripper.strip(DefaultDeliveryReceiptStripper.java:27)
        at org.jsmpp.bean.DeliverSm.getDeliveryReceipt(DeliverSm.java:53)
        at org.jsmpp.bean.DeliverSm.getShortMessageAsDeliveryReceipt(DeliverSm.java:40)
        at com.slooce.smpp.SlooceSMPPSession$1.onAcceptDeliverSm(SlooceSMPPSession.java:80)
        at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:461)
        at org.jsmpp.session.SMPPSession.access$200(SMPPSession.java:94)
        at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:480)
        at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109)
        at org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42)
        at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:90)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: No enum constant org.jsmpp.util.DeliveryReceiptState.FAILED
        at java.lang.Enum.valueOf(Enum.java:238)
        at org.jsmpp.util.DeliveryReceiptState.getByName(DeliveryReceiptState.java:60)
        at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:75)
        ... 16 more

My only workaround today is to pull the source and add them to DeliveryReceiptState.java:

$ git diff jsmpp/src/main/java/org/jsmpp/util/DeliveryReceiptState.java
diff --git a/jsmpp/src/main/java/org/jsmpp/util/DeliveryReceiptState.java b/jsmpp/src/main/java/org/jsmpp/util/DeliveryReceiptState.java
index accab45..54e6a35 100644
--- a/jsmpp/src/main/java/org/jsmpp/util/DeliveryReceiptState.java
+++ b/jsmpp/src/main/java/org/jsmpp/util/DeliveryReceiptState.java
@@ -48,7 +48,24 @@ public enum DeliveryReceiptState {
     /**
      * REJECTED
      */
-    REJECTD(7);
+    REJECTD(7),
+
+
+
+    /**
+     * BUFFERED BY MBLOX
+     */
+    BUFFRED(8),
+    /**
+     * ACKNOWLEDGED BY MBLOX
+     */
+    ACKED(9),
+    /**
+     * FAILED BY MBLOX
+     */
+    FAILED(10),
+
+    ;

     private int value;


Exception when receive long message

Hello Sir,

I have using your lib, when I receive the long message it's throw Exception like:

Exception in thread "pool-2-thread-3" java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.jsmpp.util.SequentialBytesReader.readBytes(SequentialBytesReader.java:80)
at org.jsmpp.util.DefaultDecomposer.readOptionalParameters(DefaultDecomposer.java:625)
at org.jsmpp.util.DefaultDecomposer.deliverSm(DefaultDecomposer.java:368)
at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:108)
at org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42)
at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

How I resolved it?

Thanks,

SMPP Data Coding Scheme: Unknown (0x11)

Hi,

Looks like, that when sending SMS SMPP Data Coding Scheme is set to Unknown (0x11)

session.submitShortMessage is called with new GeneralDataCoding(ALPHA_DEFAULT, CLASS1, false)

GSM SMS Data Coding is set ok

From wireshark trace:

Data coding: 0x11
SMPP Data Coding Scheme: Unknown (0x11)
GSM SMS Data Coding
0001 .... = DCS Coding Group for SMS: SMS DCS: General Data Coding indication - Uncompressed text (0x01)
..0. .... = DCS Text compression: Uncompressed text
...1 .... = DCS Class present: Message class is present
.... 00.. = DCS Character set: GSM 7-bit default alphabet (0x00)
.... ..01 = DCS Message class: Class 1 - ME specific (0x01)
GSM CBS Data Coding
0001 .... = DCS Coding Group for CBS: CBS DCS: Language indication at beginning of message (0x01)
..01 0001 = DCS CBS Message language: UCS-2 (16-bit) - message preceded by language indication (0x11)

Default deserialization of optional parameter

Currently if the tag of optional parameter is not recognized, jsmpp treats it as a COctetString (https://github.com/opentelecoms-org/jsmpp/blob/master/jsmpp/src/main/java/org/jsmpp/bean/OptionalParameters.java#L109). This leads to losing last one byte of the data (since COctetString should be terminated by NULL).
We have a use case where the SMSC sends a value of type short in custom optional parameter. Since jsmpp treats it as a COctetString, we end up losing one byte information.
In my opinion, we should by default treat the returned value as OctetString or add a check if the last character is null and then only parse it as a COctetString.
I can submit a patch after knowing your opinions.

Aboult messageId

Hi,
I don't want to use the message id generated by smsc. can i custom an message id passed to smsc via MT and get this custom message id through the delivery receipt. which parameter can i use?

Please release 2.2.4 with osgi fix

Hi,

it would be nice if you could release 2.2.4 with the fix: bc6207c which makes jsmpp work with osgi.

This would allow Apache Camel to directly use the jsmpp osgi bundle instead of repackaging it.

Thanks,
Pascal

Password length bug?

If I try to use a nine character password I get:

org.jsmpp.PDUStringException: C-Octet String value '123456789' length must be less than 9. Actual length is 9
              at org.jsmpp.util.StringValidator.validateString(StringValidator.java:40) ~[jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.util.DefaultComposer.bind(DefaultComposer.java:68) ~[jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.DefaultPDUSender.sendBind(DefaultPDUSender.java:96) ~[jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.SynchronizedPDUSender.sendBind(SynchronizedPDUSender.java:88) ~[jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.session.BindCommandTask.executeTask(BindCommandTask.java:59) ~[jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.session.AbstractSession.executeSendCommand(AbstractSession.java:277) ~[jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.session.SMPPSession.sendBind(SMPPSession.java:296) ~[jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:234) [jsmpp-2.3.4.jar:2.3.4]
              at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:201) [jsmpp-2.3.4.jar:2.3.4]
              at org.apache.camel.component.smpp.SmppProducer.createSession(SmppProducer.java:95) [camel-smpp-2.19.1.jar:2.19.1]
              at org.apache.camel.component.smpp.SmppProducer.doStart(SmppProducer.java:80) [camel-smpp-2.19.1.jar:2.19.1]
              at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) [camel-core

According to "Short Message Peer to Peer Protocol Specification v3.4 - 12-Oct-1999 Issue 1.2", "4.1.1 “BIND_TRANSMITTER” Syntax":

Field Name | Size octets | Type
password   | Var. max 9  | COctet String

Sorry if I'm missunderstanding the specification, but shouldn't nine character long passwords be allowed?

How detect a long SMS MO ?

Hello,
I use a MessageReceiverListener to receive SMS DR and SMS MO
I detect that is a SMS MO if deliverSM doesn't contain SMSC_DEL_RECEIPT
but I don't know how to detect that the SMS MO is a part (and witch part ) of a long SMS MO
Does someone has an idea to find this kind of information ?
Best regards

About exceptions

Hello,

i only submit messages to mc.
and try to handle states after that.
what is the best practice to classify caught exception like:

  • is the error temporary or permanent?
  • is the error caused from message centre or message content?
  • is it network failure / auth.. etc?
  • should i re-try?
  • is it safe to re-try?

thanks

enquire link on open session

org.jsmpp.session.state.SMPPSessionOpen does not currently support enquire_link. According to the spec, this is valid when a session is open (in fact it is valid in any session state)

Can SMPPSessionOpen be updated to permit enquire_link please.

Hang during session break

When I stop my SMPP simulator - session hangs
After about 15 min - computer hangs and only hard reset of PC can help

I watched logs and noticed that there are messages "AbstractSession.close() called",
but no "AbstractSession.close() done" messages in log.

The cause of hangs - enquireLinkSender.join();

I remove this part from org/jsmpp/session/AbstractSession.java and now all OK.

    // Make sure the enquireLinkThread doesn't wait for itself
    if (Thread.currentThread() != enquireLinkSender) {
        if (enquireLinkSender != null) {
            while(enquireLinkSender.isAlive()) {
                try {
                    enquireLinkSender.join();
                } catch (InterruptedException e) {
                    logger.warn("interrupted while waiting for enquireLinkSender thread to exit");
                }
            }
        }
    }

Full fledged implementation of SMPPServerSimulator

The current implementation of SMPPServerSimulator does not simulate all the scenarios. For-example, it does not uses any of the following constants

    public static final int STAT_ESME_RBINDFAIL = 0x0000000D;
    public static final int STAT_ESME_RINVPASWD = 0x0000000E;
    public static final int STAT_ESME_RINVSYSID = 0x0000000F;
    public static final int STAT_ESME_RCANCELFAIL = 0x00000011;
    public static final int STAT_ESME_RREPLACEFAIL = 0x00000013;

Therefore SMPPServerSimulator does not show full usage of it. It should simulate all the scenarios.

Handle user defined DeliveryReceiptState

Currently we have following DeliveryReceiptState

    ENROUTE(0),
    DELIVRD(1),
    EXPIRED(2),
    DELETED(3),
    UNDELIV(4),
    ACCEPTD(5),
    UNKNOWN(6),
    REJECTD(7); 

In India we get many other code apart from standard code mentioned above.
Like code 9 means user found in Do Not Disturb Database.
Like code 11 means user found in Corporate Database.

But when we get these code from SMSC, we get exception.

  public static DeliveryReceiptState valueOf(int value)
            throws IllegalArgumentException {
        for (DeliveryReceiptState item : values()) {
            if (item.value() == value) {
                return item;
            }
        }
        throw new IllegalArgumentException(
                "No enum const DeliveryReceiptState with value " + value);
    }

So suggesting below changes


 public enum DeliveryReceiptState {
    /**
     * ENROUTE
     */
    ENROUTE(0),
    /**
     * DELIVERED
     */
    DELIVRD(1),
    /**
     * EXPIRED
     */
    EXPIRED(2),
    /**
     * DELETED
     */
    DELETED(3),
    /**
     * UNDELIVERABLE
     */
    UNDELIV(4),
    /**
     * ACCEPTED
     */
    ACCEPTD(5),
    /**
     * UNKNOWN
     */
    UNKNOWN(6),
    /**
     * REJECTED
     */
    REJECTD(7);

    private int value;

    DeliveryReceiptState(int value) {
        this.value = value;
    }

    public static DeliveryReceiptState getByName(String name) {
        return valueOf(DeliveryReceiptState.class, name);
    }

    public static DeliveryReceiptState valueOf(int value)
            throws IllegalArgumentException {
        for (DeliveryReceiptState item : values()) {
            if (item.value() == value) {
                return item;
            }
        }
        return UNKNOWN;
    }

    public int value() {
        return value;
    }
}

How to collate multipart SMS received from client

Hi,

I have implemented SMPP server and listens request using ServerMessageReceiverListener.onAcceptSubmitSm method.
In case of long message, I am receiving it in multiple parts, and getting info in UDH. Please suggest how to collate these multi part message and process further as single message.

Please help!

Thanks,
Deepali

Invalid runtime exception thrown when calling onStateChange for org.jsmpp.session.SMPPSession

Hi, When creating a new SMPPSession I am receiving an exception. It seems that jsmpp is trying to initialize and threadpool executor with a values < 1, but I was not able to find in the source code of SMPP. After that exception I can continue usign session, but I am not sure if that can affect the normal operation of the session.

Code Used:

private SMPPSession newSession() throws IOException {
    	log.info("Connecting to "+remoteIpAddress+", port: "+remotePort+", transactionTimer: "+transactionTimer);
        SMPPSession tmpSession = new SMPPSession(remoteIpAddress, remotePort, bindParam);
        tmpSession.setTransactionTimer(transactionTimer);
        sessionStateListener = new SessionStateListenerImpl();
        messageReceiverListener = new MessageReceiverListenerImpl(connector);
        tmpSession.setMessageReceiverListener(messageReceiverListener);
        tmpSession.addSessionStateListener(sessionStateListener);
        tmpSession.setEnquireLinkTimer(120000);
        
        return tmpSession;
    }
private class SessionStateListenerImpl implements SessionStateListener {

		public void onStateChange(SessionState newState, SessionState oldState,
				Session session) {
			
			connector = connectorManager.get(connector.getId());
			if(connector.getStatus()){
				if (newState.equals(SessionState.CLOSED)) {
	            	log.error("Session to " + remoteIpAddress + ":" + remotePort+" closed, creating new session");
	                reconnectAfter(reconnectInterval);
	            }
			}else{
				session.removeSessionStateListener(sessionStateListener);
				session.unbindAndClose();
				session.close();
			}
		}
    }

Exception:

2018-08-24 14:23:36,088 [SMS-Conn-Id-40] ERROR (AbstractSessionContext.java:81) - Invalid runtime exception thrown when calling onStateChange for org.jsmpp.session.SMPPSession@2f20269
java.lang.IllegalArgumentException
	at java.base/java.util.concurrent.ThreadPoolExecutor.setCorePoolSize(ThreadPoolExecutor.java:1560)
	at org.jsmpp.session.SMPPSession$BoundSessionStateListener.onStateChange(SMPPSession.java:663)
	at org.jsmpp.session.AbstractSessionContext.fireStateChanged(AbstractSessionContext.java:79)
	at org.jsmpp.session.SMPPSessionContext.changeState(SMPPSessionContext.java:61)
	at org.jsmpp.session.AbstractSessionContext.bound(AbstractSessionContext.java:51)
	at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:236)
	at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:201)
	at org.jsmpp.session.SMPPSession.<init>(SMPPSession.java:140)

Version: Jsmpp 2.3.6
Thanks

Both the RelativeTimeFormatter and the unit test appear to be implemented incorrectly

According to the spec, SMPP v3.4 s7.1.1, relative times are a time difference, here is the example from the spec:

For example, the following time format ‘020610233429000R”:
- would be interpreted as a relative period of 2 years, 6 months, 10 days, 23 hours, 34
minutes and 29 seconds from the current SMSC time.

The values returned by the RelativeTimeFormatter and the values in the unit test appear to be absolute values.

Aboult jsmpp version

qq 20180206160716
qq 20180206160756

Hi, The latest version I see from the maven repository is 2.3.5,but the latest version of this project is not. What's the reason?

Receiver thread(PDUReaderWorker) can stop without any log or recovery when some invalid packet is received via the session.

It is totally abnormal case, but when some invalid packet is received by receiver(PDUReaderWorker), it could just stop without closing session and even leaving any log, because 'IndexOutOfBoundsException' could occur in reading the invalid packet but it catches only three checked exceptions. (InvalidCommandLengthException, SocketTimeoutException and IOException).

For example, if 0x0000 is received by the receiver, DefautPDUReader will throw 'IndexOutOfBoundException' in 'readPDUHeader' because the packet has just incorrect message length value. And as a result, the receiver will just stop without handling or logging it.
In the case, no reconnect will be triggered and enquire link will remain locked until another error occurs for sending message and reconnect is triggered.

PDUReaderWorker will need to catch unchecked exceptions too, so that it can gracefully close the session for reconnect.

Purpose of sequence check on SMPPSession.connectAndBind()

SMPPSession checks for the sequence value when connectAndBind() gets called.
Since the initial value of the sequence is 1 and gets incremented for every call of AbstractSession.executeSendCommand() or AbstactSession.executeSendCommandWithNoResponse(), it seems that the connectAndBind() is supposed to be executed only once.
Subsequent calls will always throw an exception even if the first call failed in connecting and binding to a SMSC.

What happens when the sequence value is 1 which requires that connecting to SMSCs happen only on that sequence value?

We had issues with our SMSC where the initial attempt to connect failed. Changing the condition to only throw an exception if the sessionContext has a bound state allows the succeeding bind attempts to happen.

Cannot replace short messages as Transceiver

According to spec, TRX sessions can replace Short messages, but in jsmpp I cant. To fix this simply remove
ensureTransmittable("replaceShortMessage", true);

true parameter on line 400 in org.jsmpp.session.SMPPSession class.

Recommendations for reconnect logic

Hi, I am curious how would you recommend to implement reconnect logic on top of jsmpp. If one would use Camel-Smpp then this is already implemented there. But I see one issue with jsmpp implementation maybe you can clarify.
When jsmpp is used for the client side and the connection to the server gets broken then AbstractSession.close() will be called. First thing it does it calls ctx.close(). And then it calls connection.close().
Within ctx.close() it will invoke all registered listeners to inform about state change to CLOSE.
Camel-Smpp provides such listener and when it is invoked it will try to re-establish connection. When the connection is reestablished and all listeners return back AbstractSession.close() method then connection.close() is invoked, which actually closes newly established connection.
Is my understanding right? If yes, why is it done that way? Or what would be the right approach to implement reconnection (basically I am also asking if Camel-Smpp did it right). Thanks.

NPE in DeliveryReceipt constructor

Hi, I'm using Camel SMPP and I'm getting Delivery Receipts from my SMSC which do not have submit date and done date. According to the SMPP v4.3 specs, Appendix B, the format of the Delivery Receipt message is SMSC vendor specific.

The following exception is thrown when a delivery receipt is received:

2017-12-20 12:25:40.903 DEBUG 7 --- [onsumer[SMS.MT]] o.a.c.c.smpp.SmppSubmitSmCommand         : Sending short message 0 for exchange id 'ID-bcf27a5a104f-1513772191424-0-2'...
2017-12-20 12:25:41.015 DEBUG 7 --- [onsumer[SMS.MT]] o.a.c.c.smpp.SmppSubmitSmCommand         : Sent short message for exchange id 'ID-bcf27a5a104f-1513772191424-0-2' and received message ids '[1846655173]'
2017-12-20 12:25:48.374 DEBUG 7 --- [pool-3-thread-1] o.a.c.c.s.MessageReceiverListenerImpl    : Received a deliverSm PDUHeader(94, 00000005, 00000000, 6)
2017-12-20 12:25:48.375  WARN 7 --- [pool-3-thread-1] o.a.camel.component.smpp.SmppConsumer    : Cannot create exchange. This exception will be ignored.. Caused by: [org.jsmpp.util.InvalidDeliveryReceiptException - There is an error found when parsing delivery receipt]

org.jsmpp.util.InvalidDeliveryReceiptException: There is an error found when parsing delivery receipt
	at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:78)
	at org.jsmpp.util.DefaultDecomposer.deliveryReceipt(DefaultDecomposer.java:392)
	at org.jsmpp.util.DefaultDecomposer.deliveryReceipt(DefaultDecomposer.java:402)
	at org.jsmpp.bean.DefaultDeliveryReceiptStripper.strip(DefaultDeliveryReceiptStripper.java:36)
	at org.jsmpp.bean.DefaultDeliveryReceiptStripper.strip(DefaultDeliveryReceiptStripper.java:27)
	at org.jsmpp.bean.DeliverSm.getDeliveryReceipt(DeliverSm.java:63)
	at org.jsmpp.bean.DeliverSm.getShortMessageAsDeliveryReceipt(DeliverSm.java:50)
	at org.apache.camel.component.smpp.SmppBinding.createSmppMessage(SmppBinding.java:125)
	at org.apache.camel.component.smpp.SmppEndpoint.createOnAcceptDeliverSmExchange(SmppEndpoint.java:122)
	at org.apache.camel.component.smpp.SmppEndpoint.createOnAcceptDeliverSmExchange(SmppEndpoint.java:106)
	at org.apache.camel.component.smpp.MessageReceiverListenerImpl.onAcceptDeliverSm(MessageReceiverListenerImpl.java:70)
	at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:461)
	at org.jsmpp.session.SMPPSession.access$300(SMPPSession.java:94)
	at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:480)
	at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109)
	at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm(SMPPSessionBoundRX.java:51)
	at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:91)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: null
	at org.jsmpp.bean.DeliveryReceipt.string2Date(DeliveryReceipt.java:413)
	at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:68)
	... 19 common frames omitted

ResponseTimeoutException after submit_sm on moderate to heavy load

Hello, we are experiencing some strange behavior from the jsmpp implementation on moderate to heavy loads. The system fires ResponseTimeoutException even though in Wireshark I can see the submit_sm response for the sent message. This exception causes us to resend the message and at the end the customer receives duplicate messages. Are there any other means of requesting a new submit_sm response from the SMSC

GSM 03.48

Is it possible to send GSM 03.48 message using jsmpp

Is there any plan for a new release?

Hi.

You made a commit:
7a6ea53

based on this pull request:
#8

Is there any chance you are going to make a new version number with this included?

We have a production platform depending on this fix to work with one of our SMPP gateways and now I have to build this based on a locally compiled library with this commit.
I would rather be able to build it with a maven "official" release number.

Regards,
Tomas

Import in Java

This is more of an Issue that I am facing and this is probably not an issue on your side. I was wondering why the import would not work for this project. When i try to import in eclipse, it tells me no projects found in import so overall I cannot import any of the files needed to begin my implementation. Any idea on how I can get around this?

Send DLR in SMPPServerSimulator

Hi all

I'm trying to create a SMPP server, using the SMPPServerSimulator example as a start point. I'm using kannel to emulate a real SMPP client. Kannel successfully binds, send submit_sm, receive submit_sm_resp but rejects deliver_sm:

got DLR but could not find message or was not interested in it id<870928761> dst<123>, type<1>

If I change the code in DeliveryReceiptTask from:

DeliveryReceipt delRec = new DeliveryReceipt(stringValue, totalSubmitted, totalDelivered, new Date(), new Date(), DeliveryReceiptState.DELIVRD, "000", new String(shortMessage));

to

DeliveryReceipt delRec = new DeliveryReceipt(messageId.getValue(), totalSubmitted, totalDelivered, new Date(), new Date(), DeliveryReceiptState.DELIVRD, "000", new String(shortMessage));

Kannel process the deliver_sm correctly. Can you tell me pls what is wrong ?

Optional parameters

There is a problem with receiving Optional parameters not in the known list.
In this case I get WARN about "parameter XXXX is not recognize"
But I need these parameters.

In Ukraine billing ids transfers via custom tlv parameters, different for different mobile operators.
I have to read them from DeliverSm, set them (plus some extra) in SubmitSm
I already add few new optional parameters in my version of JSMPP, but i have to make changes to jsmpp for every new parameter.
I think getting/setting optional parameters via Map<Short, Parameter> would be better way, and no need of changing library in case of new tlv header detected.

IOException after unbind

I used jsmpp 2.3.6, and ran SimpleSubmitExample for test.
After session.unbindAndClose(); I got exeption.
The sample code is:
public static void main(String[] args) throws InterruptedException {
SMPPSession session = new SMPPSession();
try {
LOGGER.info("Connecting");
String systemId = session.connectAndBind("localhost", 8056, new BindParameter(BindType.BIND_TX, "test", "test", "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));
LOGGER.info("Connected with SMSC with system id {}", systemId);

        try {
            String messageId = session.submitShortMessage("CMT",
                TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616",
                TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "628176504657",
                new ESMClass(), (byte)0, (byte)1,  TIME_FORMATTER.format(new Date()), null,
                new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0, new GeneralDataCoding(Alphabet.ALPHA_DEFAULT, MessageClass.CLASS1, false), (byte)0,
                "jSMPP simplify SMPP on Java platform".getBytes());
            LOGGER.info("Message submitted, message_id is {}", messageId);
        } catch (PDUException e) {
            // Invalid PDU parameter
            LOGGER.error("Invalid PDU parameter", e);
        } catch (ResponseTimeoutException e) {
            // Response timeout
            LOGGER.error("Response timeout", e);
        } catch (InvalidResponseException e) {
            // Invalid response
            LOGGER.error("Receive invalid response", e);
        } catch (NegativeResponseException e) {
            // Receiving negative response (non-zero command_status)
            LOGGER.error("Receive negative response, e");
        } catch (IOException e) {
            LOGGER.error("IO error occured", e);
        }

        session.unbindAndClose();

    } catch (IOException e) {
        LOGGER.error("Failed connect and bind to host", e);
    }
}

The exception logs is:
10/08/2018 - 16:56:38.598 [main] INFO : com.vivas.sms.SimpleSubmitExample.main(51) - Connecting
10/08/2018 - 16:56:38.635 [main] DEBUG: org.jsmpp.session.SMPPSession.connectAndBind(217) - Connect and bind to localhost port 8056
10/08/2018 - 16:56:38.705 [main] INFO : org.jsmpp.session.SMPPSession.connectAndBind(223) - Connected to localhost/127.0.0.1
10/08/2018 - 16:56:38.730 [main] DEBUG: org.jsmpp.DefaultPDUSender.writeAndFlush(450) - Sending SMPP message 00 00 00 21 00 00 00 02 00 00 00 00 00 00 00 01 74 65 73 74 00 74 65 73 74 00 63 70 00 34 00 00 00
10/08/2018 - 16:56:38.737 [PDUReaderWorker: org.jsmpp.session.SMPPSession@6576fe71] INFO : org.jsmpp.session.SMPPSession$PDUReaderWorker.run(580) - Starting PDUReaderWorker
10/08/2018 - 16:56:38.754 [pool-1-thread-1] DEBUG: org.jsmpp.session.PDUProcessTask.run(54) - Received SMPP message PDUHeader(31, 80000002, 00000000, 1) 53 6d 73 63 20 53 69 6d 75 6c 61 74 6f 72 00
10/08/2018 - 16:56:38.756 [pool-1-thread-1] DEBUG: org.jsmpp.session.state.SMPPSessionOpen.processBindResp(57) - Bind Response header (31, 80000002, 00000000, 1)
10/08/2018 - 16:56:38.759 [main] DEBUG: org.jsmpp.session.AbstractSession.executeSendCommand(292) - bind response with sequence 1 received for session 06d2dfaf
10/08/2018 - 16:56:38.791 [main] INFO : org.jsmpp.bean.OptionalParameters.get(250) - Optional Parameter Tag class org.jsmpp.bean.OptionalParameter$Sc_interface_version not found
10/08/2018 - 16:56:38.791 [main] INFO : org.jsmpp.session.SMPPSession$BoundSessionStateListener.onStateChange(662) - Changing processor degree to 3
10/08/2018 - 16:56:38.791 [main] INFO : com.vivas.sms.SimpleSubmitExample.main(53) - Connected with SMSC with system id Smsc Simulator
10/08/2018 - 16:56:38.791 [EnquireLinkSender: org.jsmpp.session.SMPPSession@6576fe71] DEBUG: org.jsmpp.session.AbstractSession$EnquireLinkSender.run(457) - Starting EnquireLinkSender for session 06d2dfaf
10/08/2018 - 16:56:38.811 [main] DEBUG: org.jsmpp.DefaultPDUSender.writeAndFlush(450) - Sending SMPP message 00 00 00 68 00 00 00 04 00 00 00 00 00 00 00 02 43 4d 54 00 01 00 31 36 31 36 00 01 00 36 32 38 31 37 36 35 30 34 36 35 37 00 00 00 01 31 38 30 38 31 30 31 36 35 36 33 38 37 32 38 2b 00 00 00 00 11 00 24 6a 53 4d 50 50 20 73 69 6d 70 6c 69 66 79 20 53 4d 50 50 20 6f 6e 20 4a 61 76 61 20 70 6c 61 74 66 6f 72 6d
10/08/2018 - 16:56:38.821 [pool-1-thread-2] DEBUG: org.jsmpp.session.PDUProcessTask.run(54) - Received SMPP message PDUHeader(25, 80000004, 00000000, 2) 53 6d 73 63 32 30 30 36 00
10/08/2018 - 16:56:38.821 [main] DEBUG: org.jsmpp.session.AbstractSession.executeSendCommand(292) - submit_sm response with sequence 2 received for session 06d2dfaf
10/08/2018 - 16:56:38.831 [main] INFO : com.vivas.sms.SimpleSubmitExample.main(62) - Message submitted, message_id is Smsc2006
10/08/2018 - 16:56:38.831 [main] DEBUG: org.jsmpp.session.AbstractSession.unbindAndClose(388) - Unbind and close sesssion 06d2dfaf
10/08/2018 - 16:56:38.831 [main] DEBUG: org.jsmpp.DefaultPDUSender.writeAndFlush(450) - Sending SMPP message 00 00 00 10 00 00 00 06 00 00 00 00 00 00 00 03
10/08/2018 - 16:56:38.841 [pool-1-thread-3] DEBUG: org.jsmpp.session.PDUProcessTask.run(54) - Received SMPP message PDUHeader(16, 80000006, 00000000, 3)
10/08/2018 - 16:56:38.841 [main] DEBUG: org.jsmpp.session.AbstractSession.executeSendCommand(292) - unbind response with sequence 3 received for session 06d2dfaf
10/08/2018 - 16:56:38.851 [main] DEBUG: org.jsmpp.session.AbstractSession.close(204) - Close session 06d2dfaf
10/08/2018 - 16:56:38.851 [main] DEBUG: org.jsmpp.session.AbstractSession.close(218) - Stop enquireLinkSender for session 06d2dfaf
10/08/2018 - 16:56:38.851 [EnquireLinkSender: org.jsmpp.session.SMPPSession@6576fe71] DEBUG: org.jsmpp.session.AbstractSession$EnquireLinkSender.run(486) - EnquireLinkSender stopped for session 06d2dfaf
10/08/2018 - 16:56:38.851 [main] DEBUG: org.jsmpp.session.AbstractSession.close(230) - Close session context 06d2dfaf in state BOUND_TX
10/08/2018 - 16:56:38.851 [PDUReaderWorker: org.jsmpp.session.SMPPSession@6576fe71] WARN : org.jsmpp.session.SMPPSession$PDUReaderWorker.readPDU(622) - IOException while reading:
java.net.SocketException: Socket Closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at java.io.DataInputStream.readInt(DataInputStream.java:387)
at org.jsmpp.DefaultPDUReader.readPDUHeader(DefaultPDUReader.java:40)
at org.jsmpp.session.SMPPSession$PDUReaderWorker.readPDU(SMPPSession.java:598)
at org.jsmpp.session.SMPPSession$PDUReaderWorker.run(SMPPSession.java:582)
10/08/2018 - 16:56:38.861 [PDUReaderWorker: org.jsmpp.session.SMPPSession@6576fe71] DEBUG: org.jsmpp.session.AbstractSession.close(204) - Close session 06d2dfaf
10/08/2018 - 16:56:38.861 [PDUReaderWorker: org.jsmpp.session.SMPPSession@6576fe71] DEBUG: org.jsmpp.session.AbstractSession.close(204) - Close session 06d2dfaf
10/08/2018 - 16:56:38.861 [PDUReaderWorker: org.jsmpp.session.SMPPSession@6576fe71] INFO : org.jsmpp.session.SMPPSession$PDUReaderWorker.run(593) - PDUReaderWorker stop

Vendor specific delivery receipt format breaks Deliver_sm

Hi all,

In the SMPP Protocol specification it states:

" The informational content of an SMSC Delivery Receipt may be inserted into the
short_message parameter of the deliver_sm operation. The format for this Delivery Receipt
message is SMSC vendor specific but following is a typical example of Delivery Receipt report."
“id:IIIIIIIIII sub:SSS dlvrd:DDD submit date:YYMMDDhhmm done
date:YYMMDDhhmm stat:DDDDDDD err:E Text: . . . . . . . . .”

In the case of the SMSC which I am integrating to, they omit two fields which org.jsmpp.bean.DeliveryReceipt expects (sub and dlvrd) in its constructor- for example this is what they send:
"id:1526758174 submit date:1701240904 done date:1701240904 stat:DELIVRD err:000 text:hellow"

This causes a Null Pointer when this line is executed (cannot parse null to int):

submitted = Integer.parseInt(getDeliveryReceiptValue( DeliveryReceipt.DELREC_SUB, formattedDeliveryReceipt));

I think the code should maybe use zero as a default in the case that these values do not exist but I am not sure of the implications.

If some can guide me I can make the changes...

Java - Connect to SMPP server over SSL using JSMPP api

Is there any way to connect to SMPP server over ssl from java application using JSMPP API?

Basically, my two questions are:

How do I specify as an SSL connection when open JSMPP session.
Where do I put the public certificate.

SSL SMPP

Does this lib support ssl? If so, how to use it.

how to submit and receive a LongMessage

Hi, your jsmpp project is very good when i see it ,and it helps me very much, but when i want to submit a long message,my cellphone will receice several messages. Can you tell me how to submit a long message, than my cellphone will receive just one long message

Logging of optionalparameter causes NullPointerException for some SMSCs.

In SMPPSession.java line 296 in method sendBind(..) the Sc_interface_version is retrieved from the OptionalParameters from the bindResponse (from the SMSC) for logging purposes only:

    BindResp resp = (BindResp)executeSendCommand(task, timeout);
    OptionalParameter.Sc_interface_version sc_version = resp.getOptionalParameter(Sc_interface_version.class);
    if(sc_version != null) {
        logger.info("Other side reports smpp interface version {}", sc_version);
    }

When running towards proper SMSC'es this works ok, as I have already integrated with two real SMSCs. When running towards an SMPP SIM (in my case Selenium SMPPSim I am unable to configure the optionalparameters list in the bind response from the simulator.
The consequence is that the optionalParameters in the BindResp is null.
The SMPP API doesnt handle this and causes a NullPointerException:

Exception in thread "main" java.lang.NullPointerException
at org.jsmpp.bean.OptionalParameters.get(OptionalParameters.java:238)
at org.jsmpp.bean.BindResp.getOptionalParameter(BindResp.java:61)
at org.jsmpp.session.SMPPSession.sendBind(SMPPSession.java:297)
at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:234)
at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:201)

I think there should be a check to verify that optionalparameters is not null before trying to access it.

£ sign is not being displayed correctly on handset

Hello team... I have an issue with some characters being displayed wrongly on the handset.

Sent content: £$%^&*96733{}@#
Delivered content: B#$%^&*96733{}@#

It appears the character £ is being misrepresented.

Below is a sample code block:

String message = "£$%^&*96733{}@#";

String messageId = session.submitShortMessage(
        null,
        TypeOfNumber.ALPHANUMERIC,
        NumberingPlanIndicator.UNKNOWN,
        "Uwiano",
        TypeOfNumber.INTERNATIONAL,
        NumberingPlanIndicator.ISDN,
        "254723624727",
        new ESMClass(),
        (byte) 0,
        (byte) 0,
        null,
        null,
        new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT),
        (byte) 0,
        new GeneralDataCoding(Alphabet.ALPHA_DEFAULT, MessageClass.CLASS1, false),
        (byte) 0,
        message.getBytes()
);

About java.io.EOFException

This exception happen when I submitShortMessage(),

2018-04-11 08:22:37.864 [http-nio-8080-exec-4] INFO org.jsmpp.session.SMPPSession - Connected to /10.12.51.27 2018-04-11 08:22:37.865 [PDUReaderWorker: org.jsmpp.session.SMPPSession@4bc1e38c] INFO org.jsmpp.session.SMPPSession - Starting PDUReaderWorker 2018-04-11 08:22:38.030 [http-nio-8080-exec-4] INFO org.jsmpp.bean.OptionalParameters - Optional Parameter Tag class org.jsmpp.bean.OptionalParameter$Sc_interface_version not found 2018-04-11 08:22:38.030 [http-nio-8080-exec-4] INFO org.jsmpp.session.SMPPSession - Changing processor degree to 3 2018-04-11 08:22:38.030 [http-nio-8080-exec-4] INFO com.panshi.payproxy.controller.SmppController - Connected with SMSC with system id RockyMobi 2018-04-11 08:22:38.253 [http-nio-8080-exec-4] INFO com.panshi.payproxy.controller.SmppController - Message submitted, message_id is 5149464B 2018-04-11 08:22:38.461 [PDUReaderWorker: org.jsmpp.session.SMPPSession@4bc1e38c] WARN org.jsmpp.session.SMPPSession - IOException while reading: java.io.EOFException: null at java.io.DataInputStream.readInt(DataInputStream.java:392) at org.jsmpp.DefaultPDUReader.readPDUHeader(DefaultPDUReader.java:40) at org.jsmpp.session.SMPPSession$PDUReaderWorker.readPDU(SMPPSession.java:598) at org.jsmpp.session.SMPPSession$PDUReaderWorker.run(SMPPSession.java:582) 2018-04-11 08:22:38.464 [PDUReaderWorker: org.jsmpp.session.SMPPSession@4bc1e38c] INFO org.jsmpp.session.SMPPSession - PDUReaderWorker stop

Do you have any idea about it?
Forgive me the turbid format code, thank you very much!

Allow 16 characters for the System ID and 9 characters for the Password as per SMPP Specification v3.4

As per the SMPP Protocol Specification v3.4, 16 characters are allowed for the System ID and 9 characters are allowed for the password.

But in the current implementation,
Only 15 characters are allowed for the System ID and 8 characters are allowed for the Password.

In the method StringValidator.java

static boolean isCOctetStringValid(String value, int maxLength) {
    if (value == null)
        return true;
    if (value.length() >= maxLength)
        return false;
    return true;

}

static boolean isCOctetStringValid(byte[] value, int maxLength) {
    if (value == null)
        return true;
    if (value.length >= maxLength)
        return false;
    return true;

So the '=' sign in the if statement shall be removed, to make sure that it accepts the allowed limit.

Proposed Change
if (value.length >maxLength)......

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.