pmontano / jsmpp

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

Connect exception with a connection timeout #91

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, my application is using jsmpp and needs to send an SMS via smsc located 
remotely. My machine is CentOS.
The steps are:
1. connect and authenticate with the host
2. send the sms ( According to the sample provided )
But before I can even connect, there is an exception on Timeout.
I have added the source.
Thank you for your help !

BasicConfigurator.configure();
        //creating session 
        SMPPSession session = new SMPPSession();
        try {
            System.out.println("Connect and bind to " + host + " port " + port);
            session
                    .connectAndBind(host, port, new BindParameter(
                            BindType.BIND_TX,
                            login, 
                            password, 
                            null,
                            TypeOfNumber.UNKNOWN,
                            NumberingPlanIndicator.UNKNOWN, 
                            null));
        System.out.println("Success  connect and bind to host");    
        } catch (IOException e) {
            // Failed connect and bind to SMSC
            System.err.println("Failed connect and bind to host");
            e.printStackTrace();
        }
        //creating and sending message

        try {
            String messageId = session.submitShortMessage(
                    "CMT",
                    TypeOfNumber.UNKNOWN, 
                    NumberingPlanIndicator.ISDN,
                    senderId, // phone number
                    TypeOfNumber.INTERNATIONAL,
                    NumberingPlanIndicator.ISDN, 
                    phoneNum,
                    new ESMClass(), 
                    (byte) 0, 
                    (byte) 1, 
                    timeFormatter.format(new Date()),
                    null,
                    new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT),
                    (byte) 0,
                    null,  
                    (byte) 0,
                    "SMPP  Test".getBytes());
            System.out.println("Message submitted, message_id is " + messageId);

Original issue reported on code.google.com by igorshpr...@gmail.com on 12 Jan 2011 at 5:14

GoogleCodeExporter commented 8 years ago
Ya,I also getting the same ERR....When connecting And Binding.
So....Thank You for Your Help!

Original comment by devonrav...@gmail.com on 4 Nov 2013 at 8:02