sungsilnom / jsmpp

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

Cannot Connect and Bind #110

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I am having problems to ConnectAndBind. Getting error response:
java.io.IOException: Waiting bind response take time to long: No response after 
waiting for 60000 millis when executing bind with sessionId e6c55ae3 and 
sequenceNumber 1

Note: I am using windows 2008 server. On it I have installed glassfish server 
using JDK 7.

Please help me.

Thanks

Original issue reported on code.google.com by deepak.b...@gmail.com on 16 Aug 2011 at 11:15

GoogleCodeExporter commented 8 years ago
Are u sure there are SMPP server/SMSC listening?

Original comment by uuda...@gmail.com on 17 Aug 2011 at 3:06

GoogleCodeExporter commented 8 years ago
Yes we have a SMSC listing to smpp connection. When I use same connection 
details using my existing smpp client it works. But when I plug in the values 
with JSMPP it does not.

This is my function used from example provided:

    public static boolean sendMessage(){
        SMPPSession session = new SMPPSession();

        try {
            System.out.println("Trying to connect smpp...");            
            session.connectAndBind("172.22.227.10", 2775, new BindParameter(BindType.BIND_TRX, "TESTSMPP", "TESTSMPP", "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));
            System.out.println("SMPP connected.");
        } catch (IOException e) {
            System.err.println("Failed connect and bind to host");
            e.printStackTrace();
            //return false;
        }

        // Set listener to receive deliver_sm
        System.out.println("Setting listner...");
        session.setMessageReceiverListener(new MessageReceiverListenerImpl());
        System.out.println("Listner configured.");
        try {
            System.out.println("Trying to send...");
            String messageId = session.submitShortMessage("CMT", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "+6799998246", new ESMClass(), (byte)0, (byte)1,  timeFormatter.format(new Date()), null, new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE), (byte)0, new GeneralDataCoding(false, true, MessageClass.CLASS1, Alphabet.ALPHA_DEFAULT), (byte)0, "jSMPP simplify SMPP on Java platform".getBytes());
            System.out.println("Sent");
            //System.out.println("msg id: "+messageId);
            /*
             * you can save the submitted message to database.
             */

            System.out.println("Message submitted, message_id is " + messageId);
        } catch (PDUException e) {
            // Invalid PDU parameter
            System.err.println("Invalid PDU parameter");
            e.printStackTrace();
            return false;
        } catch (ResponseTimeoutException e) {
            // Response timeout
            System.err.println("Response timeout");
            e.printStackTrace();
            return false;
        } catch (InvalidResponseException e) {
            // Invalid response
            System.err.println("Receive invalid respose");
            e.printStackTrace();
            return false;
        } catch (NegativeResponseException e) {
            // Receiving negative response (non-zero command_status)
            System.err.println("Receive negative response");
            e.printStackTrace();
            return false;
        } catch (IOException e) {
            System.err.println("IO error occur");
            e.printStackTrace();
            return false;
        }

        session.unbindAndClose();
        return true;
    }

Original comment by deepak.b...@gmail.com on 17 Aug 2011 at 10:54

GoogleCodeExporter commented 8 years ago
Quite strange.. have you try to capture the packet using wireshare.
Compare the packet between your existing smpp client vs jsmpp

Original comment by uuda...@gmail.com on 18 Aug 2011 at 2:38

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Also have this issue, but in my case I am going through a ssh tunnel to be able 
to access the provider outside our firewall. Sometimes it works, other times it 
doesn't. Wondering if the provider is too busy or something. 

Original comment by rapa...@gmail.com on 20 Feb 2013 at 7:00

GoogleCodeExporter commented 8 years ago
Did you ever solve this problem? I'm expiriencing the same problem

Original comment by eric.itz...@gmail.com on 15 Aug 2013 at 7:52