File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes Using SMS for data push -- how to send an SMS message from the server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Using SMS for data push -- how to send an SMS message from the server" Watch "Using SMS for data push -- how to send an SMS message from the server" New topic
Author

Using SMS for data push -- how to send an SMS message from the server

Nancy Lehrer
Greenhorn

Joined: Aug 28, 2002
Posts: 14
All:
I'm researching the use of Push technology in MIDP 2.0 on the iDEN network to send notifications to our DispatchSuite application that new dispatch data is ready on the server. I am trying *real hard* to avoid reqiring static IPs for our application to work, so I want to use the SMS protocol for the push registration.
The payload of SMS message we need to send is really a non-issue. All we want to do tell the handset to wake up and use it normal http GET mechanisms to get any waiting messages from our server. So there may be a control bit or two, but size is of no consequence.
The question is: what is required to send an SMS message over the iDEN nextwork to our J2ME application?
Do email messages automatically get transfered into SMS messages. So, would an email message to 8051234567@messaging.nextel.com send using the JavaMail API translate to an SMS message when it gets to the phone? And what is the port that I should register from the phone?
Or do I need to use an "SMS broker" such as Simplewire and use the Simplewire SDK.
Thanks in advance for your knowledge,
Nancy Lehrer
JumpStart Wireless


Nancy Lehrer<br />Lead Solutions Architect<br />Amgen Inc.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Email probably would not work since the message is delivered to the native Inbox not the AMS -- there is no port number associated with the message. That also rules out toolkits like jSMS.
Simplewire might work but I have not looked at their APIs for quite a while.
I think the most promising solution is JSR 212, which defines the server side messaging API. Since I am in the expert group, I can tell you that SMS port is quite likely to be supported. Before the JSR 212 comes out, a similar product I would recommend is the Nokia Mobile Server. It goes far beyond SMS messaging. Check it out!The downside of this approach is that the carrier must open their MMSC to you. That could be a real bummer since telecomms are not exactly developer friendly. But you can alsways try.
Another solution is to borrow the idea of jSMS: For small volmue applications, you can use a phone running WMA as the "gateway" device. It is placed at a always-on location and receives data from a network server. Then it pushes SMS messages (with port numbers) to wake up other handsets in the field. Just some ideas here. Let us know what works for you!


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Nancy Lehrer
Greenhorn

Joined: Aug 28, 2002
Posts: 14
Michael:
Yes, JSR 212 seems to be exactly what I need, but alas is there no current implementation of a server-side SMS API?
Our DispatchSuite application is currently in production using a polling model (MIDP 1.0). By the end of this year we will have over 1000 end-users. The JumpStart Wirless DispatchSuite is a serious business application used send and receive work orders and work order data to/from mobile dispatched workers. So where having a phone be a WMA server seems like an interesting approach for a research project, I'm not sure it will scale to our needs. Would we put the phone in our data center ?
The Nokia Mobile Server looks way too heavy - really an app server all of its own. We already have a rather extensive J2EE server-side app (for the Dispatcher and office operations) running on WebLogic and MYSQL.
For the MIDP 2.0 implementation we are targeting the Nextel/Motorola i730 and the new generations of Nokia series 60 phones that will be running MIDP 2.0. I have posted to the Nextel board and will post to the Nokia forum.
Let me know if you think of anything else. I will experiment with the phone-based WMA gateway just for fun. (Hmm, I think I will need to buy another Motorola i730 as I'll need one to test the SMS Push and one for the gateway..)
Nancy
Nancy Lehrer
Greenhorn

Joined: Aug 28, 2002
Posts: 14
All:
I have determined that you need to use an SMS broker such as SimpleWire in order to send an SMS message from a server application to the phone.
Some folks set up their own "SMS server" by thethering a phone to their computer and using AT commands...
The cost to run an SMS message through a broker service varies upon carrier. The carriers charge the broker for sending the message, and the phone user gets charged for receiving the message.
From SimpleWire, Nextel is the least expensive at around 1.5 cents per message and ATT is the most expensive at 8.5 cents per message.
I think I will use sockets to notify my devices :0
Nancy
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Nancy,
Thanks for the update. Glad to know that simplewire supports the features you need. Another alternative is to lease a direct ISDN line to the carrier's SMSC and work with wire-level commands directly (you have to write your own Java wrapper classes over the comm package).
The business negociation and low level programming issues involved here might be too much overhead for most developers.
Roberto Russo
Greenhorn

Joined: May 06, 2004
Posts: 2
Originally posted by Nancy Lehrer:
All:
I'm researching the use of Push technology in MIDP 2.0 on the iDEN network to send notifications to our DispatchSuite application that new dispatch data is ready on the server. I am trying *real hard* to avoid reqiring static IPs for our application to work, so I want to use the SMS protocol for the push registration.
The payload of SMS message we need to send is really a non-issue. All we want to do tell the handset to wake up and use it normal http GET mechanisms to get any waiting messages from our server. So there may be a control bit or two, but size is of no consequence.
The question is: what is required to send an SMS message over the iDEN nextwork to our J2ME application?
Do email messages automatically get transfered into SMS messages. So, would an email message to 8051234567@messaging.nextel.com send using the JavaMail API translate to an SMS message when it gets to the phone? And what is the port that I should register from the phone?
Or do I need to use an "SMS broker" such as Simplewire and use the Simplewire SDK.
Thanks in advance for your knowledge,
Nancy Lehrer
JumpStart Wireless
Roberto Russo
Greenhorn

Joined: May 06, 2004
Posts: 2
Hi Nancy,
I'm researching the use of Push Technology in MIDP 2.0 too.
I have to send an sms to a J2ME application from a J2SE context.
Simplewire let me to do this ? Let me to send an sms on a specific port ? Which kind of protocol does it use?
I need to connect to a UCP gateway of telco and send an sms to "PUSH REGISTRY". Could Simplewire help me ?
Thanks in advance
RR
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Yes, the most recent edition of simplewire allows you to send messages to a specific SMS port on the phone.
Shawn Fitzgerald
author
Greenhorn

Joined: May 07, 2004
Posts: 25
Roberto,
Here is a little more info I got from SimpleWire after looking through the API and docs for some mention of the port information. Oh and along my journey I found that this bit of information we have all been in search of is the UDH. (UserDefinedHeader) and looks something like
udh=060504xxxxyyyy where xxxx is the receive port no the phone and yyyy is the outbound port from the phone. (In most cases for pushregistry you only care about xxxx)
Of course SimpleWires API makes it all a lot easier than encoding this as an SMPP message. Here is those notes that I received earlier today.
---------------- message text from email ------------
The API documentation does not yet have those features explained, but the software does have the features. Make sure you've followed these steps:
1. Verify you have the latest Java SMS SDK from Simplewire. Only the latest version has the features you need. You can download it at http://www.simplewire.com/developers/sdk/java/
2. Navigate to the "Examples" directory included with the software download. Open up the "send_text.java" example code. There are 3 commented out lines. You would need to uncomment those lines to enable sending a text message to a specific port on the phone.
Text messages are not sent to a specific port by default. Applications on the phone bind to a specific port, and if no application is bound, then the default handler is the "Text Message Inbox".
You won't be able to test this feature without a commercial or demo account from Simplewire. Please follow the directions on our site about how to activate demo credits. You can contact Simplewire sales for information about getting a commercial account. You can contact Simplewire sales at:
http://www.simplewire.com/contact/sales/
----------------- end of message ----------
The lines that are mentioned here are these.....I think.
//sms.setSourcePort((short)0x0000);
//sms.setDestPort((short)0x0000);
--> comments are here with some basic info.
// sms.setNetworkType(SMS.NETWORK_TYPE_GSM);
So you uncomment those and tada you should have it working. I'll be
testing this very soon and will provide info on results.
Best Wishes
-Shawn
Mark Greene
Greenhorn

Joined: Apr 07, 2004
Posts: 18
Hi Nancy,
I just updated another thread on this board (called "SMS port numbers..") which I think should help you find a solution.
I'm using jSMS (from objectxp.com) to send sms's which specify the destination port on your target device - this in combination with using the push technology to wake up your midlet sounds like it will do the job for you.
An advantage of using jSMS (and not something like simplewire) is that it doesn't care what network you are with (otherwise, as I understand it, you have to purchase sms's in bundles from simplewire).
I am using jSMS with the Vodafone network here in Ireland but I could just as easily just pop in (to my GSM Modem) another SIM card from a different network provider.
Mark
Shawn Fitzgerald
author
Greenhorn

Joined: May 07, 2004
Posts: 25
Mark,
I've been testing some of the various SMS services such as RedCoal, Clickatell, PhoneCaster and (getting ready to test) SimpleWire. From all these others I've found you can route messages to any network. I'm in the US, and have a Sprint and ATT account and was able to use the same API on PhoneCaster to send my message to either or both phones. I'm also able to send from one phone to another.
While jSMS is great if you have the ability to hook up a dedicated cellular device onto your server. But I like the ASP model where they handle scaling and load on the cellular network. Nokia has a great device (Cellular Terminal 31) an M2M device dedicated for jSMS type use.
Question: Have you tested any type of loads on jSMS? If so how does it perform? any idea of max# of messages/sec? Is there a way to have 2 or 3 devices managed by jSMS as a service
and have it handle load balancing?
Thanks for the info Mark
-Shawn
Shawn Fitzgerald
author
Greenhorn

Joined: May 07, 2004
Posts: 25
Update on the SimpleWire API. Looks like there is an API problems. In the Example the 3 lines
to be uncommented included one that stated "sms.setNetworkType(SMS.NETWORK_TYPE_GSM);".
well that doesn't compile. After some reflection on the topic....literally.
I've found that the call should have been to "sms.setOptNetworkType(SMS.NETWORK_TYPE_GSM);".
However I'm not sure as I bought the demo test messages but they have to manually approve my
payment which could be up to 3 days (But I hope it will be less). Just got an email to confirm
payment info so the process is moving forward. Hopefully will get word soon. <FingersCrossed/>

-Shawn
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Thanks for keeping us posted, Shawn


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Shawn Fitzgerald
author
Greenhorn

Joined: May 07, 2004
Posts: 25

Got a message to launch my test app. So what through me was the wording of Source /Destination. You know from where you are depends on what these mean.
Now looking back at notes from a nowsms user forum I realized I had them backwards in
my mind. (not tough to do) So Destination is the phone, source is where it comes from.
The UDH is specified as "udh=060504xxxxyyyy", and the xxxx are defined as the destination
port. Once that was corrected bingo message come through and app launched as expected.
SSSWWWWEEEEEEEEEEEEEETTTTT!!!
Side note: I'm using a V600 on AT&T (Midp2.0 WMA and PushRegistry support) and
while talking on the phone the app was started. None of the Spec for phones or WMA
stated how this would work. So at least for the v600 this is known.
This one a question I had for my current project so figured others might want to know.
Anyone else find a service that supports this port assignment feature?
Best of luck to the rest of ya.
-Shawn
Mark Greene
Greenhorn

Joined: Apr 07, 2004
Posts: 18
Originally posted by Shawn Fitzgerald:

While jSMS is great if you have the ability to hook up a dedicated cellular device onto your server. But I like the ASP model where they handle scaling and load on the cellular network. Nokia has a great device (Cellular Terminal 31) an M2M device dedicated for jSMS type use.
Question: Have you tested any type of loads on jSMS? If so how does it perform? any idea of max# of messages/sec? Is there a way to have 2 or 3 devices managed by jSMS as a service
and have it handle load balancing?
-Shawn

You make a good point as regards the fact that I am not in a situation with a very heavy load of texts being received or sent.
I am using jSMS hooked up to a Siemens TC 35 GSM Modem. When you invoke their 'send' method you are looking at about a three/four second wait to send an sms via the modem.
You can certainly use two or 3 devices with jSMS altho bear in mind that would require a comm port for each device (or something like a
paralell->serial cable). Any load balancing logic would have to be written by yourself I'm afraid.
Shawn my *next* project involving sms's will involve *high* volumes of sms's being recieved similtaneously on a java server - I'd love to know (and hopefully you can update this thread) if you decided which 'ASP Model' -esque solution you recomend based on your current testing.
cheers,
Mark
Shawn Fitzgerald
author
Greenhorn

Joined: May 07, 2004
Posts: 25
Hey Mark here's that update.

Well as with most things the more effort you put into building it yourself the cheaper
you can get it. So having said that here is what I have found.

SimpleWire - (US) about the easiest to implement, good API, (needs a little work on the docs, but who am I to talk ;-)

PhoneCaster - (US) No port assignment support but AWSOME SMS service.

SMS2Email - (UK) HTTP based service with port assignment

RedCoal.com - (UK) HTTP based service port assignement support unknown

ClickaTel - (S.Africa) Just about every Protocol you can image. Don't know how their docs of the API are but saw some examples. And has Port Assignment.

SimpleWire appears to be one of the only service providers with a Java API, the rest are a roll your own.

Depending on your market may influence your decision as well as your budget.
SimpleWire - simple but pricey...good service. Fast SMS delivery during peak hours (about 10sec), but is based in US market.
PhoneCaster - also a US based provider and similar response time to simple wire.
Other provider are not US based, and times can drag up to 20sec for SMS delivery in Peak Hours.
But read carefully about service areas. It costs more for UK providers to send SMS into the US market.

Those are my rough notes. I'm putting some more stuff together but it may be a while before it's
ready.

Have fun.
-Shawn
Benjamin Betancourt
Greenhorn

Joined: Jan 21, 2005
Posts: 2
Originally posted by Michael Yuan:
Email probably would not work since the message is delivered to the native Inbox not the AMS -- there is no port number associated with the message. That also rules out toolkits like jSMS.

Simplewire might work but I have not looked at their APIs for quite a while.

I think the most promising solution is JSR 212, which defines the server side messaging API. Since I am in the expert group, I can tell you that SMS port is quite likely to be supported. Before the JSR 212 comes out, a similar product I would recommend is the Nokia Mobile Server. It goes far beyond SMS messaging. Check it out!The downside of this approach is that the carrier must open their MMSC to you. That could be a real bummer since telecomms are not exactly developer friendly. But you can alsways try.

Another solution is to borrow the idea of jSMS: For small volmue applications, you can use a phone running WMA as the "gateway" device. It is placed at a always-on location and receives data from a network server. Then it pushes SMS messages (with port numbers) to wake up other handsets in the field. Just some ideas here. Let us know what works for you!
Benjamin Betancourt
Greenhorn

Joined: Jan 21, 2005
Posts: 2
I am new to J2ME and I wanted to ask where the best place would be to start. I have taken a class in Java, however I have NO IDEA how to start or write a J2ME program.

Currently, I am working on a software application that will grab GPS data from a Motorola i830 phone, then send the GPS location to a server. Where do I begin, how can i get help? Please reply. I need to get this project done to graduate from college. Thanks
Alec Swan
Ranch Hand

Joined: Feb 03, 2005
Posts: 39

Greetings all.

Based on Shawn's investigation it seems that the SMS brokers he found would be a good implementation solution for a proven idea. However, I am sure there are a lot of developers who would want to try their ideas out before investing in SMS broker services or products. Hence the question below

I am working on a new MIDlet, which sends SMS messages to my Java application, which runs on my server on a particular port. I would like to test the MIDlet functionality before purchasing SMS broker services. As far as I can tell the only way to do this is to use a GSM modem connected via a serial port to my server. Are there any other alternatives?

Also, what GSM modem would you recommend and what featured do I need to look for when choosing one?

I assume I would need an SMS gateway to connect my GSM modem and Java application. What SMS gateways would you suggest to use to forward SMS messages received by the GSM modem to a particular port on my server?

Thanks.

P.S. This has been a great thread and I wish I could watch/subscribe to it. You got my vote for adding "Watch This Thread" functionality to this list
Topgun Hassan
Greenhorn

Joined: Nov 18, 2004
Posts: 4
Hi Nancy,

I was creating an application to send alert news to mobile devices. I tested Sever Push TCP/IP Connection with midlet but it doesnt seems a viable soln as the IP addresses are assigned dynamically to mobile devices, so dificult to track mobiles IP address.
Now i found your discussion regarding SMS server push and sounds appealing (as it goes straight to the fone number which is definite).
It will be great if you can share your knowledge by posting relevant info/urls and sample code(it will give jump start) for new commers.

My Id is: hamidhsn@gmail.com

Thanks in advance

Regards
Hamid


Hassan
JPV Mobile
Greenhorn

Joined: Nov 30, 2005
Posts: 1
Do you guys know if Nextel supports sending SMS with port number? It doesn't seem like it. I got the following error after trying out Shawn's suggestion with SimpleWire:

Sending message to Simplewire...
Message was not sent!
Error Code: 388
Error Description: Smart or custom messaging is not supported for this carrier.
Error Resolution:
Krishna Latha Grandhi
Ranch Hand

Joined: Nov 08, 2005
Posts: 110
Hi friends,

I am new to J2ME. I have to send sms to GSM and CDMA mobiles. Please Explain the process to do this project.

Thanks in advance.

Regards
krishna.
Krishna Latha Grandhi
Ranch Hand

Joined: Nov 08, 2005
Posts: 110
I have to send sms through web
William Frantz
Ranch Hand

Joined: Dec 08, 2004
Posts: 102
Originally posted by Hari Krishna:
I am new to J2ME. I have to send sms to GSM and CDMA mobiles. Please Explain the process to do this project. I have to send sms through web.
If you are sending messages through a web server, you don't need anything written in J2ME. Most carriers maintain a website for sending messages to their subscribers. For example, this is Sprint's: http://messaging.sprintpcs.com. This is Cingular's: http://www.cingularme.com/do/public. Here is Verizon's: http://www.vtext.com.

Another alternative is to use an email-to-SMS gateway. For example, send a message to 8005551212@messaging.sprintpcs.com and Sprint will forward the message as an SMS to 800-555-1212.

Finally, you could use an email-to-SMS aggregator service like Teleflip. Just send email to 8005551212@teleflip.com and they will forward it as a text message to the appropriate carrier.

William Frantz
http://sprintdevelopers.com
[ December 06, 2005: Message edited by: William Frantz ]
lekkie Nakel
Greenhorn

Joined: Jan 23, 2007
Posts: 15
I tried sending sms from the simplewire java api.

I had my port number set by calling sms.setDestPort((short)0x1388); which is the hexadecimal form of 5000.

I listened on sms://:5000 by doing this serverConn = (MessageConnection)Connector.open(sms://:5000);
serverConn.setMessageListener(this); but I dont seem to be getting anything. I guess the text message comes in on a port, but I am not sure of the port, cause when the text comes in, my phone does not play its ringtone for text message, in fact, the text msg icon do not show on my wallpaper. But I dont seem to be able to get it.

I am suspecting 2 two things. Either I am not sending to port 5000 or I need to do make some jad settings? Pls, I will appreciate other necessary things I can do.
[ February 16, 2007: Message edited by: lekkie Nakel ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using SMS for data push -- how to send an SMS message from the server
 
Similar Threads
Any Way To Send SMS through Java
J2ME question: Can I do this with the Push Registry
ConnectionNotFoundException
bluecove problem
SMS port numbers (possibly FAO M. Yuan?)