Send SMS with GrameenPhone API and PHP

To work with Aloahbei platform, first edit the .wsdl file for SMS which is given on the Aloashbei site. Or you can download it from here.

First, make a config.php file.

$soap = new SoapClient("http://service.onnobela.com/sms.wsdl");

$var['registrationID'] = "******";
$var['password'] = "****";
$var['sourceMsisdn'] = '88017********';
$var['smsPort'] = 7424;
$var['msgType'] = 4;
$var['charge'] = 0.00;
$var['chargedParty'] = '88017********';
$var['contentArea'] = 'gpgp_psms';

Now, make the main index.php file put the number and message into the $var array and call sendSMS api.

$var['destinationMsisdn'] = '88'.$_POST['number'];
$var['msgContent'] = $_POST['msg'];

$result = $soap->sendSMS( array ("SendSMSRequest" => $var) );

Download full code

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s