Help (2way)

Help (2way) SearchSearch
Author Message
IHAB
Unregistered guest
Posted on Friday, January 28, 2005 - 11:02 pm:   

Hi
I am developing application on the following senario :
- Nowsms receive a message and forward it to php page on the following format :
http://localhost/sms/htp.php?sender=@@sender@@&code=@@FULLSMS@@
- Now the php page will make the necessary query and send thr result back to the software like this :
$url = "http://127.0.0.1:8800/?phoneNumber=$sender.....
the message reach to the smsOut file but not the mobile .
The reason was that the phonenumber does not have the (+) in front of it , how can we add it ?
Thank you
Neo
Unregistered guest
Posted on Saturday, January 29, 2005 - 06:25 pm:   

Hello Ihab.

Try to put '%2B' instead of '+'

Hope it works.
IHAB
Unregistered guest
Posted on Sunday, January 30, 2005 - 01:21 pm:   

Thanks Neo , the problem is how to concatenate the two strings , if we but it like this :
PhoneNumber=%2B.$sender&...
it will appear only + in the SmsOut file and no phone number !
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 4010
Registered: 10-2002
Posted on Thursday, February 03, 2005 - 09:16 pm:   

Interesting. So the message is received without a "+" prefix, but it can only go out with the "+" in front of it. That is unusual.

Try this:

$url = "http://127.0.0.1:8800/?phoneNumber=%2B" . $sender . "..."

Or

$url = "http://127.0.0.1:8800/?phoneNumber=" . urlencode["+" . $sender] . "..."
IHAB
Unregistered guest
Posted on Saturday, February 05, 2005 - 10:45 pm:   

Thank you Bryce
Please look at this file appear in the (Q) folder after I sent the message using your code:

[SMS]
SubmittedBy=127.0.0.1
PhoneNumber=249912340499
Data=0B0504158115810003660101024A3A7B3B9B1F63448377B78483576FB74404008F22934C38C 34C2EC2A82E834C38C34C2EC2A82E8513615613624E30D20E2144D85584D8938C34838834438C513 415417613615617613615617424D10BB0AA0BA0D30E30D30BB0AA0BA0A9144D85D05505C06985585 C85585D05504C0558938
UDH=06050415811581
pid=00
dcs=F7
Binary=1

and this is the corresponding message found in the SMSOUT file :

2005-02-06 00:31:51,42053A1A.req,127.0.0.1,249912340499,Retry Pending - ERROR - Modem Response (2): ERROR -- Nokia 6610 (Cable) #2

see ? there is no (+) again , and when I add it manually , the message went successfuly ,
What is the reason ? }}
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 4044
Registered: 10-2002
Posted on Wednesday, February 09, 2005 - 11:00 pm:   

Enable the SMSDEBUG.LOG.

I'd be curious to see what the URL request is that is coming into NowSMS.

I suspect, of course, that the "+" is missing, but I don't understand why this would be the case. I have used the "urlencode" approach in some of my PHP scripts, and it has worked for me. (Although I have not had to manually add a "+", as it was always present in the original sender address. I use urlencode just to make sure that it is preserved.)

-bn