Remote running of asterisk binary

Consider the following command line:

asterisk -rx ‘rpt playback 1103 /etc/asterisk/audio/newsfiles/newstonight’

It runs just fine if entered from the shell on the Pi that node 1102 is on. It plays the audio file “newstonight”

So, I put my SSH public key on this server ( and tried a remote SSH (passwordless of course) command from another Pi on the network:

/usr/bin/ssh root@ /usr/bin/ls

This also works perfectly and give me a directory listing on the remote Pi.

So then I try:

ssh root@ /usr/sbin/asterisk -rx ‘rpt playback 1102 /etc/asterisk/audio/newsfiles /newstonight’

And this is the response:

No such command ‘rpt’ (type ‘help rpt’ for other possible commands)

So I tried (notice double quotes this time)

ssh root@ /usr/sbin/asterisk -rx “rpt playback 1102 /etc/asterisk/audio/newsfiles/newstonight”

Same error

No such command ‘rpt’ (type ‘help rpt’ for other possible commands)

Now, if I do:

ssh root@ /usr/sbin/asterisk -rx 'help rpt ’

I get the whole help listing from asterisk

What the?

1 Like

I found the problem

What I need to use is:

/usr/bin/ssh root@ “/usr/sbin/asterisk -rx ‘rpt localplay 1102 /etc/asterisk/audio/newsfiles/newstonight’”

(notice the use of double and single quotes)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.