Need to generate auto SMS from NowSMS

Need to generate auto SMS from NowSMS SearchSearch
Author Message
Muhammad Adnan farooq
New member
Username: Adnan

Post Number: 40
Registered: 10-2009
Posted on Monday, February 22, 2010 - 04:18 pm:   

Hi

We need to generate auto SMS from NowSMS server. It may be 2 SMS after every 30 secs etc. We don't need to do it manually.

Can you please suggest how we can achieve this task? Customer who is trying to achieve this task is using NowSMS as SMPP client.

Please suggest.

Thanks
Adnan
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1830
Registered: 08-2008
Posted on Monday, February 22, 2010 - 05:25 pm:   

Hi Adnan,

Can you explain what type of rule you would be using to trigger this auto SMS?

In other words, what action would happen that would start this process?

It would most likely require some simple programming. There are interfaces to automatically send an SMS message from PHP, or Java, or from a command line interface ... described here: http://www.nowsms.com/support/api.htm

To recommend more specifics, I would need to better understand the logic flow of what you're trying to achieve.

--
Des
NowSMS Support
Muhammad Adnan farooq
New member
Username: Adnan

Post Number: 41
Registered: 10-2009
Posted on Monday, February 22, 2010 - 05:56 pm:   

We need to send auto SMS after every 30 sec or 1 min without trigerring. We don't need to saend any text file but need to send simple SMS, may be with some commands to SIM numbers.

can we achieve it through PHP?
Is there any option in NowSMS to save it for auto processing after a specific time interval?
Muhammad Adnan farooq
New member
Username: Adnan

Post Number: 42
Registered: 10-2009
Posted on Monday, February 22, 2010 - 07:34 pm:   

I am waiting for your response
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1831
Registered: 08-2008
Posted on Monday, February 22, 2010 - 07:57 pm:   

I'd be real hesitant to setup something that automatically generated a message every 30 seconds.

My concern is ... what if an SMSC connection is down? Or if you are sending to an SMPP client, what if that client is not connected?

Basically, you don't want to end up with a backlog of these automatically generated messages if you are recovering from one of these types of situations.

That's why I try to ask more about what you are trying to achieve by sending these messages. I'm guessing you're looking at some sort of "heartbeat" type of application to help verify system health. But maybe that is not what you are trying to achieve.

If you want to send an SMS message, you can easily do it from a PHP script (or Java, or spawning a command line interface).

If you want to send that message every 30 seconds, your PHP script would need to be running constantly, sending that message every 30 seconds (unless you used the delayed sending option when submitting the message).

When submitting a message to NowSMS via HTTP (which is what the PHP, Java and command-line examples all do), it is possible to include a "&DelayUntil=yyyymmddhhmm" parameter, which specifies that the message should be held until yyyy-mm-dd hh:mm (year, month, day, hour, minute).

This parameter does not give you 30 second granularity, only per minute.

If you were using PHP, you would need to modify the PHP script to include a "DelayUntil" parameter.
Muhammad Adnan farooq
New member
Username: Adnan

Post Number: 43
Registered: 10-2009
Posted on Monday, February 22, 2010 - 08:47 pm:   

Do you have any sample PHP script? Where we can define 30 sec granularity in that script? Where we need to save that script? Is there any directory in NowSMS where we can save it?

Please elaborate.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1832
Registered: 08-2008
Posted on Monday, February 22, 2010 - 09:57 pm:   

The link included in my first reply has pointers to references for additional PHP script information. The link on that page titled "PHP Scripts / Sending Text Messages" includes an example script.

However, are you familiar with PHP?

PHP usually runs on a web server. The most common task for PHP is to process form input for a web page, or otherwise produce dynamic web content.

Of course, you can also run PHP scripts without a web server, using the PHP interpreter.

But I need to stress ... that is all completely independent of NowSMS. That is to say, operational control of PHP and your PHP script is completely independent of NowSMS.

Your PHP script can issue HTTP requests to NowSMS to trigger the sending of SMS messages.


Whether you use PHP or some other programming language ... what I am saying is that you would need to write a simple program that submits a message every 30 seconds (if that is what you really want to do). That simple program is logically independent of NowSMS ... it is just another client that is submitting messages into NowSMS.

There is no built-in functionality of NowSMS which will allow you to send an SMS message every 30 seconds.


To avoid confusion, I will also address your specific questions:


quote:

Do you have any sample PHP script?




Refer to the earlier referenced link.


quote:

Where we can define 30 sec granularity in that script?




That is your responsibility. The PHP script does not run under the control of NowSMS, it is a completely separate logical entity that submits messages to NowSMS.

The PHP sleep function can wait 30 seconds, if that is what you want to do:

http://php.net/manual/en/function.sleep.php


quote:

Where we need to save that script?




That is your decision. The PHP script does not run under the control of NowSMS, it is a completely separate logical entity that submits messages to NowSMS.

NowSMS does not launch or run your script in this scenario. You launch or run script independently.


quote:

Is there any directory in NowSMS where we can save it?




No.