Hi,
I'm trying to send an SMS-MO message to jasmin using cloudhopper-jsmpp.
Here's what my client code looks like.
DefaultSmppClient clientBootstrap = new DefaultSmppClient(Executors.newCachedThreadPool(), 1, monitorExecutor);
DefaultSmppSessionHandler sessionHandler = new ClientSmppSessionHandler();
SmppSessionConfiguration config = new SmppSessionConfiguration();
config.setWindowSize(1);
config.setName("Tester.Session.0");
config.setType(SmppBindType.TRANSCEIVER);
config.setHost("127.0.0.1");
config.setPort(2775);
config.setConnectTimeout(10000);
config.setSystemId("smppuser");
config.setPassword("smpppass");
config.getLoggingOptions().setLogBytes(true);
config.setRequestExpiryTimeout(30000);
config.setWindowMonitorInterval(15000);
config.setCountersEnabled(true);
SmppSession session = clientBootstrap.bind(config, sessionHandler);
String message = "Testing sms from cloud hopper";
try {
byte[] textBytes = CharsetUtil.encode(message, CharsetUtil.CHARSET_UCS_2);
DeliverSm deliver = new DeliverSm();
deliver.setSourceAddress(new Address((byte)0x03, (byte)0x00, "40404"));
deliver.setDestAddress(new Address((byte)0x01, (byte)0x01, "44555519205"));
deliver.setShortMessage(textBytes);
WindowFuture<Integer,PduRequest,PduResponse> future = session.sendRequestPdu(deliver, 10000, false);
if (!future.await()) {
logger.error("Failed to receive deliver_sm_resp within specified time");
} else if (future.isSuccess()) {
DeliverSmResp deliverSmResp = (DeliverSmResp)future.getResponse();
logger.info("deliver_sm_resp: commandStatus [" + deliverSmResp.getCommandStatus() + "=" + deliverSmResp.getResultMessage() + "]");
} else {
logger.error("Failed to properly receive deliver_sm_resp: " + future.getCause());
}
} catch (Exception e) {}
However, I keep getting the following error in my connector
2015-08-20 11:54:26 WARNING 21847 SMPP connection established from 127.0.0.1 to port 2775
2015-08-20 11:54:26 INFO 21847 Added bind_transceiver bind for 'smppuser'. Active binds: bind_receiver: 0, bind_transceiver: 1, bind_transmitter: 0.
2015-08-20 11:54:26 INFO 21847 Bind request succeeded for smppuser in session [906cd186-79f6-417d-881e-03f271c67244]. 1 active binds
2015-08-20 11:54:26 CRITICAL 21847 Received unsupported pdu type: deliver_sm
2015-08-20 11:54:26 WARNING 21847 Shutdown requested...unbinding
2015-08-20 11:54:26 INFO 21847 Waiting for in-progress transactions to finish...
2015-08-20 11:54:26 WARNING 21847 Issuing unbind request
2015-08-20 11:54:26 WARNING 21847 Unbind succeeded
2015-08-20 11:54:26 WARNING 21847 Disconnecting...
2015-08-20 11:54:26 INFO 21847 Dropped bind_transceiver bind for 'smppuser'. Active binds: bind_receiver: 0, bind_transceiver: 0, bind_transmitter: 0.
2015-08-20 11:54:26 WARNING 21847 SMPP 127.0.0.1 disconnected from port 2775: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
]
Can anyone point me to what I'm doing wrong? I'm basically trying to create a JSMPP client that can send and receive messages from jasmin.
Regards