SMS 2 way error

SMS 2 way error SearchSearch
Author Message
john smith
New member
Username: Smithy

Post Number: 1
Registered: 05-2004
Posted on Wednesday, May 05, 2004 - 09:30 pm:   

Hi,

I would be very grateful if someone would be able to help me with the following problem -->

I need to use the 2-way sms gateway to enter into a php database and retreve an account balance and reply to the sender with this balance!!

Is this possible with the 2 way gateway and if so how would I go about doing this?

In refrence to the SMS Command Prefix and the Command to Execute section what would I need to enter into these fields to get back the balance from the php file?

Also I seam to be having problems with testing the 2- way gateway, and finding out is it actually running and working?

Can I enter a command into the execute section so that an application (eg. paint.exe)will open when I recieve a text message with the word paint??

Thank you for your time,

John Smith.

Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2521
Registered: 10-2002
Posted on Thursday, May 06, 2004 - 07:41 pm:   

Hi John,

There is a good PHP example at the following link:

http://support.nowsms.com/discus/messages/1/3991.html

In this example, the PHP script is running under the control of a web server.

But if you wanted to run it without a web server, you could just always configure the 2-way command to launch PHP.EXE to run the script instead of using an HTTP command. However, PHP likes to return HTTP headers, so I think you're best off running the PHP script on a web server.

The "ECHO" example in the documentation is a good 2-way command to use for testing/validation that things are working:

http://www.nowsms.com/documentation/ProductDocumentation/2_way_sms_support.htm

To specifically address some of your other questions:


quote:

In refrence to the SMS Command Prefix and the Command to Execute section what would I need to enter into these fields to get back the balance from the php file?




"SMS Command Prefix" should be "*", which is a wildcard that means all messages will be routed to this command.

"Command to Execute" would be the URL to execute the PHP script on a web server.

Again, this is a good example:

http://support.nowsms.com/discus/messages/1/3991.html


quote:

Also I seam to be having problems with testing the 2- way gateway, and finding out is it actually running and working?




Using the ECHO command as a test is a good starting point.

Here is the approach that I usually recommend:

Enable receive messages for the GSM modem or SMSC connection. (Highlight the entry in the "SMSC" page of our configuration dialog, then press "Properties", and there will be an option for enabling receive if it is not already enabled.)

On the "2-way" page of our configuration dialog, check "Process Received SMS Messages".

But, initially don't define any commands in the command table. I recommend this for troubleshooting purposes.

Apply the changes, and restart the NowSMS SMS service.

Send an SMS message to the phone number for which you are receiving messages. If everything is ok, NowSMS should receive the message and create a file in the SMS-IN subdirectory with a .SMS file extension. (NowSMS will create this directory automatically the first time it receives a message.)

Assuming that step is ok, go back to the "2-way" page of the configuration dialog, and define a command in the command table. Specify a command prefix of "*". If you are using a version that has a "receive phone" prompt, leave that blank (it is for defining different commands for messages received on different phone numbers). In the "Command to Execute" field, you will
define an http:// link to a script that runs on one of your web servers.
Use a format for the link like this:
http://ip.address/recvsms.cgi?sender=@@SENDER@@&text=@@FULLSMS@@

NowSMS will replace @@SENDER@@ in the URL with the phone number of the message sender, and @@FULLSMS@@ will contain the text of the message. So you can process this with whatever scripting language you want to use (such as PHP).


quote:

Can I enter a command into the execute section so that an application (eg. paint.exe)will open when I recieve a text message with the word paint??




No. NowSMS runs as a service. Services cannot interact with the desktop of the PC.

I hope that helps you sort the problem.

-bn

Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2562
Registered: 10-2002
Posted on Wednesday, May 12, 2004 - 05:01 pm:   

Another thing to be aware of ... not all GSM modems (especially phones as modems) support receiving SMS messages. Some support sending only.

Phones that support sending only (no SMS receive support for the GSM modem interface):

Nokia Series 60 phones including, but not limited to the following Nokia models: 6600, 3650, 7650

Also, any Nokia phones that use the Symbian OS, which includes the above list, plus the 92x0.

Another device that supports SMS sending only (no receive) is the Nokia D211/D311 PC Card.

So if you're not receiving messages to the SMS-IN directory when you try the tests above, it is also possible that the modem that you are using does not support receiving SMS messages over the modem interface.