Crontab again difference and where to learn

I see many different ways of doing the same thing in crontab and would like to learn the difference. Granted my Linux usage is limited.
58 18 * * * /usr/bin/asterisk -rx “rpt cmd node1 ilink 3 node 2”
58 18 * * * /usr/bin/asterisk -rx “rpt fun node1 *3node2”

So what is the difference between the cmd and fun and where do I find this. In general Linux documentation or AllStar or Hamvoip specific Documentation?
Thanks

Garry

1 Like

In terms of cron there is no difference. Cron is merely starting asterisk with different app_rpt functions. As to why there is a cmd and fun (and fun1) to do the same things I can’t say.

One way to learn the commands is the use of tab and return. Short example:

*CLI> rpt <tab>
cmd         debug       dump        fun         fun1        localnodes  localplay   lstats      nodes       page        playback    reload      
restart     sendall     sendtext    setvar      showvars    stats       xnode       
*CLI> rpt fun<tab> 
fun   fun1  
*CLI> rpt xnode <cr>
Usage: rpt xnode <nodename>
       Dumps extended node info to the console

Play and learn :slight_smile:

1 Like

Found this answer…

I’m pretty sure I’ve seen other references describing these commands but I can’t find them now. However, per the app_rpt source code, available at: https://github.com/AllStarLink/Asterisk/blob/master/asterisk/apps/app_rpt.c, the following explanation is given:

Usage: rpt fun <nodename> <command>
Send a DTMF function to a node

Usage: rpt cmd <nodename> <cmd-name> <cmd-index> <cmd-args>
Send a command to a node.
i.e. rpt cmd 2000 ilink 3 2001

Adding to that, “rpt fun” is identical to using a DTMF function over the air. This requires the exact same configuration of defining the DTMF string and assigning it the proper command in rpt.conf. In contrast, “rpt cmd” directly runs commands and does not require that configuration beforehand.

As I mentioned in the post Tim referenced, using “rpt cmd” can provide security in some cases. If not needed, not defining a DTMF string for a command prevents anyone with over the air access and DTMF capability from running that command. In this case, either using cron or manually via the command line through ssh, etc. , the ability to run that command is only available to properly authenticated users when using “rpt cmd”.

Very well explained.

···

Le ven. 14 août 2020 à 11:06, Brett Friermood via AllStarLink Discussion Groups <noreply@community.allstarlink.org> a écrit :

Brett_Friermood
August 14

I’m pretty sure I’ve seen other references describing these commands but I can’t find them now. However, per the app_rpt source code, available at: https://github.com/AllStarLink/Asterisk/blob/master/asterisk/apps/app_rpt.c, the following explanation is given:

Usage: rpt fun <nodename> <command>

Send a DTMF function to a node

Usage: rpt cmd <nodename> <cmd-name> <cmd-index> <cmd-args>

Send a command to a node.

i.e. rpt cmd 2000 ilink 3 2001

Adding to that, “rpt fun” is identical to using a DTMF function over the air. This requires the exact same configuration of defining the DTMF string and assigning it the proper command in rpt.conf. In contrast, “rpt cmd” directly runs commands and does not require that configuration beforehand.

As I mentioned in the post Tim referenced, using “rpt cmd” can provide security in some cases. If not needed, not defining a DTMF string for a command prevents anyone with over the air access and DTMF capability from running that command. In this case, either using cron or manually via the command line through ssh, etc. , the ability to run that command is only available to properly authenticated users when using “rpt cmd”.


Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

Well thanks for all the answers it make a little more sense now…
Appreciate the help. One of my mentors does it one way and the other does it the other…

Garry

1 Like