Page 1 of 2 12 LastLast
Results 1 to 20 of 22
  1. #1
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default how to send sms via smpp

    Hi, please anyone help me where i can study to write a programe which can send sms via smpp connection .

    Thanks in advanced,
    Uthpala

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    I wonder that you've try to find related stuff on the web. ;)

    Anyway, if you could go through the JSMPP API then this is not a difficult task.

    jsmpp - Project Hosting on Google Code

  3. #3
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    yes, i refered this api and i went through the smpp api as well, but unfortunately still i couldn't understand these stuff, i couldnt find any place where it guides us to code, i'm sorry i'm very new to this field.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    I think that the API has some example code. And I agreed with you that related sample code and guidance are bit difficult to found, because pear-to-pear is not heavily used.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  6. #6
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    Thanks a lot for your help, but i'm not using kannel, we have a vpn connected with smsc and all i need to do is bind my app with the smsc and send the message to smsc.

  7. #7
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    Java Code:
    String host = "hostip";
            int port = 0000;
            SMPPSession session = new SMPPSession(); // exception caught
            try {
                System.out.println("Connect and bind to " + host + " port " + port);
                session.connectAndBind(host, port, new BindParameter(BindType.BIND_TRX, "test", "test", "cp", null, null, null));
            } catch (IOException e) {
                // Failed connect and bind to SMSC
                System.err.println("Failed connect and bind to host");
                e.printStackTrace();
            }
            try { Thread.sleep(10000); } catch (InterruptedException e) {}
            session.unbindAndClose();
        }
    i just tried this small code, i'm getting
    Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at org.jsmpp.session.AbstractSession.<clinit>(Abstrac tSession.java:51)

    but i have addedsmpp.jar/log4j-1.2.14.jar/jsmpp-2.1.0.jar to the class path

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  9. #9
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    yes, they hav given the ip, username, password and a port

    connection is working we can telnet the relevant port

  10. #10
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  11. #11
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    yes, i did , as i mention above in my previous post

  12. #12
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  13. #13
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    yeah,... but u have any idea abt missing package ?

  14. #14
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    According to the reference path that should be in jsmpp-2.1.0.jar, and you said you import it too to the class-path. That's why I'm confused.

    You can try one more thing, even it's annoying. Rather adding them to the class-path can you add them to your project and build (hope you are working on an IDE)

  15. #15
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    yeah.., i'm using eclipse and i have imported the relevant jar files to the project. i'm creating the project jar file manually and i run that jar file in the test server which has the connectivity with the smsc.

  16. #16
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  17. #17
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    u need to add these ,

    slf4j-api-1.4.3.jar
    slf4j-log4j12-1.4.3.jar

  18. #18
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    now i can bind my app with smsc, but i'm getting negative response. any idea about it ?

  19. #19
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  20. #20
    uthpalaw is offline Member
    Join Date
    Mar 2010
    Posts
    68
    Rep Power
    0

    Default

    Java Code:
    org.jsmpp.extra.NegativeResponseException: Negative response 0000000e found
            at org.jsmpp.session.AbstractSession.validateResponse(AbstractSession.ja
    va:215)
    This is the exception wht i got.

Page 1 of 2 12 LastLast

Similar Threads

  1. how to send picture message sms using smpp in java
    By manishsuvasiya in forum Advanced Java
    Replies: 2
    Last Post: 11-22-2010, 05:34 AM
  2. how to send picture message using smpp in java
    By manishsuvasiya in forum New To Java
    Replies: 1
    Last Post: 11-16-2010, 05:25 AM
  3. Replies: 10
    Last Post: 06-06-2010, 06:49 PM
  4. how to send sms
    By islam in forum Eclipse
    Replies: 5
    Last Post: 03-16-2010, 11:57 AM
  5. SMS Solutions on GSM and SMPP
    By smany in forum Introductions
    Replies: 2
    Last Post: 07-10-2007, 02:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •