2-way SMS Troubleshooting Tips | ![]() |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through July 14, 2004 ⬆ |
◄ ► |
Author | Message | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 2637 Registered: 10-2002 |
The purpose of this discussion thread is to offer some tips on troubleshooting the setup of 2-way SMS. 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.) If no file is created, then NowSMS is not actually receiving the message.
Assuming that messages are being received by NowSMS, go back to the "2-way" page of the configuration dialog, and define a command in the command table. A good test command is the "ECHO" example in the NowSMS documentation: http://www.nowsms.com/documentation/ProductDocumentation/2_way_sms_support.htm 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, define "c:\windows\system32\cmd.exe /c echo Echo @@FULLSMS@@". (Verify that CMD.EXE is in this directory before defining the command. On some systems it will be in c:\winnt\system32, or wherever Windows is installed.) Check "Command returns response text". Press "Add" to add the command to the "Received SMS Command Table". When an SMS is received that matches this SMS command prefix (in the case of "*", any SMS that doesn’t match another defined prefix), the gateway launches a command processor (CMD) that simply echoes the text back to the screen adding the word "Echo" to the beginning of the received text. In this example, the sender of the SMS message will receive an "Echo" back of the command that they sent in to the gateway. While not an extremely useful command, this is a useful way of testing to see that the gateway is alive and capable of receiving SMS messages. "Command to Execute" can also point to an HTTP request instead of an executable command. In this case, NowSMS can connect to a script running on another web server, so you can use scripting languages like PHP, ASP or Perl for processing received SMS messages. There is a good simple PHP example here: http://support.nowsms.com/discus/messages/1/3991.html There's also a simple example of a Windows script being used in a 2-way command at the following link: http://support.nowsms.com/discus/messages/1/333.html And a very simple ASP example at the following link: http://support.nowsms.com/discus/messages/1/4420.html If you get stuck debugging 2-way SMS commands, try enabling the debug log in NowSMS. This is done by manually editing the SMSGW.INI file, and under the [SMSGW] header, add Debug=Yes. Then restart the NowSMS service. NowSMS will create an SMSDEBUG.LOG as it runs. Part of the information in this log will show the 2-way commands that NowSMS is attempting to process, as well as the responses that are returned from HTTP commands. | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 2638 Registered: 10-2002 |
An additional useful link related to 2-way SMS, this one talks about how to use the "redirect" response to send a command back to NowSMS: http://www.nowsms.com/support/bulletins/tb-nowsms-003.htm Also, for the PHP example above, note that your PHP script could call other functions that initiate a new request to NowSMS to send different types of messages. Some good examples of using PHP scripts to send messages to NowSMS can be found at the following links: http://support.nowsms.com/discus/messages/1/867.html http://support.nowsms.com/discus/messages/1/1113.html http://support.nowsms.com/discus/messages/1/1490.html http://support.nowsms.com/discus/messages/1/4077.html |