JSMPP :There is an error found when parsing delivery receipt

511 views
Skip to first unread message

sampath premarathna

unread,
Nov 2, 2012, 4:56:15 AM11/2/12
to js...@googlegroups.com
hello there,

I have an issue with receiving delivery report in my code.I used default code given in jsmpp and DeliveryReceipt delReceipt = deliverSm.getShortMessageAsDeliveryReceipt(); is causing error.
 I am getting following error

org.jsmpp.util.InvalidDeliveryReceiptException: There is an error found when parsing delivery receipt
at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:79)
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 family.mobitel.smshub.SMSHandler.onAcceptDeliverSm(SMSHandler.java:88)
at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:477)
at org.jsmpp.session.SMPPSession.access$200(SMPPSession.java:94)
at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:496)
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$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NumberFormatException: For input string: "st"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at org.jsmpp.bean.DeliveryReceipt.string2Date(DeliveryReceipt.java:421)
at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:71)
... 16 more

And 

When i trace the request using wireshark i am getting this from my smsc

0718554920nalakaxid:38872427882349826 sub:001 dlvrd:1 submit date:14125113  done date:12112147stat:DELIVRD err:0 text:please get it right38872427882349826'


Ashwin Moily

unread,
Nov 2, 2012, 5:03:11 AM11/2/12
to js...@googlegroups.com
It is breaking at date conversion you receiving date appened with st . Check against this 

id:IIIIIIIIII sub:SSS dlvrd:DDD submit date:YYMMDDhhmm done
date:YYMMDDhhmm stat:DDDDDDD err:E Text: . . . . . . . . .


If server is sending like that you will have to ask them to fix it if that is not possible u will have to change deliveryReciept Code to make it work for you 



 
Regards
Ashwin Moily
Mob: +91 9619181096






--
You received this message because you are subscribed to the Google Groups "jsmpp" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jsmpp/-/RpziudYgo9YJ.
To post to this group, send email to js...@googlegroups.com.
To unsubscribe from this group, send email to jsmpp+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jsmpp?hl=en.

sampath premarathna

unread,
Nov 2, 2012, 5:11:13 AM11/2/12
to js...@googlegroups.com
Thank Ashwin .I just replace  int minute = Integer.parseInt(date.substring(8,10)); to int minute = Integer.parseInt("0");
now it works .
--
~sampathpremarathna~


Reply all
Reply to author
Forward
0 new messages