Receive pending messages from SMSC

172 views
Skip to first unread message

Rukh

unread,
Oct 10, 2008, 5:42:55 AM10/10/08
to jsmpp
Hi,

I think it is a bug, but maybe I'm mistaken.

I'm using SMPPSim (from seleniumsoftware) to test jSMPP libraries and
I've noticed an issue, with receiving. How to reproduce it:
1. Start SMPPSim (no bounded connectors)
2. Submit message to SMPPSim using it's MO Injection form
3. Bind to SMPPSim with a receiver to receive the message
4. No messages are received. (BUG?)

When I'm connected to SMPPSim with an RX when messages is sent it
works fine, but connecting to collect messages waiting in outbound
queue seams to fail. Correct me if this is not a bug.

Here is the RX implementation I'm using to test RX:

public static void main(String[] args) throws IOException {

final SMPPSession session = new SMPPSession();
try {
session
.connectAndBind("localhost", 2775, new BindParameter(
BindType.BIND_RX, "smppclient", "password", "cp",
TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN, null));
} catch (IOException e) {
System.err.println("Failed connect and bind to host");
e.printStackTrace();
}

// Set listener to receive deliver_sm
session.setMessageReceiverListener(new MessageReceiverListener() {
public void onAcceptDeliverSm(DeliverSm deliverSm)
throws ProcessRequestException {
System.out.println("getEsmClass " + deliverSm.getEsmClass());
if (MessageType.SMSC_DEL_RECEIPT.containedIn(deliverSm
.getEsmClass())) {
// delivery receipt
try {
DeliveryReceipt delReceipt = deliverSm
.getShortMessageAsDeliveryReceipt();
long id = Long.parseLong(delReceipt.getId()) & 0xffffffff;
String messageId = Long.toString(id, 16).toUpperCase();
System.out
.println("Receiving delivery receipt for message '"
+ messageId + "' : " + delReceipt);
} catch (InvalidDeliveryReceiptException e) {
System.err.println("Failed getting delivery receipt");
e.printStackTrace();
}
} else {
// regular short message
System.out.println("Receiving message : "
+ new String(deliverSm.getShortMessage()));
}
}

public void onAcceptAlertNotification(
AlertNotification alertNotification) {
System.out
.println("alert: " + alertNotification.getCommandId());
}
});

// keep receiving messages...
System.out.print("Press any key to stop receiving messages");
System.in.read();

session.unbindAndClose();

System.out.println("Finished");
}

Rukh

unread,
Oct 10, 2008, 5:47:22 AM10/10/08
to jsmpp
Forgot to mention something (BTW. no edit option?)

SMPPSim reports that message has been moved out from outbound queue.
So it is being received but somehow listener is not processing the
message.

uud ashr

unread,
Oct 10, 2008, 12:24:48 PM10/10/08
to js...@googlegroups.com
Hi, 

JSMPP currently not support the outbind command. So if you want to receive a message, you should bind to the SMSC. The outbind features is still in my head, I'm still looking the best API design for this.

Regards, 
uudashr
Reply all
Reply to author
Forward
0 new messages