The Server keeps executing my CGI script ..Help

The Server keeps executing my CGI script ..Help SearchSearch
Author Message
jerrel
New member
Username: Jerrel

Post Number: 2
Registered: 02-2004
Posted on Sunday, March 07, 2004 - 07:54 pm:   

Dear Sir,

I have written a smal Perl cgi script, that is called by the NowSMS server 5.0.
What the script does, is write the phonenumber and the message of the sender to a file.
However i noticed that sometimes when I send a sms to the server, It keeps calling the cgi script over and over again. offcourse the file is being filled with the same data over and over again.

If I reboot the machine are restart the Nowsms software,the problem is still there, and keeps calling the script.
The only way to stop this is by removing the "command to execute" out of the 2-way settings.

I would like to know to know if this is a known bug, and how do i fix it.
The follow up is that the script should do a redirect to the sender with a ringtone, but if the problem still popups, the sender will get the same ringtone over and over again )o:

Please inform me asap

regards

Jerrel
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1987
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 01:48 pm:   

Hi Jerrel,

Sorry that I did not reply to your message earlier.

This suggests that the script is not returning a proper HTTP OK response.

If the script returns an error response, NowSMS keeps trying again.

What happens if you connect to the script from your web browser (passing the appropriate parameters to it)? Does the web browser also report an error?

You want to make sure that the script returns a proper OK HTTP response (code 200). Basically, the script should return something like this:

HTTP/1.1 200 OK
Content-Type: text/plain
<blank line>
OK

(The blank line followed by OK is just a suggestion, it is not required.)
jerrel
New member
Username: Jerrel

Post Number: 3
Registered: 02-2004
Posted on Wednesday, March 10, 2004 - 02:29 pm:   

Yes Bryce,
When i connect to the script from the brower with the right parameters. I do get an error message from the server.
Can you give me a hind here in my script, and what is should enter for the script to retrun the OK responce

regards

Jerrel
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2058
Registered: 10-2002
Posted on Wednesday, March 10, 2004 - 03:58 pm:   

Jerrel,

I'm not a Perl expert, so I did a web search for some information ...

The following link looks like it should do the trick:

http://forums.devshed.com/archive/t-77162

To return a more complete response, try including this at the end of your script:

print "HTTP/1.1 200 OK\n"
print "Content-type: text/plain\n"
print "\n"
print "OK\n"

If you connect to such a script with your web browser, you should just see the text "OK".

-bn
jerrel
New member
Username: Jerrel

Post Number: 4
Registered: 02-2004
Posted on Friday, March 12, 2004 - 01:16 am:   

Dear Bryce,

Thanks for all the help.
My script return a perfect OK.

regards

Jerrel