Macros & Scheduler
A macro is a saved list of DTMF commands your node can run with one number. The scheduler runs those macros automatically at set times, like connecting to a hub for a weekly net and disconnecting when it's over. Click any command or config block to copy it.
How they fit together
Both live in /etc/asterisk/rpt.conf, in sections named after your node number
(this page uses 12345 as the example):
[macro12345] [schedule12345] 3=*36000# ; Connect to 6000 ◄──── 3=00 13 * * 1 ; Connect Monday │ │ └─────────── when (cron format) └── what to do └── which macro to run
The number on the left is the link. A schedule line
that starts with 3= runs macro 3.
Step 1: Add your macros
-
SSH into your node and open the config:
nano /etc/asterisk/rpt.conf -
Scroll down to
[macro12345](with your own node number). It already has one macro:[macro12345] ;Macro number = command string (each command separated by space) -end with HASH 1=*81 *80# ; play time and voice ID
-
Add a “disconnect all” macro under the
1=line:2=*76# ; Disconnect All -
Add a macro to connect to a hub. This one connects node 12345 to hub 6000:
3=*36000# ; Connect to 6000Your macro section now looks like this:[macro12345] ;Macro number = command string (each command separated by space) -end with HASH 1=*81 *80# ; play time and voice ID 2=*76# ; Disconnect All 3=*36000# ; Connect to 6000
Step 2: Schedule them
-
Scroll up to
[schedule12345]. It starts out like this:[schedule12345] ;dtmf_function = minute hour dayofmonth month dayofweek ; ala cron, star is implied ;1=00 * * * * ;run macro 1 on the hour
-
Connect to 6000 at 1:00 PM on Monday by running macro 3:
3=00 13 * * 1 ; Connect Monday -
Disconnect at 1:30 PM on Monday by running macro 2:
2=30 13 * * 1 ; Disconnect MondayYour schedule section now looks like this:[schedule12345] ;dtmf_function = minute hour dayofmonth month dayofweek ; ala cron, star is implied ;1=00 * * * * ;run macro 1 on the hour 2=30 13 * * 1 ; Disconnect Monday 3=00 13 * * 1 ; Connect Monday
-
Save and reboot the node.
reboot
Every Monday your node joins 6000 at 1:00 PM and drops off at 1:30 PM.
Schedule line builder
Pick a macro and a time, and the schedule line is written for you.
Reading a schedule line
The scheduler uses the same five time fields as cron:
3=00 13 * * 1 ; Connect Monday │ │ │ │ │ └── day of week (0–6, 0 = Sunday) │ │ │ │ └───── month (1–12) │ │ │ └──────── day of month (1–31) │ │ └──────────── hour (0–23, 24-hour clock) │ └──────────────── minute (0–59) └────────────────── macro to run
A * means “every.” For more complex timing,
crontab.guru
explains any schedule in plain English.
Commands you can use in a macro
A macro can hold any DTMF command your node understands. Separate commands with a space and end
the line with #. These are the common ones on a stock HamVOIP node:
| Command | What it does | Example |
|---|---|---|
*3 + node | Connect (transceive) | *36000 |
*2 + node | Connect in monitor (listen-only) mode | *26000 |
*1 + node | Disconnect one node | *16000 |
*76 | Disconnect all | *76 |
*80 | Play voice ID | *80 |
*81 | Play the time | *81 |
Chain commands together. 4=*76 *36000#
drops every connection, then connects to 6000, all in one macro.
Tips
The scheduler uses the node's clock. Run
date to check the node's time and time zone before picking your hours.
Run a macro by hand to test it before scheduling:
key up and send *5 followed by the macro number, e.g. *53 runs macro 3.
Command codes can be changed in the [functions]
section of rpt.conf. If yours are different, use your codes in the macros.
Always end a macro with #
and keep each macro's number unique. Two lines with the same number means only one of them will work.