Hosted PHP and Local NOWSMS

Hosted PHP and Local NOWSMS SearchSearch
Author Message
Benj Ngo
New member
Username: Benj

Post Number: 1
Registered: 08-2016
Posted on Thursday, August 25, 2016 - 10:28 am:   

Hi,

I have an existing workflow system (PHP with MYSQL) hosted on rackspace. How do I interface this with my local network installation of NOWSMS so that I can fetch phone numbers from my cloud database then send sms using my installation of NOW SMS.

I have implemented the php scripts on the site, but getting it to work with our existing php program is difficult.

I tired the php script shown here: http://www.nowsms.com/download/sendsms-php.txt

I tried using curl -> CURLOPT_URL, "http://192.168.1.22:8800/?PhoneNumber=09209573211&text=test+message+php3"

I tried using file_get_contest -> file_get_contents('http://192.168.1.22:8800/?PhoneNumber=09209573211&text=test+message+php2');

But the server always returns a "Unable to Serve Request" Connection timed out.

If I do a redirect via headers -> header("Location: http://192.168.1.22:8800/?PhoneNumber=09209573211&text=test+message+php3");

The redirect above works, but everything else doesn't...
Benj Ngo
New member
Username: Benj

Post Number: 2
Registered: 08-2016
Posted on Thursday, August 25, 2016 - 12:06 pm:   

This is SMSDEBUG LOG section when the trouble occurs:

9:03:26:173 [20] ProcessAdminRequestLogFiles: HTTP/1.0 200 OK
Content-Type: text/plain
Expires: Tue, 01 Jan 1980 1:00:00 GMT
Cache-Control: no-cache
Connection: close
Content-Length: 304329


19:03:26:204 [20] WaitForSocketClose: WinSock reported ioctlsocket complete
19:03:26:204 [20] ThreadProcessConnection: Request processing complete
19:03:36:213 [21] Debug: d887956c8f1ee4004dfbbf976067b8209df8fe730724a0a9a9834683d8fd124fbee8937760b85cdd 990bf55a2c52e3c6
19:03:36:213 [21] debug: session still valid
19:03:36:214 [21] ProcessAdminRequest: GET /ADMIN/STATUS HTTP/1.1
Host: 192.168.1.22:8800
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.1.22:8800/ADMIN/STATUS
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: NSESSID=d887956c8f1ee4004dfbbf976067b8209df8fe730724a0a9a9834683d8fd124fbee89377 60b85cdd990bf55a2c52e3c6; advoption=Yes


19:03:36:214 [21] Debug: d887956c8f1ee4004dfbbf976067b8209df8fe730724a0a9a9834683d8fd124fbee8937760b85cdd 990bf55a2c52e3c6
19:03:36:215 [21] debug: session still valid
19:03:36:254 [21] WaitForSocketClose: WinSock reported ioctlsocket complete
19:03:36:254 [21] ThreadProcessConnection: Request processing complete
19:03:36:292 [1] ThreadListenForConnections: Before accept
19:03:36:292 [1] ThreadListenForConnections: After accept
19:03:36:293 [1] ThreadListenForConnections: Before accept
19:03:36:293 [1] ThreadListenForConnections: After accept
19:03:36:298 [20] ThreadProcessConnection: Processing connection from 192.168.1.22...
19:03:36:300 [21] ThreadProcessConnection: Processing connection from 192.168.1.22...
19:03:38:609 [20] Debug: d887956c8f1ee4004dfbbf976067b8209df8fe730724a0a9a9834683d8fd124fbee8937760b85cdd 990bf55a2c52e3c6
19:03:38:610 [20] debug: session still valid
19:03:38:611 [20] ThreadProcessConnection: Updating cached user info
19:03:38:611 [20] ThreadProcessConnection: Processing request /null.htm
19:04:07:657 [20] Debug: d887956c8f1ee4004dfbbf976067b8209df8fe730724a0a9a9834683d8fd124fbee8937760b85cdd 990bf55a2c52e3c6
19:04:07:657 [20] debug: session still valid
19:04:07:657 [20] ThreadProcessConnection: Processing request /null.htm
19:04:32:892 [20] Debug: d887956c8f1ee4004dfbbf976067b8209df8fe730724a0a9a9834683d8fd124fbee8937760b85cdd 990bf55a2c52e3c6
19:04:32:892 [20] debug: session still valid
19:04:32:893 [20] ProcessAdminRequest: GET /ADMIN/LOGFILES?LogFile=SMSDEBUG.LOG HTTP/1.1
Host: 192.168.1.22:8800
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.1.22:8800/ADMIN/LOGFILES
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: NSESSID=d887956c8f1ee4004dfbbf976067b8209df8fe730724a0a9a9834683d8fd124fbee89377 60b85cdd990bf55a2c52e3c6; advoption=Yes
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 8159
Registered: 10-2002
Posted on Thursday, August 25, 2016 - 01:45 pm:   

Hi,

192.168.1.22 is a private IP address on your LAN. It is not accessible over the internet.

Connecting to NowSMS is like connecting to any other web server in this type of configuration..

If you're behind a router or firewall, then you need to open up a port to allow connections through the router or firewall to the NowSMS server.

If your router doesn't have a dedicated IP address, then you would want to use a dynamic DNS service like no-ip.com or dyndns.com to associate a host name with your IP address, so that the host name could follow you PC as its IP address changes.

-bn

Bryce Norwood
Now SMS/MMS Support