mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
sms-forward: pass phone number and message to hook
These are available as $Phone and $Message in hook.
This commit is contained in:
@ -40,7 +40,8 @@ The configuration goes to `global-config-overlay`, this is the only parameter:
|
||||
* `SmsForwardHooks`: an array with pre-defined hooks, where each hook consists
|
||||
of `match` (which is matched against the received message), `allowed-number`
|
||||
(which is matched against the sending phone number or name) and `command`.
|
||||
For `match` and `allowed-number` regular expressions are supported.
|
||||
For `match` and `allowed-number` regular expressions are supported. Actual
|
||||
phone number (`$Phone`) and message (`$Message`) are available for the hook.
|
||||
|
||||
> ℹ️ **Info**: Copy relevant configuration from
|
||||
> [`global-config`](../global-config.rsc) (the one without `-overlay`) to
|
||||
|
@ -58,7 +58,8 @@ $WaitFullyConnected;
|
||||
$LogPrintExit2 info $0 ("Running hook '" . $Hook->"match" . "': " . \
|
||||
$Hook->"command") false;
|
||||
:do {
|
||||
[ :parse ($Hook->"command") ];
|
||||
:local Command [ :parse ($Hook->"command") ];
|
||||
$Command Phone=$Phone Message=($SmsVal->"message");
|
||||
:set Messages ($Messages . "\n\nRan hook '" . $Hook->"match" . "':\n" . \
|
||||
$Hook->"command");
|
||||
} on-error={
|
||||
|
Reference in New Issue
Block a user