java api for kannel sms_wap gateway v 1.0

4

Upload: zembecisse

Post on 28-Oct-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Java API for Kannel SMS_WAP Gateway v 1.0

05/02/13 Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks

www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html 1/4

RSS Email Follow us Become a fan

Search this site...

You are here: Home Communications Java API for Kannel SMS/WAP gatew ay v 1.0.2 released

About Byron Kiourtzoglou

Byron is a master software engineer working in the IT and Telecom domains. He is always fascinated by SOA, middlewareservices 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 releasedPublished on May 24, 2010 | 4,581 view s | Filed in: Communications Tags: Java API for Kannel

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 :

Carrer Opportunities

Join Us

264,922 Jan unique visitors 264,922 Jan unique visitors

Do you have a blog with unique and interesting

content? Then, check out our

program. You can also be a

Code Geeks

Tags

Akka Android Tutorial Apache Camel

Apache Maven Apache Tomcat

Big Data Books Cache Cloud

Design Patterns EclipseGoogle Guava Google GWT

JavaFX JavaOne

JBoss Hibernate JPA

JVM Logging MapReduce

Performance Performance and Scalability

Play Framework Project Management

01 public static void main(String[] args) {02 03 SMSManager smsManager = SMSManager.getInstance();04

05 // We can change the prefetch size of the background worker thread06 smsManager.setMessagesPrefetchSize(30);07 08 // We can change the send message rate09 smsManager.setMessagesSendRate(65);10 11 try {12 13 // Send SMS to a single destination14 smsManager.sendSMS("localhost", "13013", "foo", "bar", "sender_mobile_number",

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

"receiver_mobile_number", "the_message", SMSManager.MESSAGE_PRIORITY_3);18 19 // Send SMS to multiple recipients

20 List<String> recipientsGroupA = new ArrayList<String>();21 recipientsGroupA.add("receiver_mobile_number_1");22 recipientsGroupA.add("receiver_mobile_number_2");23 recipientsGroupA.add("receiver_mobile_number_3");24 recipientsGroupA.add("receiver_mobile_number_4");25 recipientsGroupA.add("receiver_mobile_number_5");26 smsManager.sendSMS("localhost", "13013", "foo", "bar", "sender_mobile_number", recipientsGroupA,

"the_message");27 28 // Send SMS to multiple recipients with a specific priority and send rate29 List<String> recipientsGroupB = new ArrayList<String>();30 recipientsGroupB.add("receiver_mobile_number_1");31 recipientsGroupB.add("receiver_mobile_number_2");32 recipientsGroupB.add("receiver_mobile_number_3");33 recipientsGroupB.add("receiver_mobile_number_4");34 recipientsGroupB.add("receiver_mobile_number_5");35 smsManager.sendBulkSMS("localhost", "13013", "foo", "bar", "sender_mobile_number",

recipientsGroupB, "the_message", SMSManager.MESSAGE_PRIORITY_7);36 37 // Send a WAP Push request to a single mobile recipient38 smsManager.sendWAPPush("localhost", "8181", "receiver_mobile_number",

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

SMSManager.WAP_PUSH_RECEIVER_TYPE_MOBILE, "the_message", "http://localhost", 3,SMSManager.MESSAGE_PRIORITY_8);

42 43 // Send WAP Push request to multiple recipients with a specific priority and send rate44 List<String> recipientsGroupC = new ArrayList<String>();45 recipientsGroupC.add("receiver_mobile_number_1");46 recipientsGroupC.add("receiver_mobile_number_2");47 recipientsGroupC.add("receiver_mobile_number_3");48 recipientsGroupC.add("receiver_mobile_number_4");49 recipientsGroupC.add("receiver_mobile_number_5");50 smsManager.sendBulkWAPPush("localhost", "8181", recipientsGroupC,

SMSManager.WAP_PUSH_RECEIVER_TYPE_MOBILE, "the_message", "http://localhost", 3,SMSManager.MESSAGE_PRIORITY_8);

51 52 } catch (Exception ex) {

Mid / Senior Java Developer – Omnisource

Technologies – United States ( FULL-TIME )

January 29, 2013

Java Developer – Piper Enterprise Solutions –

Raleigh, NC ( FULL-TIME )

Java Developer – Ten Mile Square Technologies

– Washington, DC ( FULL-TIME )

2013

Java Developer – CARFAX –

FULL-TIME ) January 27, 2013

Java Developer – Elite Associates –

Home JCG W4G Software Resources Tutorials Examples Jobs Advertising About JCGs

Java Android JVM Languages Software Development Agile DevOps Communications Career Misc Meta JCG

Page 2: Java API for Kannel SMS_WAP Gateway v 1.0

05/02/13 Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks

www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html 2/4

Where do the stack

traces come from?

Using

Hudson/Jenkins to

diagnose that

intermittent failure

JMX : Some

Introductory Notes

Dynamic ADF

Train: Adding train

stops

programmatically

Spring –

Persistence layer –

writing entities and

...

Best Regards

Justin

Related articles :

Kannel encoding clarifications

Java API for Kannel SMS/WAP gateway

Java API for Kannel SMS/WAP gateway v 1.0.1 released

You might also like:

LinkWithin

RESTful Web Services

Spring Spring MVC

Testing

52 } catch (Exception ex) {53 ex.printStackTrace();54 }55 56 // Stops the background worker.57 // smsManager.stopSMSManagerWorker();58 59 }

222222222 111111111

Page 3: Java API for Kannel SMS_WAP Gateway v 1.0

05/02/13 Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks

www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html 3/4

4 comments

What's this?RECOMMENDED CONTENTALSO ON JAVA CODE GEEKS

Tacos, Tragedy, Testosterone: Watch Episode 1 ofComedy Central's New Show Comedy Central

8 Ways To Lose Money On Bonds Investopedia

Kim Kardashian's Stunning Mini-Dress From the RedCarpet Style Bistro

That '70s Show' Star Lisa Robin Kelly Arrested AGAIN& the Mugshots Keep Getting Worse CafeMom

40 Java Collections Interview Questions andAnswers 4 comments

One jar to rule them all 5 comments

Scala: Collections 1 2 comments

The builder pattern in practice 1 comment

Leave a message...

DiscussionDiscussion CommunityCommunity ##ShareShare

• Reply •

Jus tin Cater • 2 years ago

Hello Sándor,

Yes it will support receiving SMS in the upcoming version, so stay tuned!

BRs

0 △ ▽

• Reply •

Sándor Norbert • 2 years ago

Hello!

Will it support receiving of SMS?

Thanks!

0 △ ▽

• Reply •

Jus tin Cater • 2 years ago

Hello Josue,

Either a SMSPushRequestException or a WAPPushRequestException will be thrown to your client if Kannel returns

an invalid response code (other than 0 for SMS and 1001 for WAP Push). Both Exceptions contain the code of Kannel

response. As far as the delivery report, this version does not implement delivery report handling. Nevertheless we

plan to add it in the near future, so stay tuned!

BRs

0 △ ▽

• Reply •

jos ue • 2 years ago

Excellent post, I have a question ..... maybe I could help

-> How could I know if the message was sent to Kannel was successful

-> How could I know if the message was sent from Kannel to the carrier received a satisfactory result

Thank you very much for your help.

0 △ ▽

Com m ent feedr Subs cribe via em ai lm

0★

Share ›

Share ›

Share ›

Share ›

Knowledge BaseKnowledge Base PartnersPartners

The Code Geeks NetworkThe Code Geeks Network

Hall Of FameHall Of Fame About Java Code GeeksAbout Java Code Geeks

JCGs (Java Code Geeks) is an independent online community focused on

creating the ultimate Java to Java developers resource center; targeted at the

technical architect, technical team lead (senior developer), project manager and

junior developers alike. JCGs serve the Java, SOA, Agile and Telecom

communities with daily news written by domain experts, articles, tutorials, reviews,

announcements, code snippets and open source projects.

LicenseLicense

This work by Java Code GeeksJava Code Geeks is licensed under a Creative CommonsCreative Commons

Attribution-ShareAlike 3.0 Unported LicenseAttribution-ShareAlike 3.0 Unported License.

ExamplesExamples

ResourcesResources

SoftwareSoftware

Java Code GeeksJava Code Geeks

.NET Code Geeks.NET Code Geeks

“Android Full Application Tutorial” series“Android Full Application Tutorial” series

GWT 2 Spring 3 JPA 2 Hibernate 3.5 TutorialGWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial

Android Game Development TutorialsAndroid Game Development Tutorials

Android Google Maps TutorialAndroid Google Maps Tutorial

Android Location Based Services ApplicationAndroid Location Based Services Application

– GPS location– GPS location

Funny Source Code CommentsFunny Source Code Comments

Java Best Practices – Vector vs ArrayList vsJava Best Practices – Vector vs ArrayList vs

HashSetHashSet

Android JSON Parsing with Gson TutorialAndroid JSON Parsing with Gson Tutorial

Page 4: Java API for Kannel SMS_WAP Gateway v 1.0

05/02/13 Java API for Kannel SMS/WAP gateway v 1.0.2 released | Java Code Geeks

www.javacodegeeks.com/2010/05/java-api-for-kannel-smswap-gateway-v_24.html 4/4

© 2010-2012 Java Code Geeks. Licenced under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective ow ners.

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.

Android JSON Parsing with Gson TutorialAndroid JSON Parsing with Gson Tutorial