Dialplan Executing Shell Script But Chroot Blocking Required Access

Update:

I’m still not sure if it is chroot or not, but I did discover that if I follow what Guy recommended at the bottom of his thread that I resurrected (Cannot run external application from dial plan, but it is working from the CLI) that it worked.

Essentially, I had to add asterisk to the list of sudoers, with nopassword as well. I do not like this security hole, but I can’t find out why the following keeps happening.

  1. Asterisk, which runs as ‘asterisk’ executes scripts as ‘root’. Why? Also, when the script runs, it runs out of the ‘/tmp’ directory, which I am ok with. How can I get Asterisk to run scripts as ‘asterisk’?

  2. In addition to running the script as ‘asterisk’, how can I get Asterisk to launch the script with the full context of that user, for the purposes of reading files from the asterisk user’s home directory (/home/asterisk/.config/gcloud - in particular).

Thanks for any insight. I don’t want to implement this on all the systems we manage and create a security hole, so I hope to hear of a better way that I can work this. Once I have that figured out, I’ll document this process fully for all to be able to use Google Voice Transcription of voicemails that want it.

Thanks,
JC