Having problem when with bind method

604 views
Skip to first unread message

Gargi Das

unread,
Mar 14, 2014, 5:57:28 AM3/14/14
to js...@googlegroups.com
Hi Team,

I'm using org.smpp jar file for implementing sms .
I'm facing an issue while sending the sms. Connection is getting unexpectedly closed by the SMSC server.

java.io.EOFException: Reached end of stream
    at org.smpp.TCPIPConnection.receive(TCPIPConnection.java:421)
    at org.smpp.ReceiverBase.receivePDUFromConnection(ReceiverBase.java:197)
    at org.smpp.Receiver.tryReceivePDU(Receiver.java:328)
    at org.smpp.ReceiverBase.tryReceivePDUWithTimeout(ReceiverBase.java:155)
    at org.smpp.ReceiverBase.tryReceivePDUWithTimeout(ReceiverBase.java:116)
    at org.smpp.Receiver.receive(Receiver.java:280)
    at org.smpp.Session.send(Session.java:944)
    at org.smpp.Session.bind(Session.java:406)
    at org.smpp.Session.bind(Session.java:364)
    at SMS.DSTSendSMS.bind(DSTSendSMS.java:223)
    at SMS.DSTSendSMS.main(DSTSendSMS.java:174)

This is the error what I'm receiving.

Can anyone please help me to find out the solution.

Stefán Þorvarðarson

unread,
Mar 14, 2014, 6:08:25 AM3/14/14
to js...@googlegroups.com
Hi

Is something sent by the SMSC before closing the stream? It seems that the SMSC is closing the connection after you send a bind message, perhaps the SMSC does not accept the bind parameters and simply closes the connection. You may need to contact those who handle support for this SMSC, they should know what their system doesn't like about the bind message.

Best regards,
Stefan


From: js...@googlegroups.com <js...@googlegroups.com> on behalf of Gargi Das <gargi...@gmail.com>
Sent: Friday, March 14, 2014 9:57 AM
To: js...@googlegroups.com
Subject: Having problem when with bind method
 
--
You received this message because you are subscribed to the Google Groups "jsmpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsmpp+un...@googlegroups.com.
To post to this group, send email to js...@googlegroups.com.
Visit this group at http://groups.google.com/group/jsmpp.
For more options, visit https://groups.google.com/d/optout.

Gargi Das

unread,
Mar 14, 2014, 10:23:49 AM3/14/14
to js...@googlegroups.com
Hi Stefan,

I checked with the SMSC team . They are telling that when I'm sending sms in a bulk, connections are not getting closed. So when SMSc is having too many open connections it is blocking our port.
any suggestions how to handle bulk sms sending in a fraction of second.

Regards
Gargi


--
You received this message because you are subscribed to a topic in the Google Groups "jsmpp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsmpp/QttlFTcTTQE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsmpp+un...@googlegroups.com.

To post to this group, send email to js...@googlegroups.com.
Visit this group at http://groups.google.com/group/jsmpp.
For more options, visit https://groups.google.com/d/optout.



--
Thanks & Regards
Gargi Das
09933567005

Stefán Þorvarðarson

unread,
Mar 14, 2014, 10:28:39 AM3/14/14
to js...@googlegroups.com
Hi

Your application is forgetting to close the connections when done sending. You should not open a new connection to the SMSC for each and every sms being sent. Open it once and send all messages over that one connection. When your application is finished you need to unbind and close the connection so that it doesn't linger and take unnecessary resources on the smsc.

Best regards,
Stefan


Sent: Friday, March 14, 2014 2:23 PM
To: js...@googlegroups.com
Subject: Re: Having problem when with bind method
 

Gargi Das

unread,
Mar 14, 2014, 11:13:21 AM3/14/14
to js...@googlegroups.com
Thanks Stefan.

Gargi Das

unread,
Mar 20, 2014, 10:11:15 AM3/20/14
to js...@googlegroups.com
Hi Stefan,

Need one help. I'm getting WrongLengthOfStringException in my program while sending sms. It's max character allowed is set to 254 and my message exceeds with 258. So it fails to deliver. Now how to set this value in my program. I'm using org.smpp jar files for smpp implementation. aatached are the jars fro the same. Now how to set this value in my code.
opensmpp-charset-3.0.0.jar
opensmpp-core-3.0.0.jar

AMIT SINGH

unread,
Mar 20, 2014, 10:25:24 AM3/20/14
to js...@googlegroups.com

It is not possible to send a message greater than 254 characters in smpp, if you want to send a mesage having more than 254 characters, then you have to break it into multiple segments. In which each segment can have max to max 254 characters.

AMIT SINGH

unread,
Mar 20, 2014, 10:34:28 AM3/20/14
to js...@googlegroups.com

There are three ways by which you can send a large message,
1. Use mesage payload TLV in which you can send a message of any length.
2. Use SAR TLVs i.e. sar_msg_refnum, sar_segment_seqnum, sar_total_segments which identifies each segment of a single message properly...
3. Use UDHI i.e. user data header indicator for the same

Gargi Das

unread,
Mar 20, 2014, 11:56:35 PM3/20/14
to js...@googlegroups.com
Hi Amit,

Thanks for your help. Is it not possible that the message delivered with 254 characters after truncating rather than missing the entire message.

Regards,
Gargi

AMIT SINGH

unread,
Mar 21, 2014, 11:49:33 AM3/21/14
to js...@googlegroups.com

Not a single character will be missed with all the options I have specified in previous mail.
You just have to make fragments of a single message e.g. if you want to send a message of 258 characters then devide the message into 2 fragments one fragmebt of 254 character and another with 4 characters (254+4).

Gargi Das

unread,
Mar 23, 2014, 8:33:37 AM3/23/14
to js...@googlegroups.com
Hi Amit,

I've implemented the SubmitMultiSM,SubmitMultiSMResp methods in the code. but still it is showing the error of WronglengthException.

Any idea how to use this?
Attaching the jars and code. Please check once.
Regards,
Gargi
opensmpp-charset-3.0.0.jar
opensmpp-core-3.0.0.jar
SMSConnection.java

AMIT SINGH

unread,
Mar 24, 2014, 10:16:37 PM3/24/14
to js...@googlegroups.com

Hi Gargi,

The SubmitMultiSM is similar to submitSm only, the only difference is using submitMultiSm you can specify multiple recipient for the same message and then it becomes SMSC's responsibility that it should send the same message to all the recipients specified in destination address.

Using SubmitMultiSm won't solve your problem because with this also you can not send a message having length more than 254.

As I have told you earlier, you have to use any one of the option among the options I have explained you in prevuous mail.

Gargi Das

unread,
Mar 29, 2014, 3:02:54 AM3/29/14
to js...@googlegroups.com
Hi Amit,

Can you please tell me how can i make use of the TLV in my code from
the jar files to send message more than 254 characters.
Thanks in advance.
>>>>>>>> ------------------------------
>>>>>>>> *From:* js...@googlegroups.com <js...@googlegroups.com> on behalf
>>>>>>>> of Gargi Das <gargi...@gmail.com>
>>>>>>>> *Sent:* Friday, March 14, 2014 2:23 PM
>>>>>>>> *To:* js...@googlegroups.com
>>>>>>>> *Subject:* Re: Having problem when with bind method
>>>>>>>>
>>>>>>>> Hi Stefan,
>>>>>>>>
>>>>>>>> I checked with the SMSC team . They are telling that when I'm
>>>>>>>> sending sms in a bulk, connections are not getting closed. So when
>>>>>>>> SMSc is
>>>>>>>> having too many open connections it is blocking our port.
>>>>>>>> any suggestions how to handle bulk sms sending in a fraction of
>>>>>>>> second.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Gargi
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Mar 14, 2014 at 3:38 PM, Stefán Þorvarðarson <
>>>>>>>> stef...@siminn.is> wrote:
>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> Is something sent by the SMSC before closing the stream? It seems
>>>>>>>>> that the SMSC is closing the connection after you send a bind
>>>>>>>>> message,
>>>>>>>>> perhaps the SMSC does not accept the bind parameters and simply
>>>>>>>>> closes the
>>>>>>>>> connection. You may need to contact those who handle support for
>>>>>>>>> this SMSC,
>>>>>>>>> they should know what their system doesn't like about the bind
>>>>>>>>> message
>>>>>>>>> .
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> Stefan
>>>>>>>>>
>>>>>>>>> ------------------------------
>>>>>>>>> *From:* js...@googlegroups.com <js...@googlegroups.com> on behalf
>>>>>>>>> of Gargi Das <gargi...@gmail.com>
>>>>>>>>> *Sent:* Friday, March 14, 2014 9:57 AM
>>>>>>>>> *To:* js...@googlegroups.com
>>>>>>>>> *Subject:* Having problem when with bind method

AMIT SINGH

unread,
Mar 29, 2014, 2:33:07 PM3/29/14
to js...@googlegroups.com

Hello Gargi,

In jsmpp jar, you will find a class called optional parameters and as you know while submitting a message one can provide any number of optional parameters.
So using an optinal parameter you can create a TLV I.e. message_payload tlv. This tlv has a constant tag which you can find in smpp specification.
So create an optinal parameter I.e. message payload tlv with specified tag and a value I.e. your long message and its length and add it while submitting the message and make sure that the submitSm should not contain any message in its body the whole message should be present in tlv only.

Reply all
Reply to author
Forward
0 new messages