I´m new about asterisk, but I like it a lot. So I already tried a lot, but still can´t get him working! I just want to start a script, written in Bash.
But first something about my System, I´m using Debian, it´s up to date, also like Asterisk and all the other programms. I´m able to call my Asterisk, answer the Call, play some Music or soundfiles, so please take a look at my Sourcecode and tell me what´s wrong!
Die Fehlermeldung: [quote][Aug 7 04:41:37] WARNING[16121]: app_exec.c:150 tryexec_exec: Could not find application (/etc/asterisk/scripte/laptop)[/quote]
That´s just a part, but the relevant part. So, do you know what I need to do? :mrgreen:
Bye Bye
Edit: What I forgot to say, the rights of the script are 755, the path is correct and the script starts and works if I start it at the prompt!
What user is asterisk running as and what user did you check it ran as ? normally the problem is that asterisk is running as asterisk andteh script is created by root.
YOu´re right… Asterisk runs as asterisk. I tried to start the script like this su asterisk /etc/asterisk/scripte/laptop
but it didn´t work… So I changed the rights to 777, the owner of this script is already asterisk. (chown asterisk /etc/asterisk/scripte/laptop)
I also tried to login as asterisk and create the script directly out of this account, but don´t know the password. I never set a password for this account.
It is possible that the person who created the Debian package tried to make it really secure by making it run with a changed root directory. The purpose of this would be to minimise the ability of anyone who succeeded in a privilege escalation attack’s ability to access resource on the host system. Programs started by Asterisk would see an almost empty file system, with only Asterisk specific files.
In my experience the result of packagers’ attempts to make Asterisk more secure are always to cause grief.
Does the Debian package come from Debian, or from Digium. In the former case, you really should seek support from Debian.
If this is not the case, it is likely that Asterisk is misinterpreting a permission denied condition, so you should check that the asterisk user has sufficient rights on all the directories leading to the script. You should also check for features like SELINUX, if Debian uses it.
Incidentally, giving files mode 777 pretty much defeats the intention behind running Asterisk non-root!
Hey I´m affraid you´re right… It looks like it´s because of Debian, that´s sad.
I used to install asterisk via apt-get install asterisk so it needs to be the Debian-Version.
What do you think, should I use the AsteriskNow Distribution? Do you use it? Or what´s your favourite?
[Description]
Usage: TryExec(appname(arguments))
Allows an arbitrary application to be invoked even when not
hardcoded into the dialplan. To invoke external applications
see the application System. Always returns to the dialplan.
The channel variable TRYSTATUS will be set to:
SUCCESS if the application returned zero
FAILED if the application returned non-zero
NOAPP if the application was not found or was not specified[/code]
I´m sorry, but that was the wrong screenshot. I used to try it with TrySystem, System, TryExc or Exec but nothing worked! I also tried to put the command directly into the TrySystem-command, like this TrySystem(etherwake 00:XX:XX:XX:XX:XX), but it also didn´t work!
Unless I am misunderstanding something in this thread, if Asterisk was installed chroot’ed, then I think all you’d need to do is place that script in the correct directory in order for Asterisk to find it.
I also tried to put the script into /var/lib/asterisk/agi-bin but it still didn´t work!
But let´s take a look at the whole Problem. I just want to execute a command (etherwake xx:xx:xx…), it would be more clear with a bash-script, because I have to wake up about 40 to 50 computers, but it´s also okay to put the etherwake-ommand directly into the dialplan, but I don´t know how to do that ant the script isn´t executed by asterisk, but I don´t know why!
etherwake doesn’t exist on my system, but I would strongly suspect that it can only be run by root, in which case there is no point in trying to invoke it from a packaged Asterisk set to run non-root.
Also, it is very likely to be in /usr/sbin, which will only be in root’s PATH. I suspect that either no PATH is set, or because it is running non-root, PATH is set as for a normal user, without /usr/sbin.