yes but how can l do that.
Currently using sms service provider.
how to l modified the following api to work with sending sms using Mikrotik.
Thanks
<?php
/*****************************************************************************
** Name: api_sendsms
**
** Description: This function is used to send a SMS messages to a mobile phone.
** You can call your SMS gateway to send a message to a mobile phone.
** The function includes an example code of integrating the
** clickatell.com HTTP -> SMS gateway.
**
** >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
** Syed Jahanziab > I have changed it to use my local sms gateway running on KANNEL , Configured on same box where RM is installed and connected TELTONIKA GSM MODEM with it in VM.
** >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
**
** Input: $mode - SMSMODE_ACCVERIFY: send verification code
** SMSMODE_WELCOME: send account data
** SMSMODE_PSWCODE: send new password activation code
** SMSMODE_NEWPSW: send new password
** $username - RADIUS user name
** $password - RADIUS password
** $firstname - first name of user
** $lastname - last name of user
** $address - postal address of user
** $city - city of user
** $zip - zip code of user
** $country - country of user
** $state - state of user
** $phone - phone number of user
** $mobile - mobile number of user
** $email - email address of user
** $srvid - associated service id
** $verifycode - the verification code to send
** $errmsg - pointer to error message returned by the gateway
**
** Output: True if API succeeded or false
*****************************************************************************/
function api_sendsms($mode, $username, $password, $firstname, $lastname, $address, $city, $zip, $country, $state, $phone, $mobile, $email, $srvid, $verifycode, &$errmsg)
{
// enter your local sms http gateway credentials here
$api_user = "kannel";
$api_password = "kannel";
switch ($mode)
{
case SMSMODE_ACCVERIFY:
$body = "Enter the following verification code in Client service Center: $verifycode";
break;
case SMSMODE_WELCOME:
$body = "Welcome new user! Your user name is $username, your password is $password";
break;
case SMSMODE_PSWCODE:
$body = "New password activation code: $verifycode";
break;
case SMSMODE_NEWPSW:
$body = "Your new password: $password";
break;
}
// return success (uncomment the following lines in testing environments only)
// print $body;
// return true;
// implement your own SMS gateway in the following block
$body = rawurlencode($body);
$ch = curl_init();
// change the IP and id password in the below line to match your local config. syed jahanzaib
curl_setopt($ch, CURLOPT_URL, "
http://1.1.1.1:13013/cgi-bin/sendsms?us ... text=$body");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
// uncomment this to see the result from clickatell.com HTTP->SMS gateway
// print $res;
if (substr($res, 0 , 4) == "ERR:")
{
$errmsg = $res;
return false;
}
// SMS sent successfully
return true;
}
?>