2-way PhoneNumber Formatting Problem

2-way PhoneNumber Formatting Problem SearchSearch
Author Message
Ritesh Taank
New member
Username: Rtaank

Post Number: 1
Registered: 07-2006
Posted on Saturday, July 15, 2006 - 01:02 am:   

Basically I have setup the following http request as the command for my 2-way configuration at the gateway:

http://localhost/twowaysms.php?sender=@@SENDER@@&fullmsg=@@FULLSMS@@

The response from within my PHP script is in the form of:

http://127.0.0.1:9000/?phonenumber=".$_REQUEST('sender')."&text=".urlencode("$response")

However, I keep getting the INVALID PARAMETER/PHONENUMBER FORMAT error from the gateway.

Having carried out some various tests, I am successfully able to send a message using the following response:

http://127.0.0.1:9000/?phonenumber=xxxxxxxxxxx&text=".urlencode("Hello World")

where xxxxxxxxxxx is my actual mobile number in the format 077xx06x66x (i.e. without the +44).

If I use +4477xx06x66x then I keep getting that same error message from the server.

So I was wondering if there was a technique to convert the variable 'sender' from the format of +4477xx06x66x into the format of 077xx06x66x, so that I can then plug the variable straight into the URL.

Any advice is much appreciated.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6209
Registered: 10-2002
Posted on Saturday, July 15, 2006 - 02:53 pm:   

Urlencode the sender.

The + character needs to be urlencoded...otherwise + is considered to be a space within a url parameter.

-bn
Ritesh Taank
New member
Username: Rtaank

Post Number: 2
Registered: 07-2006
Posted on Saturday, July 15, 2006 - 07:22 pm:   

Thanks for that advice, sounds like it should do the trick!