Integrate nowsms with mysite(not localhost)

Integrate nowsms with mysite(not localhost) SearchSearch
Author Message
Yung Tian
Posted on Wednesday, September 16, 2009 - 09:07 am:   

hello bryan...
i have website...n i want to integrate my site with nowsms..i already installed nowsms gateway on my PC but i don't know the configuration.How the way about the configuration?
what kind the right of SMSC connection type that i use?
thx before..
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1259
Registered: 08-2008
Posted on Wednesday, September 16, 2009 - 04:31 pm:   

Hi Yung Tian,

NowSMS is not a replacement for a bulk SMS or MMS service provider. You need a connection to an SMS service provider, or a GSM modem, before you can send any messages with NowSMS.

NowSMS is a middleware tool which simplifies the process of connecting to one or more of these service providers and/or managing one or more GSM modems.

I don't have any recommendations for specific SMS providers.

A GSM modem is a specialized type of modem which accepts a SIM card, and operates over a subscription to a mobile operator, just like a mobile phone. From the mobile operator perspective, a GSM modem looks just like a mobile phone.

There are a variety of USB stick modems that work well with NowSMS, such as the Option ICON and GlobeTrotter series (I use the Option ICON 322), Novatel MC950D, SonyEricsson MD300, Sierra Wireless Compass 885 (avoid the older 881), and a variety of models from Huawei and ZTE.

For more information on configuring NowSMS with a GSM modem, see:

http://www.nowsms.com/documentation/quickstartguide/NowSMSQuickStart1.pdf

--
Des
NowSMS Support
Yung Tian
New member
Username: Ivan

Post Number: 2
Registered: 07-2007
Posted on Thursday, September 17, 2009 - 04:06 am:   

if running @localhost it works..i can send n receive sms with sierra 885 modem..but now i want to integrate with my site(not localhost) with modem installed on my PC.Is it possible??that's the problem that i want to ask you..if that can work..what the configurations that i have to do?
Yung Tian
New member
Username: Ivan

Post Number: 3
Registered: 07-2007
Posted on Thursday, September 17, 2009 - 05:04 am:   

i using this script:
---------------------------------------------
function SendSMS ($host, $port, $username, $password, $phoneNoRecip, $msgText) {

$fp = fsockopen($host, $port, $errno, $errstr);
if (!$fp) {
echo "errno: $errno \n";
echo "errstr: $errstr\n";
return $result;
}

fwrite($fp, "GET /?Phone=" . rawurlencode($phoneNoRecip) . "&Text=" . rawurlencode($msgText) . " HTTP/1.0\n");
if ($username != "") {
$auth = $username . ":" . $password;
echo "auth: $auth\n";
$auth = base64_encode($auth);
echo "auth: $auth\n";
fwrite($fp, "Authorization: Basic " . $auth . "\n");
}
fwrite($fp, "\n");

$res = "";

while(!feof($fp)) {
$res .= fread($fp,1);
}
fclose($fp);


return $res;
}

$x = SendSMS("202.59.xxx.xxx", 8800, "username", "password", $phoneNoRecip, $msgText);
echo $x;
--------------------------------------------
i've changed ip localhost with my server ip but still can not sent sms...
are there any configuration else?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1271
Registered: 08-2008
Posted on Thursday, September 17, 2009 - 06:53 pm:   

Hi Yung Tian,

I'm sorry that I did not understand.

There should be no problem if you are not using "localhost". That is one of the good things about using HTTP as an API.

On the machine that you are running the script on, can you access http://202.59.xxx.xxx:8800 from the web browser?

Maybe there is a firewall issue?

It could be Windows firewall on the NowSMS server?

--
Des
NowSMS Support
Yung Tian
New member
Username: Ivan

Post Number: 4
Registered: 07-2007
Posted on Friday, September 25, 2009 - 06:35 am:   

ops sorry.. i meant http://202.59.xxx.xxx:80
i cannot access that url..the server gave me reply "There is no website configured at this address"

so what should i do?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1301
Registered: 08-2008
Posted on Friday, September 25, 2009 - 09:41 pm:   


quote:

"There is no website configured at this address"




That sounds like an error message coming from Microsoft IIS.

What about http://202.59.xxx.xxx:8800 ... 8800 is the default port number that NowSMS listens on. This is the "Port number for the web interface" as configured on the "Web" tab of the NowSMS configuration dialog.

Try a web browser on the same machine as NowSMS, and verify that you can see http://127.0.0.1:8800.

If you can see http://127.0.0.1:8800 on the NowSMS machine itself, but you cannot see http://202.59.xxx.xxx:8800, then this suggests that there is a firewall that is blocking it.

It could be the Windows Firewall that is built into Windows. Try disabling that firewall temporarily to see if that is the problem. If that resolves the problem, then go into the firewall properties and add an exception to allow access to port 8800.

--
Des
NowSMS Support
Yung Tian
New member
Username: Ivan

Post Number: 5
Registered: 07-2007
Posted on Saturday, September 26, 2009 - 03:47 pm:   

is it possible to disable firewall webserver where i hosting my site???

this is design that i mean...
[IMG]http://i131.photobucket.com/albums/p316/vahn_x/design.jpg[/IMG]
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 1306
Registered: 08-2008
Posted on Saturday, September 26, 2009 - 06:02 pm:   


quote:

is it possible to disable firewall webserver where i hosting my site???




You'd have to talk to your hosting provider, and get them to open a port for you.

However, your diagram is different. In your diagram, the PC with the modem is not at your hosting provider.

In the scenario of your diagram, yes, it is possible. However, it is necessary that there be a way for an external client to connect to the NowSMS server over the internet.

It is easiest if you have a "static IP address" on the NowSMS server.

However, most internet connections only give you a "Dynamic IP address", meaning that your IP address can change when it disconnects and reconnects. You can use free services like dyndns.org to assign a host name for your system so that this host name follows your IP address.

I do this at my home ... not with NowSMS, but I have a web server running on one of my home computers. My system is connected to the internet all of the time, and my IP address does not change frequently, but sometimes after a power failure, the IP address changes. The Dynamic DNS service at dyndns.org knows this, so the same host name can be used even as the IP address changes.

It gets more complicated if you have multiple PCs sharing an internet connection. In this case, your router needs to have a port mapping so that it knows when requests come into a particular port, the request needs to be forwarded to a specific computer that is sharing your internet connection.

If you are not familiar with these concepts, it is somewhat complicated ... and I'm not a good person to explain it.

But you can think of NowSMS as a web server. By default, it is just running on port 8800 instead of port 80.

Here's a good article at dyndns.org that provides an overview of how it works:

http://www.dyndns.com/support/kb/webservers.html

no-ip.com is also a good service. I personally used them for several years. You can find some good information in their support area:

http://www.no-ip.com/support/

I switched to dyndns.org because I use a Linksys router at home, and the Linksys router has built in support for dyndns.org, whereas with no-ip.com I had to run software on one of my computers.

All this said, if you have a static IP address for the PC running NowSMS, you don't need to worry about dyndns.org or no-ip.com, you just need to make sure your firewall is open to allow connections.

--
Des
NowSMS Support