2 Way SMS - Sending WAP Push Msg

2 Way SMS - Sending WAP Push Msg SearchSearch
Author Message
simple
New member
Username: Khllee

Post Number: 2
Registered: 12-2005
Posted on Tuesday, August 01, 2006 - 05:15 am:   

Hi,

Refer to the msg here. http://support.nowsms.com/discus/messages/1/4520.ht ml

I have no problem implementing the Echo example and further implementing by calling a php script.

However, when i tried to do WAP Push as shown here http://support.nowsms.com/discus/messages/1/1490.ht ml,

I encountered the following error:

<br />
<b>Warning</b>: fsockopen(): unable to connect to 127.0.0.1:81 in <b>/home/xxxx/public_html/xxxx.php</b> on line <b>7</b><br />
errno: 111
errstr: Connection refused

Please advice. Thanks!
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6285
Registered: 10-2002
Posted on Tuesday, August 01, 2006 - 03:45 pm:   

Hi,

Is NowSMS configured to use port 81 for its web interface?

The example PHP script that you reference assumes that it is connecting to a NowSMS web interface on IP address 127.0.0.1 (same PC/local host), port 81. The default port for the NowSMS web interface is port 8800.

You would need to modify the script to use the appropriate IP address and port number for the NowSMS web interface in your environment.

Also, note that the script includes parameters for a username and password, these correspond to a username and password for an "SMS Users" account defined in NowSMS.

-bn
simple
New member
Username: Khllee

Post Number: 3
Registered: 12-2005
Posted on Wednesday, August 02, 2006 - 08:49 am:   

Thanks for the reply.

I have checked all configurations and it it correct. NOWSMS is configured to use port 81 instead of default 8800. Web interface is at IP address is 127.0.0.1. Username and password is set accordingly in the "SMS Users" account.

I am still getting the same error. What could be the reasons?

Please advice. Thanks!
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6302
Registered: 10-2002
Posted on Thursday, August 03, 2006 - 01:39 am:   

Can you connect to http://127.0.0.1:81 with a web browser and see the NowSMS web interface?
simple
New member
Username: Khllee

Post Number: 4
Registered: 12-2005
Posted on Thursday, August 03, 2006 - 04:03 am:   

Yes, i can after providing my username and password.

What should i do next?

Thks!
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6310
Registered: 10-2002
Posted on Friday, August 04, 2006 - 03:58 am:   

I don't know what to suggest.

The script is running on the same PC as NowSMS?

I can't understand why a web browser would connect but a PHP script cannot.
simple
New member
Username: Khllee

Post Number: 5
Registered: 12-2005
Posted on Sunday, August 06, 2006 - 05:10 pm:   

The script is not running on the same PC as NOWSMS.

However, i have no problem implementing the example below where the script on different PC as well.

http://support.nowsms.com/discus/messages/1/3991.ht ml

Is that the problem?
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6343
Registered: 10-2002
Posted on Tuesday, August 15, 2006 - 06:16 pm:   

I think I'm missing some basic information on your attempts ...

If the script is running on a different PC, then why do you say in a posting above that you are connecting to 127.0.0.1?

You need to edit the script to specify the IP address of the server to which you are connecting (as well as the proper port, and a valid username and password as defined in the "SMS Users" list).

The other script examples that you reference don't perform any external HTTP connections, they simply return responses. To initiate a connection to another server, such as in that WAP Push script, you need to tell the script the address of the server that it is connecting to.

-bn
simple
New member
Username: Khllee

Post Number: 6
Registered: 12-2005
Posted on Thursday, August 17, 2006 - 08:06 am:   

Thanks for the reply.

Example:
SendWAPPush("127.0.0.1", 81, "username", "password", "+44999999999", "Test Push", "http://www.domain.com/2way.php");

I mean the script 2way.php is at another server while i am running NowSMS on my home PC.

So when i am connecting to NowSMS using my home PC, i will connect to 127.0.0.1.

Do you mean i need to install NowSMS at the server where the script 2way.php is?

I think there is some problems with my setup. Pls advise.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6369
Registered: 10-2002
Posted on Thursday, August 17, 2006 - 04:59 pm:   

I mean that you need to change the IP address in that example to be the IP address of the NowSMS server (as seen from the perspective of the PC on which the PHP script is actually running).

So you would change:

"127.0.0.1" ---> IP address of the NowSMS server
81 ---> port number for NowSMS web interface
"username" ---> user name of "SMS Users" account
"password" ---> password for "SMS Users" account
"+4499999999" ---> recipient phone number
"Test Push" ---> text of push message
"http://www.domain.com/2way.php" ---> URL to be included in push message