17488 Posts in 4473 Topics by 1978 members
|Go to End|
28 September 2008 at 4:41am Last edited: 28 September 2008 6:13am
I'm seeking for helping hand for building SMS Gateway API Script that will co-exists with
SS and able to send User Input (ie. Sender, PhoneNumber(international format), Message Text,
Message Type (Text only/Flash SMS etc.) using SS to SMS Gateway API @ sms.alertzap.com.
here is copy of PHP Script which has to be worked with SS.
( I have purchased one bulk sms pack from alertzap.com in php script i'm going to have my
account details. later on when user will post info this script should send URL to sms
gateway @ sms.alertzap.com
$sndr = '';
$message = '';
$sndr = $_POST['sender'];
$phonenum = $_POST['PhoneNumber'];
$message = $_POST['text'];
$res = sendsms ($sndr,$phonenum,$message);
// Call this function when ever you wish to Send SMS
$host = "sms.alertzap.com";
$request = ""; //initialize the request variable
$param["user"] = "username"; // this is the username of your SMS
$param["password"] = "password"; //this is the password of our SMS account
$param["text"] = substr($text,0,159); //this is the message that we want to send
$param["PhoneNumber"] = $mobile; //these are the recipients of the
if ($tmp=="9198" || $tmp=="9194" || $tmp=="9199" || $tmp=="9192" || $tmp=="9197")
if ($sndr != NULL)
$sender = $sndr;
$sender = "SwiftGet.net"; // SenderID for GSM and TATA
$sender= "919860609000"; // SenderID for CDMA (Reliance0
$param["sender"] = $sender;
$param["track"] = "1";
foreach($param as $key=>$val) // Traverse through each member of the param array
$request.= $key."=".urlencode($val); //we have to urlencode the values
$request.= "&"; //append the ampersand (&) sign after each paramter/value
$request = substr($request, 0, strlen($request)-1); //remove the final ampersand
sign from the request
$script = "/sendsmsv2.asp";
$request_length = strlen($request);
$method = "POST";
// if ($method == "GET")
//$script .= "?$request";
//Now comes the header which we are going to post.
$header = "$method $script HTTP/1.1\r\n";
$header .= "Host: $host\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: $request_length\r\n";
$header .= "Connection: close\r\n\r\n";
$header .= "$request\r\n";
//Now we open up the connection
$socket = @fsockopen($host, 80, $errno, $errstr);
if ($socket) //if its open, then...
fputs($socket, $header); // send the details over
$output=$output.fgets($socket); //get the results
return(0); // SMS Not Successful
return(1); // SMS Was successful
//Check Result of Sending SMS
echo "SMS to $phonenum was successful...";
echo "SMS to $phonenum was not successful...";
SMS Gateway API As follows:
The post either via GET or POST needs to be done on
The variables to be used are:
user -> Your username on the website
password -> Your password on the website
sender -> Alphanumeric/Number SenderID from your approved list of SenderID's to be used for GSM Recipients
sendercdma -> Number SenderID from your approved list of SenderID's to be used for CDMA Recipients
PhoneNumber -> Mobile number of the recipients. for multiple recipients enter numbers seperated by comma.
group -> (optional) The name of the group you wish to send message to. (Groups can be created and managed on the alertzap.com website.)
text -> The text of the message. (Charged 1 unit for 160 characters per recipient.)
flash = 1/0 -> (1) If the message should flash directly on the screen/(0)For standard SMS.
track = 1 -> if you wish to Track the delivery status of the message. (Optional)
A sample post to send sms would be like
Simple Text Messages:
Credits Consumed: 2
Balance Credits: 98
1] i want to give registered users to send SMS thro this script.
2] i want to keep copy of every sms in database with username. (optional)
3] i want to count every users total message count. (160 chars par sms)
Please someone help me out..
Thank you very much for your precious time..
28 September 2008 at 5:07pm
this will be great I will make a widget out of this ;)
so people will be able to send SMS useing their blogs
2 October 2008 at 11:52pm
when it will be available? can you share your more ideas about it? or help me with it? i need some clues to get into development..
Core Development Team
3 October 2008 at 12:09am
We've actually done a few implementations of this in the past. The main reason this code hasn't made it's way into the open source branch is because each implementation is quite different, as much of the code needs to be specific to the API's of the SMS gateway you choose.
So in order to make a useful OS widget out of this, you'll need to pick a SMS gateway which can be used by developers all over the world (one of the reasons again we haven't released any code is we've done integration with relatively obscure SMS gateways historically)
3 October 2008 at 12:27am
If widget is not possible, can you please help me with custom hack to make it work with my current SS installation? i want to make this service available for free to my small community.
|Go to Top|