Connect Sms Gateway

Connect Sms Gateway SearchSearch
Author Message
kavit gamot
New member
Username: Kavitgamot

Post Number: 2
Registered: 01-2009
Posted on Friday, January 16, 2009 - 11:19 am:   

hi !
i am working on an application tht need to connect with sms gateway.
i want to create connection through http over TCP/IP.

i want to ask that how can i connect my application to gateway.

thanks..
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 369
Registered: 08-2008
Posted on Friday, January 16, 2009 - 04:41 pm:   

Hi,

It depends on what development environment you are using.

Basically, you are going to make an HTTP request from your application.

More information on URL formats for NowSMS can be found here:

http://www.nowsms.com/documentation/ProductDocumentation/sending_messages/sendin g_text_messages.htm

http://www.nowsms.com/documentation/ProductDocumentation/sending_messages/url_pa rameters_for_sending_messages.htm

There are also scripts that you can install that offer a command line interface, so that you can just spawn a command to send a message as an alternative. Details of these scripts can be found here: http://blog.nowsms.com/search/label/command%20line%20interface

And if you happen to be using PHP, there are some examples here:
http://blog.nowsms.com/search/label/PHP

--
Des
NowSMS Support
kavit gamot
New member
Username: Kavitgamot

Post Number: 3
Registered: 01-2009
Posted on Tuesday, January 27, 2009 - 12:11 pm:   

hi des thnx for reply !


I m using Http interface for Sms gateway. i am using following scirpt bt it cant work.
script is not working.


please share some knowledge on it.

{code}

<script>
var NowSMSServerAddress = "[http://127.0.0.1:8800/]";
var NowSMSUserName = "test";
var NowSMSPassword = "test";


function HTTPGET(strURL)
{

var strResult;
xmlHttp = new XMLHttpRequest();


Window.alert(strURL);
Window.alert("message");
// Create an HTTP request.

var temp = WinHttpReq.Open("GET", strURL, false);



// Send the HTTP request.
WinHttpReq.Send();



// Retrieve the response text.
strResult = WinHttpReq.ResponseText;
alert(strResult);
// }



// Return the response text.
return strResult;
}


var strRequest;


if (WScript.Arguments.Count() < 2)
{
WScript.Echo ("Usage: " + WScript.ScriptName + " PhoneNumber1[,PhoneNumber2,...] NowSMSURLParameter1=Value1 [NowSMSURLParameter2=Value2] [NowSMSURLParameterN=ValueN]\r\n");
WScript.Quit();
}


strRequest = NowSMSServerAddress + "/?PhoneNumber=" + encodeURIComponent(WScript.Arguments(0)) + "&User=" + encodeURIComponent(NowSMSUserName) + "&password=" + encodeURIComponent(NowSMSPassword) ;


for (i=1; i<WScript.Arguments.Count(); i++)
{
var strTemp = WScript.Arguments(i);


while (strTemp.indexOf("^") >= 0) {
var temp = strTemp.indexOf("^");
if (temp >= 0) {
strTemp = strTemp.substr(0, temp) + strTemp.substr(temp+1);
}
}

var equPos = strTemp.indexOf("=");
if (equPos >= 0)
{
strRequest += "&";
strRequest += strTemp.substr(0,equPos+1);
strRequest += encodeURIComponent(strTemp.substr(equPos+1));
}
else {
strRequest += "%20";
strRequest += encodeURIComponent(strTemp);
}


}



/* WScript.Echo(strRequest); */


WScript.Echo(HTTPGET(strRequest));
WScript.Echo(HTTPGET(strResult));
</script>

{code}


one more thing i would like to ask is that what is the main use of ActiveXObject.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 395
Registered: 08-2008
Posted on Tuesday, January 27, 2009 - 03:29 pm:   

Hi Kavot,

In order to get that script to work "as is", you need to create a user account under "SMS Users" in NowSMS, with a user/account name of "test" and a password of "test".

(Or a better solution is to edit the script file to specify a different username and password for an account that you define on your system.)

If that doesn't resolve the problem, what does the script display when it runs?


quote:

one more thing i would like to ask is that what is the main use of ActiveXObject.




The interface with NowSMS is HTTP based. In this script, we are simply building an HTTP URL and using ActiveX HTTP objects to send the request to NowSMS.

--
Des
NowSMS Support
Sandy D'Costa
New member
Username: Sandydc

Post Number: 1
Registered: 03-2009
Posted on Saturday, March 21, 2009 - 12:50 pm:   

While connecting giving Error
Modem does not support SMS
+CMS Error : 515
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 627
Registered: 08-2008
Posted on Saturday, March 21, 2009 - 02:55 pm:   

What is the modem?

It may not support SMS, only Internet connectivity. This is the case with many 'so called' smart phones.

Or if it is a dedicated modem device, the modem may have multiple ports, where only one supports SMS. See the Sierra Wireless modem article that was recently posted at http://blog.nowsms.com for more info on determining COM ports.