This tutorial explains how to integrate any SMS HTTP API with DMA Softlab Radius Manager to send SMS notifications such as account activation, password recovery, and expiry alerts.
DMA Softlab Radius Manager has built-in support for SMS/Whatsapp notifications. It sends messages through a PHP gateway file when certain events occur:
You can use whapiplus.com that offers an HTTP GET or POST API. You will need:
Login to your server and locate the SMS gateway file. The common path is:
/var/www/html/radiusmanager/api/smsgateway.php
Important: Always take a backup before editing.
cp smsgateway.php smsgateway.php.bak
Open the file using nano or any editor:
nano smsgateway.php
Replace or modify the SMS sending function with your SMS API code.
Below is a generic PHP example. Replace API URL and parameters according to your SMS provider documentation.
<?php
function sendsms($recp, $body, &$errmsg) {
$apikey = "";
$waid = "";
$message = rawurlencode($body);
$number = rawurlencode($recp);
$url = "https://hajanaone.com/whapi/send.php?apikey=$apikey&waid=$waid&number=$number&message=$message";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
echo $response;
curl_close($ch);
if ($response) {
return true;
} else {
$errmsg = "SMS sending failed";
return false;
}
}
?>
Login to Radius Manager Admin Panel:
SMS message templates are stored in the language folder:
/var/www/html/radiusmanager/lang/English/
Common template files:
You can edit these files to customize SMS text.
After configuration, test SMS delivery by:
If Whatsapp Message is not delivered, check:
Integrating Whatsapp API in DMA Softlab Radius Manager allows automated communication with users. Any HTTP-based Whatsapp API provider can be used by modifying the SMS gateway PHP file.
Tip: Always use HTTPS and keep your API keys secure.