Read messages from gsm modem inbox using java programe

Read messages from gsm modem inbox using java programe SearchSearch
Author Message
Aniket Kumbhoje
New member
Username: Aniket1100

Post Number: 1
Registered: 03-2013
Posted on Wednesday, March 20, 2013 - 03:14 pm:   

I am working on j2ee application. This is a question answering forum where user asks question and we provide answer to that question.
So i have ready with the code to reply the answer,but the problem is i can't able to read the question from gsm modem inbox.
So kindly help me to read message from gsm modem inbox.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4320
Registered: 08-2008
Posted on Wednesday, March 20, 2013 - 06:01 pm:   

Hi,

Are you using NowSMS? (I assume so as you are posting in our support forum.)

When NowSMS receives an SMS message, it can be configured to connect to an HTTP URL and pass details about the received message via URL parameters. The application that processes this HTTP request can either specify the reply text in the HTTP response, or it can generate a new HTTP request to send one or more messages.

(Instead of using HTTP, a command line interface is also available.)

We call this 2-way SMS and there are a variety of links on our web site with more information, such as:

http://www.nowsms.com/doc/2-way-sms-support
http://www.nowsms.com/faq/api

As a simple example, you could configure the following 2-way command:

http://server:port/path?sender=@@SENDER@@&message=@@FULLSMS@@

If NowSMS receives a text message from 1234567 with the text "test message", it will generate the following HTTP request:

http://server:port/path?sender=1234567&message=test%20message

Your application would parse the URL GET variables to retrieve this information.

--
Des
NowSMS Support
Aniket Kumbhoje
New member
Username: Aniket1100

Post Number: 2
Registered: 03-2013
Posted on Thursday, March 21, 2013 - 07:02 am:   

Are you using NowSMS?

yes, but i am integrated your api code snippet from this link

http://www.nowsms.com/doc/submitting-sms-messages/sending-sms-text-messages

in my application.
So it easily send sms to any number.

But when i am working on How to receive sms, i am not understand how to integrate your help from this link

http://www.nowsms.com/doc/2-way-sms-support

to read sender number and sms.

So can you please little bit more explain the terms how i receive sms in my j2ee application and read Sender number and message.

Here is attachment how i integrated send sms help from your api in my application.

application/octet-streamSend SMS
SendSMS2.java (1.9 k)
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4329
Registered: 08-2008
Posted on Thursday, March 21, 2013 - 06:11 pm:   

Hi,

Can your application accept command line parameters?

Or is it a servlet that can accept HTTP requests?

It needs to be able to do one of those ... if you can explain which I will try to clarify further.

--
Des
NowSMS Support
Aniket Kumbhoje
New member
Username: Aniket1100

Post Number: 3
Registered: 03-2013
Posted on Friday, March 22, 2013 - 06:37 am:   

It is a servlet that accept HTTP requests.

And i already implemented Sending sms by using HTTP as shown in attached program in my 2nd post "Send SMS"

And in same way i want to create one separate program which will read received sms and send reply back to them using HTTP.

I have tried much on this but i not able to understand how below link is to receive sms.

http://server:port/path?sender=@@SENDER@@&message=@@FULLSMS@@}
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4333
Registered: 08-2008
Posted on Friday, March 22, 2013 - 04:42 pm:   

Ok. I think I understand where you are confused.

What is the HTTP URL for your servlet?

In my example, use that your URL to replace http://server:port/path

Configure that URL (add ?sender=@@SENDER@@&message=@@FULLSMS@@ to your servlet URL) as a 2-way command to execute.

Specify * as the SMS command prefix, which means that NowSMS will route all received SMS messages to your command.

Leave the other parameters blank, and UNcheck "Command Returns Response Text", as you will send any messages using HTTP like you are already.

When NowSMS receives an SMS message, it replaces @@SENDER@@ and @@FULLSMS@@ with details from the message.

Your servlet would extend HttpServlet with doGet and use request.getParameter to retrieve the message details (e.g., request.getParameter("sender") and request.getParameter("message") if you use the variable names from my example).

--
Des
NowSMS Support