Broadcasting SMS on Scheduled Bases.

Broadcasting SMS on Scheduled Bases. SearchSearch
Author Message
Adnan
Posted on Sunday, October 12, 2003 - 01:08 am:   

Hi,

I am working for a project in our company and I have a same senario like some other guy Hazem.

-users get scheduled sms msg's ( number and timing were set at the subscribtion )
-this is a free service from our company to our clients.
-msg are broadcasted to customers
-should be working on different networks

is it possible to do this if yes please guide me, waiting for your feedback.
Bryce Norwood - NowSMS Support
Posted on Monday, October 13, 2003 - 05:58 pm:   

Hi Adnan,

The first thing that you will need is one or more SMS service providers that can connect to the networks that you wish to connect to. (We are not an SMS service provider.)

You'll need to establish an account with one or more providers. The issues involved with making this choice usually come down to cost, reliability, service, and coverage.

Our software can manage connections to different SMS service providers (or GSM modems). It can simplify the process of developing 2-way interactive applications, simplify the process of formatting some different types of SMS messages.

You generally would interface with our software via an HTTP interface. So you would supply a program or script that issues HTTP commands to tell our software to send out messages.

-bn
Agung Wahono
Unregistered guest
Posted on Tuesday, October 28, 2003 - 10:14 am:   

Can this sms gateway software connected with PHP ? How to create my PHP script so I can send sms from my website ? Could you please send me the PHP script examples to connected with this gateway ? Thank's
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 973
Registered: 10-2002
Posted on Tuesday, October 28, 2003 - 01:56 pm:   

Here's a simple PHP script for sending a SMS text message through the NowSMS gateway:


<?

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("127.0.0.1", 81, "username", "password", "+4499999999", "Test Message");
echo $x;


?>

The formatting is a little funny here, so I'll also upload it as an attachment.

Basically, the "SendSMS" function connects to the gateway and issues an HTTP GET command to send a message. You need to call SendSMS with the appropriate parameters (IP address and port for your NowSMS server, username and password for your NowSMS server, recipient phone number, and message text).

application/octet-streamsendsms.php
sendsms.php (0.9 k)