Byron Kiourtzoglou

About Byron Kiourtzoglou

Byron is a master software engineer working in the IT and Telecom domains. He is always fascinated by SOA, middleware services and mobile development. Byron is co-founder and Executive Editor at Java Code Geeks.

Java API for Kannel SMS/WAP gateway v 1.0.2 released

Hello all, we released version 1.0.2 of Java API for Kannel SMS/WAP gateway.

The latest version introduces prioritized WAP Push functionality and bulk WAP Push messaging.

You can download the new version here

An example use of the API is shown below :

public static void main(String[] args) {

 SMSManager smsManager = SMSManager.getInstance();

 // We can change the prefetch size of the background worker thread

 // We can change the send message rate

 try {

  // Send SMS to a single destination
  smsManager.sendSMS("localhost", "13013", "foo", "bar", "sender_mobile_number", "receiver_mobile_number", "the_message");

  // Send SMS to a single destination with a specific priority and send rate
  smsManager.sendSMS("localhost", "13013", "foo", "bar", "sender_mobile_number", "receiver_mobile_number", "the_message", SMSManager.MESSAGE_PRIORITY_3);

  // Send SMS to multiple recipients
  List<String> recipientsGroupA = new ArrayList<String>();
  smsManager.sendSMS("localhost", "13013", "foo", "bar", "sender_mobile_number", recipientsGroupA, "the_message");

  // Send SMS to multiple recipients with a specific priority and send rate
  List<String> recipientsGroupB = new ArrayList<String>();
  smsManager.sendBulkSMS("localhost", "13013", "foo", "bar", "sender_mobile_number", recipientsGroupB, "the_message", SMSManager.MESSAGE_PRIORITY_7);

  // Send a WAP Push request to a single mobile recipient
  smsManager.sendWAPPush("localhost", "8181", "receiver_mobile_number", SMSManager.WAP_PUSH_RECEIVER_TYPE_MOBILE, "the_message", "http://localhost", 3);

  // Send a WAP Push request to a single destination with a specific priority and send rate
  smsManager.sendWAPPush("localhost", "8181", "receiver_mobile_number", SMSManager.WAP_PUSH_RECEIVER_TYPE_MOBILE, "the_message", "http://localhost", 3, SMSManager.MESSAGE_PRIORITY_8);

  // Send WAP Push request to multiple recipients with a specific priority and send rate
  List<String> recipientsGroupC = new ArrayList<String>();
  smsManager.sendBulkWAPPush("localhost", "8181", recipientsGroupC, SMSManager.WAP_PUSH_RECEIVER_TYPE_MOBILE, "the_message", "http://localhost", 3, SMSManager.MESSAGE_PRIORITY_8);

 } catch (Exception ex) {

 // Stops the background worker.
 // smsManager.stopSMSManagerWorker();


Best Regards


Related articles :
Related Whitepaper:

Java Essential Training

Author David Gassner explores Java SE (Standard Edition), the language used to build mobile apps for Android devices, enterprise server applications, and more!

The course demonstrates how to install both Java and the Eclipse IDE and dives into the particulars of programming. The course also explains the fundamentals of Java, from creating simple variables, assigning values, and declaring methods to working with strings, arrays, and subclasses; reading and writing to text files; and implementing object oriented programming concepts. Exercise files are included with the course.

Get it Now!  

12 Responses to "Java API for Kannel SMS/WAP gateway v 1.0.2 released"

  1. Xander says:

    Hi Justin,

    Can you please explain the steps required to configure the API. What all needs to be deployed on local machine on the port 13013 and all. I try to ran this example but as port 13013 on my local machine was not being listened by any program the socket connection failed.


  2. Mitesh Patel says:

    Can you tell me how to use a send sms function with DLR..

  3. Albert says:

    Please help me!
    I use:

    // Send a WAP Push request to a single mobile recipient
    smsManager.sendWAPPush(“localhost”, “8181″, “receiver_mobile_number”, SMSManager.WAP_PUSH_RECEIVER_TYPE_MOBILE, “the_message”, “http://localhost”, 3);

    My errors: http://localhost:8080/wappush
    at Source)
    at com.javacodegeeks.kannel.api.SMSManager.sendWAPPush(
    at com.javacodegeeks.kannel.api.SMSManager.sendWAPPush(


    • Albert says:

      Sorry, I’m using:
      // Send a WAP Push request to a single mobile recipient
      smsManager.sendWAPPush(“localhost”, “8080″, “receiver_mobile_number”, SMSManager.WAP_PUSH_RECEIVER_TYPE_MOBILE, “the_message”, “http://localhost”, 3);

  4. raju says:

    HI ,

    I am kannel sms API in my java application
    smsManager.sendSMS(“localhost”, “9080″, “foo”, “bar”, “send_number”, “rec_number”, “Hi Test”);

    I am getting below exception Connection refused: connect.

    please help to configure kannel sms api.


  5. kishore says:

    1)Send SMS with priority is not been sent to the SMPPsim that has been configured. SMS send without priority are submitted to the SMSC with no issues. Can anyone revert back on this, as on what need to be done to submit sms with priority.

    2)How to get the delivery status if the submitted message from this program to the kannel router?


  6. hemanth says:

    hi how can i get replay message (MO) from this api

Leave a Reply

6 − two =

Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

20,709 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books