mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-03 17:54:41 +02:00
Custom Mikrotik SMS Command
This commit is contained in:
parent
38f6738c45
commit
5e2eaa5578
3 changed files with 134 additions and 121 deletions
|
@ -64,7 +64,7 @@ class Message
|
|||
|
||||
public static function MikrotikSendSMS($router_name, $to, $message)
|
||||
{
|
||||
global $_app_stage, $client_m;
|
||||
global $_app_stage, $client_m, $config;
|
||||
if ($_app_stage == 'demo') {
|
||||
return null;
|
||||
}
|
||||
|
@ -73,7 +73,10 @@ class Message
|
|||
$iport = explode(":", $mikrotik['ip_address']);
|
||||
$client_m = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
|
||||
}
|
||||
$smsRequest = new RouterOS\Request('/tool sms send');
|
||||
if(empty($config['mikrotik_sms_command'])){
|
||||
$config['mikrotik_sms_command'] = "/tool sms send";
|
||||
}
|
||||
$smsRequest = new RouterOS\Request($config['mikrotik_sms_command']);
|
||||
$smsRequest
|
||||
->setArgument('phone-number', $to)
|
||||
->setArgument('message', $message);
|
||||
|
@ -231,7 +234,7 @@ class Message
|
|||
$msg = str_replace('[[payment_link]]', '', $msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (
|
||||
!empty($customer['phonenumber']) && strlen($customer['phonenumber']) > 5
|
||||
|
|
|
@ -133,6 +133,9 @@ switch ($action) {
|
|||
$d->save();
|
||||
}
|
||||
}
|
||||
if(empty($config['mikrotik_sms_command'])){
|
||||
$config['mikrotik_sms_command'] = "/tool sms send";
|
||||
}
|
||||
$ui->assign('template_files', $templates);
|
||||
$ui->assign('_c', $config);
|
||||
$ui->assign('php', $php);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue