Execute bash script via Custom Destinations

Purpose of this is to use a bash script to execute a remote API post on a mid-tier docker container to change digital signage layouts for emergency events: shooter weather etc. from an extension → IVR/pin → IVR alert menu.

Can execute bash script as root successfully; but having issues running as asterisk user in terminal. I think I am missing something basic I think but do not know what to do next.

Related Info below that I think that is relevant:

File path and perms:
-rwxr-xr-x 1 asterisk asterisk 227 Apr 20 13:41 /var/lib/asterisk/bin/sshpass-test-alert.sh

  • FreePBX 15.0.21
  • Asterisk 15.0.14

extension_custom.conf:
[alert-test]
exten => s,1,System(/var/lib/asterisk/bin/sshpass-test-alert.sh)
exten => s,n,Return

Custom Destination

Little short of stuff,
what does the script do?
Does it expect an argument?
What do the logs show?

  1. script ssh’s into another system and runs output there
  2. no arg’s

still looking for logs pertaining to this

To seemlessy ssh into another system you would need to have the ssh user’s public key copied to the servers authorized keys, have you done so for the asterisk user ?

Logs likely in /var/log/asterisk/full

Ty, I got the keys set and and running the commands via extensions_custom.conf

[alert-bio]
exten => s,1,System(ssh [email protected] ‘/some/script/path.sh’

seems to be working ok

1 Like

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