MazWoz / jsmpp

Automatically exported from code.google.com/p/jsmpp
Apache License 2.0
0 stars 0 forks source link

submitShortMessage() method should return SubmitSmResp object #48

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In class SMPPSession, it's good to have another submitShortMessage method
that return SubmitSmResp, since sometimes not only the Message ID is used
but also values from the SubmitSmResp object.

Original issue reported on code.google.com by ferry.wi...@gmail.com on 26 Aug 2009 at 2:52

GoogleCodeExporter commented 8 years ago
What is values on submit_sm_resp you need to use?

it only has:
1. command_length (dynamically change based on the PDU size)
2. command_id (it always submit_sm_resp)
3. command_status (it always 0, non zero will inform by throwing 
NegativeResponseException and you can 
get the command status from there)
4. sequence_number (it's protocol level, you don't need this because you don't 
know the value when you send 
submit_sm. sequence_number used to match the request-response)
5. message_id (you always have this returned by the method if the message 
submission succeed)

Original comment by uuda...@gmail.com on 26 Aug 2009 at 3:19

GoogleCodeExporter commented 8 years ago
I'm using the command_length parameter for calculating if we'll be needing a
bandwidth upgrade or not.

Original comment by ferry.wi...@gmail.com on 26 Aug 2009 at 3:33

GoogleCodeExporter commented 8 years ago
You do that on application level?
Not on network level or something like network monitoring tools?

Original comment by uuda...@gmail.com on 26 Aug 2009 at 4:08

GoogleCodeExporter commented 8 years ago
How if I create some listener that will pass the notify if there is smpp 
activity by passing the PDU dump. So you 
can debug all the sent and received PDU and you also can get the length of the 
PDU (equal to command_length)

interface ActivityListener {
    // we can write the pdu dump and also know the length pdu.length
    void onActivity(byte[] pdu, Session source);
}

Original comment by uuda...@gmail.com on 26 Aug 2009 at 5:47

GoogleCodeExporter commented 8 years ago
Listener might be OK for now.

In the next major release, probably we can split the encoding / protocol part 
from 
the network (stream, socket) part.

TrafficHandler trafficHandler = new TrafficHandler(socketObjectWithStreams);

SubmitSmPDU pdu = new SubmitSmPDU(params...);
// OR
SubmitSmPDU pdu = new PDUBuilder()
.set(someParam)
.set(SomeOtherParam)
.buildSubmitSmPDU();

trafficHandler.submit(session, pdu);

This will help us diagnose and unit-test things in isolation.

Regards,
Shantanu

Original comment by kumar.sh...@gmail.com on 26 Aug 2009 at 6:06

GoogleCodeExporter commented 8 years ago
Thats nice.
What do you think, next release :-P?

Original comment by uuda...@gmail.com on 26 Aug 2009 at 6:21