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 (10.150.180.37) and tried a remote SSH (passwordless of course) command from another Pi on the network:

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

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

So then I try:

ssh root@10.150.180.37 /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@10.150.180.37 /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@10.150.180.37 /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@10.150.180.37 “/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.