Comman Line Useage

Comman Line Useage SearchSearch
Author Message
Nigel Grummet
New member
Username: Grum

Post Number: 1
Registered: 07-2004
Posted on Friday, July 16, 2004 - 07:26 am:   

Hi Bryce

New to your software, and right pleased with it thus far.

However, we have a system monitoring server that can send SMS alerts (via an SMS gateway) That works off a single command line. I have tried cURL, pavuk and WebGet as the command line executable with the parameters:
program.exe http://servername/?PhoneNumber=xxxx&Text=Hello

I have also tried variants on this theme - replacing the "&" with "%26", replacing the "=" with "%3D" (for the Text part), and I keep getting the same thing - the message is sent, but no text is sent along with it.

When I enter the above URL parameters into IE, everything works fine, so the problem seems to be translation (or not) of the escape codes from a command prompt.

Help! This is the critical factor that management want to see functional as a business case, and it strikes me that I'm just being blind and not seeing something obvious.

Thanks in advance,

Regards

Nigel Grummet
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3093
Registered: 10-2002
Posted on Wednesday, July 21, 2004 - 01:55 pm:   

Hi Nigel,

I haven't used any of those tools.

But you might want to try the script in the following thread as an alternative:

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

-bn
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 3094
Registered: 10-2002
Posted on Wednesday, July 21, 2004 - 01:59 pm:   

Nigel,

Your message made me curious as to why a tool like cURL would not work. So I downloaded it to run some tests.

Basically, the problem seems to be that Windows uses "&" as some sort of special character from the command line. I notice that Windows tries to run whatever is after "&" as a separate command.

The way around this is to put quotes around the entire URL string.

curl "http://host:port/?PhoneNumber=xxxx&Text=test+message"

You should URL escape any of the data that is being passed as the phone number (usually only %2B for + is the consideration) or text (remember to replace spaces with + or %20).

The other script that I pointed you to will perform the URL escaping automatically.

-bn